Created
January 7, 2014 02:37
-
-
Save alex-zige/8293850 to your computer and use it in GitHub Desktop.
A quick shell script for setting up gemset with ruby2. auto-mapping gemset name to be lowercase and underscore version of your current folder name.
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 set_ruby2_with_gemset(){ | |
local result=${PWD##*/} | |
local result=${result// /_} | |
local result=$(echo $result | tr '[A-Z]' '[a-z]') | |
echo "prepare ruby 2.0 with gemset "$result | |
rvm --create ruby-2.0.0-p247@$result | |
} | |
function use_ruby2_with_gemset(){ | |
local result=${PWD##*/} | |
local result=${result// /_} | |
local result=$(echo $result | tr '[A-Z]' '[a-z]') | |
echo "use ruby 2.0 with gemset "$result | |
rvm use ruby-2.0.0-p247@$result | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment