2012-12-06 22:07:48 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Chruby < Formula
|
|
|
|
homepage 'https://github.com/postmodern/chruby#readme'
|
2013-08-18 22:22:29 +00:00
|
|
|
url 'https://github.com/postmodern/chruby/archive/v0.3.7.tar.gz'
|
|
|
|
sha1 '237903096f874f40749520d267fe35e2e3222bb3'
|
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
|
|
|
|
2013-08-22 16:22:23 +00:00
|
|
|
source #{opt_prefix}/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
|
|
|
|
variable:
|
2012-12-06 22:07:48 +00:00
|
|
|
|
2012-12-29 18:27:55 +00:00
|
|
|
RUBIES=(
|
|
|
|
/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
|
|
|
|
|
|
|
RVM: RUBIES=(~/.rvm/rubies/*)
|
|
|
|
rbenv: RUBIES=(~/.rbenv/versions/*)
|
2013-08-14 21:33:53 +00:00
|
|
|
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
|
|
|
|
2013-08-22 16:22:23 +00:00
|
|
|
source #{opt_prefix}/share/chruby/auto.sh
|
2012-12-06 22:07:48 +00:00
|
|
|
EOS
|
|
|
|
end
|
|
|
|
end
|