Skip to content

Instantly share code, notes, and snippets.

@delameko
Forked from tapajos/gist:1433859
Last active September 28, 2015 12:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save delameko/1438877 to your computer and use it in GitHub Desktop.
Save delameko/1438877 to your computer and use it in GitHub Desktop.
Script to automatically append 'bundle exec' to the start of a command if there is a Gemfile in the folder.
function rake {
if [ -e Gemfile ]; then
bundle exec rake $@
else
`which rake` $@
fi
}
function rspec {
if [ -e Gemfile ]; then
bundle exec rspec $@
else
`which rspec` $@
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment