homebrew-core/Formula/ringojs.rb

27 lines
685 B
Ruby

class Ringojs < Formula
desc "CommonJS-based JavaScript runtime"
homepage "https://ringojs.org"
url "https://github.com/ringo/ringojs/releases/download/v1.2.1/ringojs-1.2.1.tar.gz"
sha256 "a04ba090e2a2835a196e4748b699e6f6842ff68919e73dea8f6193af73fdd841"
license "Apache-2.0"
bottle :unneeded
depends_on java: "1.8"
def install
rm Dir["bin/*.cmd"]
libexec.install Dir["*"]
bin.install Dir["#{libexec}/bin/*"]
bin.env_script_all_files(libexec/"bin", Language::Java.java_home_env("1.8"))
end
test do
(testpath/"test.js").write <<~EOS
var x = 40 + 2;
console.assert(x === 42);
EOS
system "#{bin}/ringo", "test.js"
end
end