-
-
Save timabell/6219158 to your computer and use it in GitHub Desktop.
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
# Script for switching your own gems in and out of a project | |
# without interfering with git's status. Caveat emptor. | |
# Instructions: | |
# Source this file from your .bashrc, this will make bundle-local available | |
# Put a Gemfile.local in your project with the gems you want to use | |
# run `bundle-local on && bundle` from your project directory | |
# run `bundle-local off` if you are going to need to check in changes to your bundle | |
bundle-local () | |
{ | |
local command="$1"; | |
if [ "$command" = "on" ]; then | |
if ! grep --color=auto -qs Gemfile.local Gemfile; then | |
echo "Appending local gems to gemfile..." | |
echo "eval File.read('Gemfile.local')" >> Gemfile; | |
echo "Telling git to ignore gemfile changes..." | |
git update-index --assume-unchanged Gemfile Gemfile.lock; | |
echo "Updating bundles..." | |
bundle; | |
fi; | |
else | |
if [ "$command" = "off" ]; then | |
echo "Appending local gems to gemfile..." | |
sed -i '/Gemfile.local/d' Gemfile; | |
echo "Telling git not to ignore gemfile changes..." | |
git update-index --no-assume-unchanged Gemfile Gemfile.lock; | |
echo "Updating bundles..." | |
bundle; | |
else | |
echo "Usage: bundle-local <on|off>" 1>&2; | |
return 1; | |
fi; | |
fi | |
} |
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
group :development do | |
gem 'debugger' | |
gem 'spring' | |
end | |
group :test do | |
gem 'minitest', '4.3.0' | |
gem 'tconsole', '1.2.8' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment