Skip to content

Instantly share code, notes, and snippets.

@bretweinraub
Created October 27, 2010 15:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bretweinraub/649205 to your computer and use it in GitHub Desktop.
Save bretweinraub/649205 to your computer and use it in GitHub Desktop.
rvmuse () {
gemsets=$(grep '@' < <(cd ~/.rvm/gems; find . -maxdepth 1 -type d))
set $gemsets
x=0
while [ $# -gt 0 ];do
((x=$x+1))
echo $x"): "$1 >&2
shift
done
read line
x=0
set $gemsets
while [ $# -gt 0 ];do
((x=$x+1))
if [ "$line" = "$x" ]; then
eval "rvm use "$(echo $1 | cut -d/ -f2-)
fi
shift
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment