homebrew-core/Formula/ammonite-repl.rb

23 lines
688 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", Language::Java.overridable_java_home_env
end
test do
output = shell_output("#{bin}/amm -c 'print(\"hello world!\")'")
assert_equal "hello world!", output.lines.last
end
end