2012-12-06 22:07:48 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Chruby < Formula
|
|
|
|
homepage 'https://github.com/postmodern/chruby#readme'
|
2013-12-04 21:59:40 +00:00
|
|
|
url 'https://github.com/postmodern/chruby/archive/v0.3.8.tar.gz'
|
|
|
|
sha1 '320d13bacafeae72631093dba1cd5526147d03cc'
|
2012-12-06 22:07:48 +00:00
|
|
|
|
|
|
|
head 'https://github.com/postmodern/chruby.git'
|
|
|
|
|
|
|
|
def install
|
|
|
|
system 'make', 'install', "PREFIX=#{prefix}"
|
|
|
|
end
|
|
|
|
|
|
|
|
def caveats; <<-EOS.undent
|
2013-08-14 21:33:53 +00:00
|
|
|
Add the following to the ~/.bashrc or ~/.zshrc file:
|
2012-12-06 22:07:48 +00:00
|
|
|
|
2014-03-06 05:28:31 +00:00
|
|
|
source #{opt_share}/chruby/chruby.sh
|
2012-12-06 22:07:48 +00:00
|
|
|
|
2012-12-29 18:27:55 +00:00
|
|
|
By default chruby will search for Rubies installed into /opt/rubies/ or
|
|
|
|
~/.rubies/. For non-standard installation locations, simply set the RUBIES
|
2013-12-04 21:59:40 +00:00
|
|
|
variable after loading chruby.sh:
|
2012-12-06 22:07:48 +00:00
|
|
|
|
2014-11-23 18:45:15 +00:00
|
|
|
RUBIES+=(
|
2012-12-29 18:27:55 +00:00
|
|
|
/opt/jruby-1.7.0
|
|
|
|
$HOME/src/rubinius
|
|
|
|
)
|
|
|
|
|
|
|
|
If you are migrating from another Ruby manager, set `RUBIES` accordingly:
|
2012-12-06 22:07:48 +00:00
|
|
|
|
2014-11-23 18:45:15 +00:00
|
|
|
RVM: RUBIES+=(~/.rvm/rubies/*)
|
|
|
|
rbenv: RUBIES+=(~/.rbenv/versions/*)
|
|
|
|
rbfu: RUBIES+=(~/.rbfu/rubies/*)
|
2012-12-06 22:07:48 +00:00
|
|
|
|
2013-07-07 00:19:45 +00:00
|
|
|
To enable auto-switching of Rubies specified by .ruby-version files,
|
2013-08-14 21:33:53 +00:00
|
|
|
add the following to ~/.bashrc or ~/.zshrc:
|
2012-12-21 03:26:10 +00:00
|
|
|
|
2014-03-06 05:28:31 +00:00
|
|
|
source #{opt_share}/chruby/auto.sh
|
2012-12-06 22:07:48 +00:00
|
|
|
EOS
|
|
|
|
end
|
|
|
|
end
|