homebrew-core/Formula/ammonite-repl.rb

23 lines
736 B
Ruby

class AmmoniteRepl < Formula
desc "Ammonite is a cleanroom re-implementation of the Scala REPL"
homepage "https://lihaoyi.github.io/Ammonite/#Ammonite-REPL"
url "https://github.com/lihaoyi/Ammonite/releases/download/2.0.4/2.13-2.0.4"
sha256 "3ad1ccbf799c7b228ae61662bc46f11db84dee35bc56a1b9c89901306dc24039"
revision 1
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