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"
|
2015-02-02 07:05:31 +00:00
|
|
|
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
|
|
|
|
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
|