Skip to content

Instantly share code, notes, and snippets.

@wilmoore
Created April 9, 2012 03:24
Show Gist options
  • Select an option

  • Save wilmoore/2341171 to your computer and use it in GitHub Desktop.

Select an option

Save wilmoore/2341171 to your computer and use it in GitHub Desktop.
homebrew formula for ruby-version
require 'formula'
class RubyVersion < Formula
url 'https://github.com/wilmoore/ruby-version/tarball/0.0.2'
homepage 'https://github.com/wilmoore/ruby-version'
md5 '6ad742ce279030fab82b192596a362f3'
head 'https://github.com/wilmoore/ruby-version.git'
def install
prefix.install Dir['*']
end
def caveats;
<<-EOS.undent
Add the following into your $HOME/.bashrc or $HOME/.bash_profile or your shell's equivalent:
########################################################################################
# ruby-version (activate default Ruby version and autocompletion)
# export RUBY_HOME => reflects location of compiled Ruby versions
# export RUBYVERSION_DISABLE_COMPLETE=1 => to disable shell completion
########################################################################################
export $RUBY_HOME=${HOME}/local/ruby
export $RUBY_VERSIONS=${RUBY_HOME}/versions
source $(brew --prefix ruby-version)/ruby-version.sh && ruby-version 1.9.3-rc1 >/dev/null
EOS
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment