Skip to content

Instantly share code, notes, and snippets.

@alex-zige
Created January 7, 2014 02:37
Show Gist options
  • Save alex-zige/8293850 to your computer and use it in GitHub Desktop.
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.
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