Skip to content

Instantly share code, notes, and snippets.

@betawaffle
Created May 24, 2011 21:30
Show Gist options
  • Save betawaffle/989747 to your computer and use it in GitHub Desktop.
Save betawaffle/989747 to your computer and use it in GitHub Desktop.
Easy Switch RVM Completions
local ruby18='ruby-1.8.7-p334'
local ruby19='ruby-1.9.2-p180'
function rb18 {
if [ -z "$1" ]; then
rvm use "$ruby18"
else
rvm use "$ruby18@$1"
fi
}
_rb18() {compadd `ls -1 $rvm_path/gems | grep "^$ruby18@" | sed -e "s/^$ruby18@//" | awk '{print $1}'`}
compdef _rb18 rb18
function rb19 {
if [ -z "$1" ]; then
rvm use "$ruby19"
else
rvm use "$ruby19@$1"
fi
}
_rb19() {compadd `ls -1 $rvm_path/gems | grep "^$ruby19@" | sed -e "s/^$ruby19@//" | awk '{print $1}'`}
compdef _rb19 rb19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment