23 lines
707 B
Ruby
23 lines
707 B
Ruby
class AmmoniteRepl < Formula
|
|
desc "Ammonite is a cleanroom re-implementation of the Scala REPL"
|
|
homepage "https://ammonite.io/"
|
|
url "https://github.com/lihaoyi/Ammonite/releases/download/2.2.0/2.13-2.2.0"
|
|
sha256 "291c21d9839c1e95cb03d06504ace473da2cc1d3906dc9b7595aa061a1b28b80"
|
|
license "MIT"
|
|
|
|
bottle :unneeded
|
|
|
|
depends_on "openjdk"
|
|
|
|
def install
|
|
(libexec/"bin").install Dir["*"].first => "amm"
|
|
chmod 0755, libexec/"bin/amm"
|
|
(bin/"amm").write_env_script libexec/"bin/amm", JAVA_HOME: "${JAVA_HOME:-#{Formula["openjdk"].opt_prefix}}"
|
|
end
|
|
|
|
test do
|
|
output = shell_output("#{bin}/amm -c 'print(\"hello world!\")'")
|
|
assert_equal "hello world!", output.lines.last
|
|
end
|
|
end
|