homebrew-core/Formula/jruby.rb

34 lines
768 B
Ruby
Raw Normal View History

require 'formula'
class Jruby < Formula
homepage 'http://www.jruby.org'
2012-02-12 22:48:24 +00:00
url 'http://jruby.org.s3.amazonaws.com/downloads/1.6.6/jruby-bin-1.6.6.tar.gz'
sha1 '21de8186235aba98572073041b82f3e3cd7004e4'
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|
2012-02-12 22:48:24 +00:00
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
2012-02-12 22:35:56 +00:00
libexec.install Dir['*']
bin.install_symlink Dir["#{libexec}/bin/*"]
end
def test
system "#{bin}/jruby -e 'puts \"hello\"'"
end
end