Created
October 18, 2012 16:37
-
-
Save bct/3913085 to your computer and use it in GitHub Desktop.
shell functions for lazy ruby developers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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