-
-
Notifications
You must be signed in to change notification settings - Fork 12.1k
/
rhino.rb
34 lines (28 loc) 路 1007 Bytes
/
rhino.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
class Rhino < Formula
desc "JavaScript engine"
homepage "https://mozilla.github.io/rhino/"
url "https://github.com/mozilla/rhino/releases/download/Rhino1_7_15_Release/rhino-1.7.15.zip"
sha256 "42fce6baf1bf789b62bf938b8e8ec18a1ac92c989dd6e7221e9531454cbd97fa"
license "MPL-2.0"
livecheck do
url :stable
regex(/^(?:Rhino[._-]?)v?(\d+(?:[._]\d+)+)[._-]Release$/i)
strategy :git do |tags, regex|
tags.map { |tag| tag[regex, 1]&.tr("_", ".") }
end
end
bottle do
sha256 cellar: :any_skip_relocation, all: "50d816e647a67bc75f5baa56dfa4609f14d01b1622eee1f4926f12f45ddf476e"
end
depends_on "openjdk@11"
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", java_version: "11"
doc.install Dir["docs/*"]
end
test do
assert_equal "42", shell_output("#{bin}/rhino -e \"print(6*7)\"").chomp
end
end