Created
August 4, 2009 01:02
-
-
Save davidlee/160959 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
setopt interactive_comments; | |
# | |
# gem tools | |
# | |
# this is a guess. salt to taste. | |
export GEMPATH=`ruby -e 'require "rubygems"; puts Gem.path.reject{|p| p =~ /\.gem/ }.first'`/gems | |
# completion fuction for compdef: just lists the gems folders | |
_gems() { compadd `cd $GEMPATH; echo *` } | |
_ghems() { compadd `cd $GEMPATH; echo *-* | egrep '' ` } | |
compdef _gems gemcd ; gemcd() { cd $GEMPATH/$1 } | |
compdef _gems gemedit ; gemedit() { mate $GEMPATH/$1 } | |
compdef _gems gemgrep ; gemgrep() { grep -r $1 $GEMPATH/$2 } | |
compdef _gems gemgrin ; gemgrin() { grin $1 $GEMPATH/$2 } | |
compdef _ghems gh ; ghd() { } | |
# alias g="echo $GEMPATH" | |
alias gme="gemedit $1" | |
alias gmc="gemcd $1" | |
alias gmg="gemgrin $1 $2" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment