Skip to content

Instantly share code, notes, and snippets.

@FestivalBobcats
Created September 8, 2011 16:00
Show Gist options
  • Save FestivalBobcats/1203757 to your computer and use it in GitHub Desktop.
Save FestivalBobcats/1203757 to your computer and use it in GitHub Desktop.
Quickly open a gem directory with Textmate
gemopen() {
gem_dir=( $(find $GEM_HOME/gems -maxdepth 1 | grep $1) )
for line in ${!gem_dir[*]}; do
echo $(($line + 1)). ${gem_dir[$line]}
done
if [ ${#gem_dir[*]} == 0 ]; then
echo $1 directory not found.
else
echo -e '> \c'
read inpt
dir=${gem_dir[$inpt - 1]}
if [ -d $dir ]; then
mate $dir
fi
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment