Created
December 9, 2009 16:01
-
-
Save zevarito/252558 to your computer and use it in GitHub Desktop.
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
actionmailer (2.3.4, 2.3.2, 2.2.2, 2.1.2, 2.1.1, 2.1.0, 2.0.2) | |
actionpack (2.3.4, 2.3.2, 2.2.2, 2.1.2, 2.1.1, 2.1.0, 2.0.2) | |
activerecord (2.3.4, 2.3.2, 2.2.2, 2.1.2, 2.1.1, 2.1.0, 2.0.2) | |
activeresource (2.3.4, 2.3.2, 2.2.2, 2.1.2, 2.1.1, 2.1.0, 2.0.2) | |
activesupport (2.3.4, 2.3.2, 2.2.2, 2.1.2, 2.1.1, 2.1.0, 2.0.2) | |
adzap-ar_mailer (2.1.5) | |
ambethia-smtp-tls (1.1.2) | |
binarylogic-authlogic (2.1.1) | |
bones (2.5.1) | |
brynary-webrat (0.4.0) | |
builder (2.1.2) | |
bullet (1.7.0) | |
capistrano (2.5.5) | |
carrierwave (0.3.5.1) | |
cgi_multipart_eof_fix (2.5.0) | |
cheat (1.2.1) | |
chronic (0.2.3) | |
ClothRed (0.4.1) | |
colored (1.1) | |
columnize (0.2) | |
commonwatir (1.6.2) | |
compass (0.8.17) | |
compass-susy-plugin (0.6.3) | |
configuration (1.1.0) | |
contest (0.1.2) | |
crack (0.1.2) | |
cucumber (0.4.3) | |
culerity (0.2.3) | |
curb (0.5.1.0) | |
curl-multi (0.2) | |
daemon-spawn (0.2.0) | |
daemons (1.0.10) | |
darkfish-rdoc (1.1.5) | |
dcadenas-rspec2rr (0.1.0) | |
devise (0.6.0, 0.5.2) | |
diff-lcs (1.1.2) | |
dm-core (0.10.0) | |
engineyard-eycap (0.4.6) | |
factory_girl (1.2.3) | |
faker (0.3.1) | |
fakeweb (1.2.6, 1.2.5) | |
FakeWeb (1.1.2) | |
fastercsv (1.5.0, 1.4.0) | |
fastthread (1.0.7) | |
firewatir (1.6.2) | |
gem_plugin (0.2.3) | |
GeoRuby (1.3.4) | |
gettext (1.93.0) | |
graybook (1.1.1) | |
haml (2.2.13, 2.2.10, 2.0.9) | |
happymapper (0.2.2) | |
hashrocket-mad_mimi_mailer (0.0.6) | |
hashtostruct (0.9.1) | |
heroku (1.3.0) | |
highline (1.5.0) | |
hoe (1.12.1) | |
hpricot (0.8.1, 0.6.164) | |
htmlentities (4.0.0) | |
httparty (0.4.3) | |
i18n (0.2.0) | |
json (1.1.7, 1.1.3) | |
json_pure (1.1.9) | |
launchy (0.3.3) | |
libxml-ruby (0.9.8) | |
linecache (0.43) | |
mechanize (0.9.2) | |
memcached (0.17.4) | |
mime-types (1.16) | |
mini_magick (1.2.3) | |
mislav-will_paginate (2.3.8) | |
mocha (0.9.7, 0.9.5) | |
mongrel (1.1.5) | |
mysql (2.7) | |
net-scp (1.0.2) | |
net-sftp (2.0.2) | |
net-ssh (2.0.11) | |
net-ssh-gateway (1.0.1) | |
newrelic (2.7.4) | |
nokogiri (1.2.3) | |
packet (0.1.15) | |
pluginaweek-state_machine (0.8.0) | |
polyglot (0.2.9, 0.2.8, 0.2.5) | |
rabble-geoplanet (0.2.3) | |
rack (1.0.1, 0.9.1) | |
rails (2.3.4, 2.3.2, 2.2.2, 2.1.2, 2.1.1, 2.1.0, 2.0.2) | |
rake (0.8.7, 0.8.4) | |
rcov (0.8.1.2.0) | |
rdiscount (1.3.4) | |
rdoc (2.4.3) | |
RedCloth (4.2.2, 4.1.0) | |
redgreen (1.2.2) | |
rest-client (1.0.3) | |
rillow (0.2.0) | |
rmagick (2.9.1) | |
rr (0.7.1, 0.6.0) | |
rspec (1.2.9, 1.2.7, 1.1.11) | |
rspec-rails (1.2.9, 1.1.11) | |
ruby-debug (0.10.3) | |
ruby-debug-base (0.10.3) | |
ruby-gpgme (1.0.7) | |
ruby-growl (1.0.1) | |
rubyforge (1.0.4, 1.0.3) | |
rubygems-update (1.3.5) | |
RubyInline (3.8.3) | |
rubyist-aasm (2.0.5) | |
rvm (0.0.64) | |
s4t-utils (1.0.4) | |
scrubyt (0.4.06) | |
sqlite3-ruby (1.2.4) | |
sr-mg (0.0.5) | |
taf2-curb (0.4.8.0) | |
technoweenie-rest-client (0.5.1) | |
term-ansicolor (1.0.4, 1.0.3) | |
test-spec (0.10.0) | |
thoughtbot-factory_girl (1.2.1, 1.1.5, 1.1.3) | |
thoughtbot-shoulda (2.10.2) | |
tinder (1.2.0) | |
treetop (1.4.2, 1.4.1, 1.2.5) | |
tzinfo (0.3.13) | |
user-choices (1.1.6) | |
validatable (1.6.7) | |
warden (0.6.4, 0.6.1, 0.5.1) | |
webmat-git_remote_branch (0.3.0) | |
webrat (0.5.3, 0.4.4) | |
will_paginate (2.2.2) | |
wirble (0.1.2) | |
xml-simple (1.0.12) | |
xmpp4r (0.4) | |
ZenTest (4.1.4) |
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
@gems_installed_list = `sudo gem list` | |
begin | |
@gems_to_install_list = File.open(ARGV.first) | |
rescue | |
puts "usage: ruby sync_gems.rb your_file_with_gems_list" | |
exit 1 | |
end | |
def gem_versions(gem_string) | |
if(releases = gem_string.match(/\((.*)\)/)[1]) | |
releases.split(",").each {|r| r.strip!} | |
end | |
end | |
def gem_name(gem_string) | |
gem_string.match(/(.*)\s\(/)[1] | |
end | |
def gem_exist?(name, version) | |
@gems_installed_list.each do |gem_string| | |
return true if gem_name(gem_string) == name && gem_versions(gem_string).include?(version) | |
end | |
false | |
end | |
# begin | |
@gems_to_install_list.each do |gem_string| | |
gem_versions(gem_string).each do |version| | |
name = gem_name(gem_string) | |
if !gem_exist?(name, version) | |
puts "Installing: #{name} version #{version}" | |
puts `sudo gem install #{name} -v=#{version} --no-rdoc --no-ri` | |
else | |
puts "skipping #{name} version #{version}, because it is already installed" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment