2012-12-06 22:07:48 +00:00
|
|
|
class Chruby < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Ruby environment tool"
|
2015-08-03 12:55:31 +00:00
|
|
|
homepage "https://github.com/postmodern/chruby#readme"
|
|
|
|
url "https://github.com/postmodern/chruby/archive/v0.3.9.tar.gz"
|
|
|
|
sha256 "7220a96e355b8a613929881c091ca85ec809153988d7d691299e0a16806b42fd"
|
2012-12-06 22:07:48 +00:00
|
|
|
|
2015-08-03 12:55:31 +00:00
|
|
|
head "https://github.com/postmodern/chruby.git"
|
2012-12-06 22:07:48 +00:00
|
|
|
|
|
|
|
def install
|
2015-08-03 12:55:31 +00:00
|
|
|
system "make", "install", "PREFIX=#{prefix}"
|
2012-12-06 22:07:48 +00:00
|
|
|
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
|