Created
June 15, 2011 06:03
-
-
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/
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
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.