Created
June 4, 2014 13:55
-
-
Save yoshinari-nomura/ac908d458b0be7eb6f4f to your computer and use it in GitHub Desktop.
Sample .rvmrc for searching suitable Ruby version from the name of gemset
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 characters
| MY_PROJECT_GEMSET='filebucket' | |
| MY_PROJECT_RUBY_AND_GEMSET=$( \ | |
| rvm gemset list_all \ | |
| | awk '/^gemset/{ruby = $3}; /^ /{print ruby "@" $1}' \ | |
| | grep "@$MY_PROJECT_GEMSET\$" \ | |
| | tail -1 | |
| ) | |
| if [ -n "$MY_PROJECT_RUBY_AND_GEMSET" ]; then | |
| echo "rvm use $MY_PROJECT_RUBY_AND_GEMSET" | |
| rvm use "$MY_PROJECT_RUBY_AND_GEMSET" | |
| else | |
| echo "Not found suitable gemset for $MY_PROJECT_GEMSET... abort" | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment