Skip to content

Instantly share code, notes, and snippets.

@danmayer
Created October 2, 2011 17:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danmayer/1257690 to your computer and use it in GitHub Desktop.
Save danmayer/1257690 to your computer and use it in GitHub Desktop.
This helps setup and trust a new gemset in a project
#!/usr/bin/env ruby
# example usage: init_gemset mygemset
# to use this setup an alias in your .bash_profile
#
# #setup new gemset
# function initgemset()
# {
# local myresult=`ruby /Users/danmayer/projects/script_helpers/init_gemset.rb $#1`
# eval "$myresult"
# }
#
# alias init_gemset='initgemset'
#
# puts "creating gemset #{ARGV[0]} and .rvmrc with 'rvm use ree-1.8.7-2011.03@#{ARGV[0]}'"
`rvm use ree`
`rvm gemset create #{ARGV[0]}`
`echo 'rvm use ree-1.8.7-2011.03@#{ARGV[0]}' > .rvmrc`
old_dir = `pwd`.strip
rvmrc_file = "#{old_dir}/.rvmrc"
`rvm rvmrc trust #{rvmrc_file}`
puts "rvm use ree-1.8.7-2011.03@#{ARGV[0]}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment