Skip to content

Instantly share code, notes, and snippets.

@jjulian
Created May 26, 2009 14:32
Show Gist options
  • Save jjulian/118091 to your computer and use it in GitHub Desktop.
Save jjulian/118091 to your computer and use it in GitHub Desktop.
open a gem's src code in one shell command
# Inspired by Gembox
function opengem {
mate $GEMDIR/gems/`ls $GEMDIR/gems/|grep $1|sort|tail -1`/
}
_opengemcomplete() {
COMPREPLY=($(compgen -W '$(ls $GEMDIR/gems)' -- ${COMP_WORDS[COMP_CWORD]}))
return 0
}
complete -o default -o nospace -F _opengemcomplete opengem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment