2012-12-06 22:07:48 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Chruby < Formula
|
|
|
|
homepage 'https://github.com/postmodern/chruby#readme'
|
2012-12-29 18:27:55 +00:00
|
|
|
url 'https://github.com/postmodern/chruby/archive/v0.3.1.tar.gz'
|
|
|
|
sha1 '90c3fce7a512acc8b60d5efd3e6a2eeadcd5a238'
|
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
|
|
|
|
|
2012-12-29 18:27:55 +00:00
|
|
|
Add the following to the /etc/profile.d/chruby.sh, ~/.bashrc or
|
|
|
|
~/.zshrc 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-21 03:26:10 +00:00
|
|
|
|
2012-12-06 22:07:48 +00:00
|
|
|
EOS
|
|
|
|
end
|
|
|
|
end
|