21 lines
632 B
Ruby
21 lines
632 B
Ruby
class Rhino < Formula
|
|
desc "JavaScript engine"
|
|
homepage "https://www.mozilla.org/rhino/"
|
|
url "https://github.com/mozilla/rhino/releases/download/Rhino1_7_11_Release/rhino-1.7.11.zip"
|
|
sha256 "94c16e4de06fc08b5f7bf492284b8dc94c6357d3f96cc06fc06dcd6ae3f39547"
|
|
|
|
bottle :unneeded
|
|
|
|
conflicts_with "nut", :because => "both install `rhino` binaries"
|
|
|
|
def install
|
|
rhino_jar = "rhino-#{version}.jar"
|
|
libexec.install "lib/#{rhino_jar}"
|
|
bin.write_jar_script libexec/rhino_jar, "rhino"
|
|
doc.install Dir["docs/*"]
|
|
end
|
|
|
|
test do
|
|
assert_equal "42", shell_output("#{bin}/rhino -e \"print(6*7)\"").chomp
|
|
end
|
|
end
|