homebrew-core/Formula/jruby.rb

44 lines
958 B
Ruby
Raw Normal View History

require 'formula'
class Jruby < Formula
2010-09-28 19:44:11 +00:00
url 'http://jruby.org.s3.amazonaws.com/downloads/1.5.3/jruby-src-1.5.3.tar.gz'
homepage 'http://www.jruby.org'
2010-09-28 19:44:11 +00:00
md5 'add7da33a41c6477485bdde6c5d227ac'
def install
# Remove Windows files
rm Dir['bin/*.{bat,dll,exe}']
# Prefix a 'j' on some commands
Dir.chdir 'bin' do
Dir['*'].each do |file|
mv file, "j#{file}" unless file.match /^[j_]/
end
end
# Only keep the OS X native libraries
Dir.chdir 'lib/native' do
Dir['*'].each do |file|
rm_rf file unless file.downcase == 'darwin'
end
end
(prefix+'jruby').install Dir['*']
bin.mkpath
Dir["#{prefix}/jruby/bin/*"].each do |f|
ln_s f, bin+File.basename(f)
end
end
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
def test
2010-06-30 04:51:06 +00:00
system "jruby -e 'puts \"hello\"'"
end
end