Created
December 12, 2011 11:03
Revisions
-
etrepat revised this gist
Dec 12, 2011 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -5,5 +5,5 @@ F.ex: $ curl -L https://gist.github.com/raw/1466610/1c43c0ab209eac10896844b137dc127ce439fb5a/bundler-exec.sh > ~/.bundler-exec.sh $ echo "[ -f ~/.bundler-exec.sh ] && source ~/.bundler-exec.sh" >> ~/.bashrc -
etrepat revised this gist
Dec 12, 2011 . 1 changed file with 0 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -37,8 +37,6 @@ bundler-installed() which bundle > /dev/null 2>&1 } within-bundled-project() { local dir="$(pwd)" -
etrepat created this gist
Dec 12, 2011 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,65 @@ #!/bin/bash BUNDLED_COMMANDS="${BUNDLED_COMMANDS:- cap capify cucumber foreman guard haml heroku html2haml rackup rails rake rake2thor rspec ruby sass sass-convert serve shotgun spec spork thin thor tilt tt turn unicorn unicorn_rails }" ## Functions bundler-installed() { which bundle > /dev/null 2>&1 } within-bundled-project() { local dir="$(pwd)" while [ "$(dirname $dir)" != "/" ]; do [ -f "$dir/Gemfile" ] && return dir="$(dirname $dir)" done false } run-with-bundler() { if bundler-installed && within-bundled-project; then bundle exec $@ else $@ fi } ## Main program for CMD in $BUNDLED_COMMANDS; do alias $CMD="run-with-bundler $CMD" done 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ ## Install * Copy bundler-exec.sh to ~/.bundler-exec.sh. * Source it from your ~/.bashrc file. F.ex: $ curl -L https://github.com/gma/bundler-exec/raw/master/bundler-exec.sh > ~/.bundler-exec.sh $ echo "[ -f ~/.bundler-exec.sh ] && source ~/.bundler-exec.sh" >> ~/.bashrc