Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
# cd into a matching gem directory. Pass a grep compatible
# regular expression. If you don't pass anything, it goes
# to the root gem directory.
cdgem ()
local gempath=$(gem env gemdir)/gems;
if [[ $1 == "" ]]; then
cd $gempath;
local gem=$(ls $gempath | grep $1 | sort | tail -1);
if [[ $gem != "" ]]; then
cd $gempath/$gem;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment