Created
January 23, 2009 21:00
-
-
Save nex3/51190 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Rubygems documentation lookup | |
## From http://stephencelis.com/archive/2008/6/bashfully-yours-gem-shortcuts | |
gemdoc() { | |
local gemdir=`gem env gemdir` | |
gnome-open $gemdir/doc/`ls $gemdir/doc/ | grep $1 | sort | tail -1`/rdoc/index.html | |
} | |
_gemdocomplete() { | |
COMPREPLY=($(compgen -W '$(ls `gem env 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