2012-12-06 22:07:48 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Chruby < Formula
|
|
|
|
homepage 'https://github.com/postmodern/chruby#readme'
|
2013-02-19 05:43:11 +00:00
|
|
|
url 'https://github.com/postmodern/chruby/archive/v0.3.3.tar.gz'
|
|
|
|
sha1 '3167afdb679f7c9d486410ad98578658f4956d24'
|
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-01-16 03:06:19 +00:00
|
|
|
Add the following to the /etc/profile.d/chruby.sh, ~/.bash_profile or
|
|
|
|
~/.zprofile file:
|
2012-12-06 22:07:48 +00:00
|
|
|
|
2012-12-29 18:27:55 +00:00
|
|
|
source #{HOMEBREW_PREFIX}/opt/chruby/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/*)
|
|
|
|
rbfu: RUBIES=('~/.rbfu/rubies/*)
|
|
|
|
|
2012-12-21 03:26:10 +00:00
|
|
|
To enable auto-switching of Rubies specified by .ruby-version files:
|
|
|
|
|
2012-12-29 18:27:55 +00:00
|
|
|
source #{HOMEBREW_PREFIX}/opt/chruby/share/chruby/auto.sh
|
2012-12-06 22:07:48 +00:00
|
|
|
EOS
|
|
|
|
end
|
|
|
|
end
|