Skip to content

Instantly share code, notes, and snippets.

@vvalgis
Forked from sshirokov/gemit.rb
Created November 23, 2011 11:28
Show Gist options
  • Save vvalgis/1388474 to your computer and use it in GitHub Desktop.
Save vvalgis/1388474 to your computer and use it in GitHub Desktop.
Install gems from a gem list dump
#!/usr/bin/env ruby
#gem_cmd = ENV["GEM_CMD"] || 'sudo gem'
gem_cmd = 'gem'
STDIN.map { |l| l.strip }.each { |l|
gem, versions = l.split(' ', 2)
versions = versions.gsub(/[\(\)]/, '').split(', ')
versions.each { |version|
cmd = "#{gem_cmd} install #{gem} -v #{version} --no-ri --no-rdoc"
puts cmd if ENV["PRETEND"] or ENV["ECHO"]
system cmd unless ENV["PRETEND"]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment