Skip to content

Instantly share code, notes, and snippets.

@jcamenisch
Created June 15, 2011 06:03
Show Gist options
  • Save jcamenisch/1026569 to your computer and use it in GitHub Desktop.
Save jcamenisch/1026569 to your computer and use it in GitHub Desktop.
Proposed standard .rvmrc to encapsulate desired gemset practice ala http://ryan.mcgeary.org/2011/02/09/vendor-everything-still-applies/
rvm use ruby-1.9.2 #or ruby of choice
if [ -t 0 ]; then # In interactive shell; offer assistance
if [ ! -f .bundle/config ]; then
echo 'For this project, you should set your bundle path to ./vendor'
read -sn 1 -p 'Would you like to configure this now? [yn]' RESPONSE
echo
if [ "$RESPONSE" = "y" -o "$RESPONSE" = "Y" ]; then
[ ! -d .bundle ] && mkdir .bundle
cat > .bundle/config <<EoF
---
BUNDLE_PATH: vendor
BUNDLE_DISABLE_SHARED_GEMS: "1"
EoF
echo BUNDLE_PATH set for application in .bundle/config
fi
fi
fi
@jcamenisch
Copy link
Author

The goal here is to go beyond automating and documenting the choice of ruby version, to also documenting and automating the standard BUNDLE_PATH for application development.

It's not as succinct as I would hope this functionality could be, nor does it address some corner cases. But the vast majority of the time, it ought to help the project newcomer get steered toward the standard practice very quickly.

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