33 lines
869 B
Ruby
33 lines
869 B
Ruby
class Ballerina < Formula
|
|
desc "A Programming Language for Network Distributed Applications"
|
|
homepage "https://ballerina.io"
|
|
url "https://product-dist.ballerina.io/downloads/1.1.1/ballerina-1.1.1.zip"
|
|
sha256 "bdfa55bd121063a21d9a50eefb725d5a2f74d591078739884c55cd34ca87182d"
|
|
|
|
bottle :unneeded
|
|
|
|
depends_on :java => "1.8"
|
|
|
|
def install
|
|
# Remove Windows files
|
|
rm Dir["bin/*.bat"]
|
|
|
|
chmod 0755, "bin/ballerina"
|
|
|
|
bin.install "bin/ballerina"
|
|
libexec.install Dir["*"]
|
|
bin.env_script_all_files(libexec/"bin", Language::Java.java_home_env("1.8"))
|
|
end
|
|
|
|
test do
|
|
(testpath/"helloWorld.bal").write <<~EOS
|
|
import ballerina/io;
|
|
public function main() {
|
|
io:println("Hello, World!");
|
|
}
|
|
EOS
|
|
output = shell_output("#{bin}/ballerina run helloWorld.bal")
|
|
assert_equal "Hello, World!", output.chomp
|
|
end
|
|
end
|