2009-10-15 08:07:12 +00:00
|
|
|
require 'formula'
|
2009-09-07 04:13:03 +00:00
|
|
|
|
2009-11-03 16:41:13 +00:00
|
|
|
class Jruby < Formula
|
|
|
|
homepage 'http://www.jruby.org'
|
2012-12-04 23:14:23 +00:00
|
|
|
url 'http://jruby.org.s3.amazonaws.com/downloads/1.7.1/jruby-bin-1.7.1.tar.gz'
|
|
|
|
sha1 '7270fe8bdf94c365fe540b9fe7e88adf6b8ad30d'
|
2009-09-07 04:13:03 +00:00
|
|
|
|
2012-09-14 16:07:47 +00:00
|
|
|
env :std
|
|
|
|
|
2009-09-07 04:13:03 +00:00
|
|
|
def install
|
2010-03-19 19:21:10 +00:00
|
|
|
# Remove Windows files
|
|
|
|
rm Dir['bin/*.{bat,dll,exe}']
|
|
|
|
|
|
|
|
# Prefix a 'j' on some commands
|
2012-02-21 06:04:21 +00:00
|
|
|
cd 'bin' do
|
2009-09-07 04:13:03 +00:00
|
|
|
Dir['*'].each do |file|
|
2012-02-12 22:48:24 +00:00
|
|
|
mv file, "j#{file}" unless file.match /^[j]/
|
2009-09-07 04:13:03 +00:00
|
|
|
end
|
|
|
|
end
|
2010-03-19 19:21:10 +00:00
|
|
|
|
|
|
|
# Only keep the OS X native libraries
|
2012-02-21 06:04:21 +00:00
|
|
|
cd 'lib/native' do
|
2009-11-16 19:17:19 +00:00
|
|
|
Dir['*'].each do |file|
|
2010-06-13 03:08:03 +00:00
|
|
|
rm_rf file unless file.downcase == 'darwin'
|
2009-11-16 19:17:19 +00:00
|
|
|
end
|
|
|
|
end
|
2009-09-07 04:13:03 +00:00
|
|
|
|
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
|
|
|
|
|
|
|
def test
|
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
|