homebrew-core/Formula/jruby.rb

30 lines
828 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 "http://jruby.org.s3.amazonaws.com/downloads/1.7.13/jruby-bin-1.7.13.tar.gz"
sha1 "8d26690be96e41950b643a5207936acac6392db0"
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