Skip to content

Instantly share code, notes, and snippets.

@bct
Created October 18, 2012 16:37
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 bct/3913085 to your computer and use it in GitHub Desktop.
Save bct/3913085 to your computer and use it in GitHub Desktop.
shell functions for lazy ruby developers
function lsgems() {
rubyversion=$(ruby -v | cut -f2 -d' ' | sed 's/p/-p/')
gemroot=~/.rvm/gems/ruby-"$rubyversion"/gems
ls "$gemroot"
}
function cdgem() {
rubyversion=$(ruby -v | cut -f2 -d' ' | sed 's/p/-p/')
gemroot=~/.rvm/gems/ruby-"$rubyversion"/gems
gemdir=$(ls -d "$gemroot/$1"-* | tail -n1)
cd "$gemdir"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment