Skip to content

Instantly share code, notes, and snippets.

@aussiegeek
Created May 23, 2009 00:56
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 aussiegeek/116446 to your computer and use it in GitHub Desktop.
Save aussiegeek/116446 to your computer and use it in GitHub Desktop.
export GEMDIR=`gem env gemdir`
gemdoc() {
open $GEMDIR/doc/`$(which ls) $GEMDIR/doc | grep $1 | sort | tail -1`/rdoc/index.html
}
_gemdocomplete() {
COMPREPLY=($(compgen -W '$(`which ls` $GEMDIR/doc)' -- ${COMP_WORDS[COMP_CWORD]}))
return 0
}
complete -o default -o nospace -F _gemdocomplete gemdoc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment