-
-
Save wayneeseguin/611684 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
function rvm_require_ruby | |
{ | |
if ! rvm list strings | grep -q "^$1" ; then | |
echo "ERROR: Requires Ruby Version: '$1'" | |
return 1 | |
fi | |
return 0 | |
} | |
function rvm_use | |
{ | |
rvm_require_ruby $1 | |
if [[ $? -gt 0 ]] ; then | |
# handle the error | |
exit | |
fi | |
rvm use $1 | |
return $? | |
} | |
function rvm_require_gemset | |
{ | |
if ! rvm gemset list | grep -q "^$1" ; then | |
echo "ERROR: Requires RVM Gemset: '$1'" | |
return 1 | |
fi | |
return 0 | |
} | |
function rvm_gemset_use | |
{ | |
rvm_require_gemset "$1" | |
if [[ $? -gt 0 ]] ; then | |
# handle the error | |
exit | |
fi | |
rvm gemset use "$1" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment