Skip to content

Instantly share code, notes, and snippets.

@ahawthorne
Created July 13, 2011 15:49
Show Gist options
  • Save ahawthorne/1080580 to your computer and use it in GitHub Desktop.
Save ahawthorne/1080580 to your computer and use it in GitHub Desktop.
more useful .rvmrc
# 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
@sdavies
Copy link

sdavies commented Jul 13, 2011

function cdapp(){
cd $_APPDIR
}

@ahawthorne
Copy link
Author

nice! added!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment