Skip to content

Instantly share code, notes, and snippets.

@rmanalan
Created March 30, 2009 03:51
Show Gist options
  • Save rmanalan/87618 to your computer and use it in GitHub Desktop.
Save rmanalan/87618 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