homebrew-core/Formula/jruby.rb

30 lines
829 B
Ruby
Raw Normal View History

2014-05-08 14:10:20 +00:00
require "formula"
class Jruby < Formula
2014-05-08 14:10:20 +00:00
homepage "http://www.jruby.org"
url "https://s3.amazonaws.com/jruby.org/downloads/1.7.19/jruby-bin-1.7.19.tar.gz"
sha1 "a3296d1ae9b9aa78825b8d65a0d2498b449eaa3d"
2012-09-14 16:07:47 +00:00
def install
# Remove Windows files
2014-05-08 14:10:20 +00:00
rm Dir["bin/*.{bat,dll,exe}"]
2014-05-08 14:10:20 +00:00
cd "bin" do
# Prefix a 'j' on some commands to avoid clashing with other rubies
%w{ast rake rdoc ri testrb}.each { |f| mv f, "j#{f}" }
# Delete some unnecessary commands
rm "gem" # gem is a wrapper script for jgem
rm "irb" # irb is an identical copy of jirb
end
# Only keep the OS X native libraries
2014-04-17 14:45:57 +00:00
rm_rf Dir["lib/jni/*"] - ["lib/jni/Darwin"]
2012-02-12 22:35:56 +00:00
libexec.install Dir['*']
bin.install_symlink Dir["#{libexec}/bin/*"]
end
test do
system "#{bin}/jruby", "-e", "puts 'hello'"
end
end