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
|
2010-09-30 16:30:56 +00:00
|
|
|
url 'http://jruby.org.s3.amazonaws.com/downloads/1.5.3/jruby-bin-1.5.3.tar.gz'
|
2009-11-03 16:41:13 +00:00
|
|
|
homepage 'http://www.jruby.org'
|
2010-09-30 16:30:56 +00:00
|
|
|
md5 'ccb0b2dbc300d8dd4ad1bd4da48b8320'
|
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
|
2009-09-07 04:13:03 +00:00
|
|
|
Dir.chdir 'bin' do
|
|
|
|
Dir['*'].each do |file|
|
2010-03-19 19:21:10 +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
|
2009-11-16 19:17:19 +00:00
|
|
|
Dir.chdir 'lib/native' do
|
|
|
|
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
|
|
|
|
2010-06-13 03:08:03 +00:00
|
|
|
(prefix+'jruby').install Dir['*']
|
|
|
|
|
|
|
|
bin.mkpath
|
|
|
|
Dir["#{prefix}/jruby/bin/*"].each do |f|
|
|
|
|
ln_s f, bin+File.basename(f)
|
|
|
|
end
|
2009-09-07 04:13:03 +00:00
|
|
|
end
|
2009-12-21 17:00:10 +00:00
|
|
|
|
2010-07-18 19:31:09 +00:00
|
|
|
def caveats; <<-EOS.undent
|
2010-09-28 19:44:11 +00:00
|
|
|
Consider using RVM to manage Ruby environments:
|
2010-07-18 19:31:09 +00:00
|
|
|
* RVM: http://rvm.beginrescueend.com/
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
|
2009-12-21 17:00:10 +00:00
|
|
|
def test
|
2010-06-30 04:51:06 +00:00
|
|
|
system "jruby -e 'puts \"hello\"'"
|
2009-12-21 17:00:10 +00:00
|
|
|
end
|
2009-09-07 04:13:03 +00:00
|
|
|
end
|