21 lines
630 B
Ruby
21 lines
630 B
Ruby
class Rhino < Formula
|
|
desc "JavaScript engine"
|
|
homepage "https://www.mozilla.org/rhino/"
|
|
url "https://github.com/mozilla/rhino/releases/download/Rhino1_7_9_Release/rhino-1.7.9.zip"
|
|
sha256 "6fb72a1e92e99c96b34a7b2c860dd3a6e7ef7f3492f4d9678eb5339d67ad7f32"
|
|
|
|
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
|