2012-12-06 22:07:48 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Chruby < Formula
|
|
|
|
homepage 'https://github.com/postmodern/chruby#readme'
|
2012-12-21 03:26:10 +00:00
|
|
|
url 'https://github.com/postmodern/chruby/archive/v0.3.0.tar.gz'
|
|
|
|
sha1 '3c207a7b43d8e66928704237aadc043353799a5d'
|
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
|
|
|
|
For a system wide install, add the following to /etc/profile.d/chruby.sh.
|
|
|
|
|
|
|
|
#!/bin/sh
|
2012-12-21 03:26:10 +00:00
|
|
|
source #{opt_prefix}/share/chruby/chruby.sh
|
2012-12-06 22:07:48 +00:00
|
|
|
RUBIES=(/opt/rubies/*)
|
|
|
|
|
|
|
|
For a local install, add the following to ~/.bashrc or ~/.zshrc.
|
|
|
|
|
|
|
|
#!/bin/sh
|
2012-12-21 03:26:10 +00:00
|
|
|
source #{opt_prefix}/share/chruby/chruby.sh
|
2012-12-06 22:07:48 +00:00
|
|
|
RUBIES=(~/.rubies/*)
|
|
|
|
|
|
|
|
To use existing Rubies installed by RVM, rbenv or rbfu, set RUBIES to
|
|
|
|
the following:
|
|
|
|
|
|
|
|
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:
|
|
|
|
|
|
|
|
source #{opt_prefix}/share/chruby/auto.sh
|
|
|
|
|
2012-12-06 22:07:48 +00:00
|
|
|
EOS
|
|
|
|
end
|
|
|
|
end
|