Created
July 13, 2011 15:49
-
-
Save ahawthorne/1080580 to your computer and use it in GitHub Desktop.
more useful .rvmrc
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
# enter your gemset below | |
rvm ruby-1.9.2-p180@eyd | |
# no need to edit below here | |
alias rails="bundle exec rails" | |
alias specjour="bundle exec specjour" | |
alias rspec="bundle exec rspec" | |
alias rake="bundle exec rake" | |
_VIM=$(which vim) | |
_GVIM=$(which vim) | |
_SED=$(which sed) | |
_GREP=$(which grep) | |
_APPDIR=`dirname $rvm_current_rvmrc` | |
# usage: v some/path/returned/from/cucumber:25 | |
function v() { | |
param=`echo "$@" | $_SED 's/:\([0-9]*\)$/ +\1/'` | |
$_VIM $param | |
} | |
# provide a path or PT id | |
function cucumber() { | |
cd $_APPDIR | |
if [ -f "$@" ]; | |
then | |
bundle exec cucumber --require features -f pretty "$@" | |
else | |
line=$(echo "$@" | $_SED -e '/.*:\([0-9]\+\)/!d;s//\1/') | |
param=$(echo "$@" | $_SED 's/:.*//') | |
if [ $(echo $param | grep -oE ^[0-9]\+$) ]; | |
then | |
param=$(locate_pt "$param") | |
fi | |
if [ -z $line ]; | |
then | |
bundle exec cucumber --require features -f pretty "$param" | |
else | |
bundle exec cucumber --require features -f pretty "$param:$line" | |
fi | |
fi | |
cd - | |
} | |
# return the absolute path for a pivotal tracker id | |
function locate_pt() { | |
echo $($_GREP -ril "$@" ${_APPDIR}/features/*) | |
} | |
# usage: gvpt pivotal_tracker_id | |
# example: gvpt 123456 | |
function gvpt(){ | |
param=$(locate_pt "$@") | |
$_GVIM --remote-tab-silent "$param" | |
} | |
# usage: vimpt pivotal_tracker_id | |
# example: vimpt 123456 | |
function vimpt(){ | |
param=$(locate_pt "$@") | |
$_VIM "$param" | |
} | |
rvm info binaries |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
function cdapp(){
cd $_APPDIR
}