Skip to content

Instantly share code, notes, and snippets.

@mattconnolly
Created November 5, 2011 21:48
Show Gist options
  • Save mattconnolly/1342065 to your computer and use it in GitHub Desktop.
Save mattconnolly/1342065 to your computer and use it in GitHub Desktop.
require 'rubygems'
#require 'bundler/setup'
GEMSET = 'rails_backup_migrate'
def rvm_do(version, command)
# using inspect to place command in quotes, and escape other quotes
script = "rvm #{version}@#{GEMSET} do #{command.inspect}"
puts "about to execute: #{script}"
`#{script}`
end
puts rvm_do('1.8.7', 'gem list')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment