2014-05-08 14:10:20 +00:00
|
|
|
require "formula"
|
2009-09-07 04:13:03 +00:00
|
|
|
|
2009-11-03 16:41:13 +00:00
|
|
|
class Jruby < Formula
|
2014-05-08 14:10:20 +00:00
|
|
|
homepage "http://www.jruby.org"
|
2014-07-06 15:03:14 +00:00
|
|
|
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
|
|
|
|
2009-09-07 04:13:03 +00:00
|
|
|
def install
|
2010-03-19 19:21:10 +00:00
|
|
|
# Remove Windows files
|
2014-05-08 14:10:20 +00:00
|
|
|
rm Dir["bin/*.{bat,dll,exe}"]
|
2010-03-19 19:21:10 +00:00
|
|
|
|
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
|
2009-09-07 04:13:03 +00:00
|
|
|
end
|
2010-03-19 19:21:10 +00:00
|
|
|
|
|
|
|
# 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/*"]
|
2009-09-07 04:13:03 +00:00
|
|
|
end
|
2009-12-21 17:00:10 +00:00
|
|
|
|
2014-02-23 21:31:41 +00:00
|
|
|
test do
|
2012-05-15 18:31:21 +00:00
|
|
|
system "#{bin}/jruby", "-e", "puts 'hello'"
|
2009-12-21 17:00:10 +00:00
|
|
|
end
|
2009-09-07 04:13:03 +00:00
|
|
|
end
|