Skip to content

Instantly share code, notes, and snippets.

@edjames
Created February 3, 2012 11:45
Show Gist options
  • Save edjames/1729804 to your computer and use it in GitHub Desktop.
Save edjames/1729804 to your computer and use it in GitHub Desktop.
Import a gemset without bundler Ruby 1.8.7
#!/usr/bin/env ruby
unless ARGV.count >= 2
puts "Please provide two files to perform diff..."
exit
end
def load_file file
arr = File.readlines(file).map(&:chomp).compact
arr.shift if arr.first =~ /^#/
arr
end
f1, f2 = load_file(ARGV[0]), load_file(ARGV[1])
command = ARGV[2] || 'install'
((f1 - f2) + (f2 - f1)).uniq.each do |gem|
puts "gem #{command} #{gem}"
end
# vzaar_app.gems generated gem export file. Note that any env variable settings will be missing. Append these after using a ';' field separator
actionmailer -v2.1.1
actionpack -v2.1.1
activerecord -v2.1.1
activeresource -v2.1.1
activesupport -v2.1.1
amazon-ec2 -v0.3.8
awesome_print -v0.2.1
aws-s3 -v0.6.2
builder -v2.1.2
bundler -v1.0.12
capistrano -v2.5.5
capistrano-ext -v1.2.1
capistrano_colors -v0.5.4
celerity -v0.8.9
cgi_multipart_eof_fix -v2.5.0
childprocess -v0.1.8
columnize -v0.3.1
commandline -v0.7.10
configuration -v1.2.0
crack -v0.1.7
cucumber -v0.3.101
culerity -v0.2.15
daemons -v1.0.10
diff-lcs -v1.1.2
ebayapi -v0.11.0
entp-multipass -v1.1.2
eventmachine -v0.12.8
excon -v0.6.2
ezcrypto -v0.7.2
factory_girl -v1.3.3
fastthread -v1.0.7
ffi -v1.0.7
ffi -v1.0.6
fog -v0.7.2
foreman -v0.25.0
formatador -v0.1.3
gchartrb -v0.8
gem_plugin -v0.2.3
god -v0.11.0
guard -v0.4.2
guard -v0.3.0
guard-rspec -v0.4.0
guard-spork -v0.1.6
hashie -v0.4.0
highline -v1.5.2
hoe -v2.6.0
hpricot -v0.8.2
httparty -v0.4.3
jasmine -v1.0.2.1
jaxn-parse_user_agent -v0.1.1
json -v1.5.1
json -v1.4.2
json_pure -v1.5.1
launchy -v0.3.7
linecache -v0.43
log4r -v1.1.7
mash -v0.0.3
mechanize -v1.0.0
memcache-client -v1.8.3
memcached -v0.17.4
mime-types -v1.16
mocha -v0.9.8
money -v1.7.1
mongrel -v1.1.5
mongrel -v0.3.4
msgpack -v0.4.4
multipass -v1.1.3
mysql -v2.7
net-scp -v1.0.2
net-sftp -v2.0.4
net-ssh -v2.1.4
net-ssh -v2.0.22
net-ssh-gateway -v1.0.1
newrelic_rpm -v3.0.0
nokogiri -v1.4.4
nokogiri -v1.4.1
oauth -v0.3.4
open_gem -v1.4.2
paperclip -v2.3.1.1
pdfkit -v0.5.0
polyglot -v0.3.1
postmark -v0.4.3
postmark-rails -v0.1.2
rack -v1.1.0
rack-test -v0.6.0
railroad -v0.5.0
rails -v2.1.1
rake -v0.8.7
rb-fsevent -v0.4.0
rbtrace -v0.3.12
rcov -v0.9.7
responds_to_parent -v1.0.20091013
right_aws -v2.1.0
right_http_connection -v1.3.0
right_http_connection -v1.2.4
rmagick -v2.13.1
rspec -v1.3.1
rspec-core -v2.6.4
rspec-expectations -v2.6.0
rspec-mocks -v2.6.0
rspec-rails -v1.3.3
ruby-debug -v0.10.3
ruby-debug-base -v0.10.3
ruby-debug-ide -v0.4.9
ruby-hmac -v0.4.0
rubyforge -v2.0.4
rubyzip -v0.9.4
selenium-webdriver -v0.2.0
sfl -v1.2
simple-rss -v1.2
spork -v0.8.4
spreedly -v1.3.1
starling-starling -v0.10.0
sunnytrail -v0.0.1.4
sunnytrail -v0.0.1.3
syntax -v1.0.0
term-ansicolor -v1.0.5
text-format -v1.0.0
text-hyphen -v1.0.0
thin -v1.2.4
thor -v0.14.6
tmail -v1.2.7.1
treetop -v1.4.5
trollop -v1.16.2
twitter -v0.6.12
tzinfo -v0.3.13
uuidtools -v1.0.7
watchr -v0.7
webrat -v0.4.4
will_paginate -v2.2.2
wirble -v0.1.3
xml-mapping -v0.8.1
xml-simple -v1.0.12
xpath -v0.1.4
zip -v2.0.2
arr = DATA.readlines.map { |r| r[/\{.*?\}/] }.compact
gems = arr.inject([]) do |list, value|
list << eval(value)
end
gems.sort!{ |a, b| a[:name].downcase <=> b[:name].downcase }
gems.each do |gem|
puts "#{gem[:name]} -v#{gem[:version]}"
end
__END__
set[:vzaar_application][:gems_dependencies] = [
{:name => "ZenTest", :version => "4.5.0"},
{:name => "addressable", :version => "2.0.1"},
{:name => "abstract", :version => "1.0.0"},
{:name => "amqp", :version => "0.6.0"},
{:name => "aws-s3", :version => "0.6.2"},
{:name => "bcrypt-ruby", :version => "2.0.3"},
{:name => "builder", :version => "2.1.2"},
{:name => "campaign_monitor", :version => "0.1.1"},
{:name => "cgi_multipart_eof_fix", :version => "2.5.0"},
{:name => "columnize", :version => "0.3.0"},
{:name => "commandline", :version => "0.7.10"},
{:name => "crack", :version => "0.1.4"},
{:name => "cucumber", :version => "0.3.3"},
{:name => "daemons", :version => "1.1.0"},
{:name => "data_objects", :version => "0.9.11"},
{:name => "diff-lcs", :version => "1.1.2"},
{:name => "xml-mapping", :version => "0.8.1"},
{:name => "money", :version => "1.7.1"},
{:name => "ebayapi", :version => "0.11.0"},
{:name => "multipass", :version => "1.2.3"},
{:name => "erubis", :version => "2.6.6"},
{:name => "eventmachine", :version => "0.12.10"},
{:name => "extlib", :version => "0.9.10"},
{:name => "json", :version => "1.5.1"},
{:name => "json_pure", :version => "1.5.1"},
{:name => "ezcrypto", :version => "0.7.2"},
{:name => "fastthread", :version => "1.0.1"},
{:name => "flvtool2", :version => "1.0.6"},
{:name => "gchartrb", :version => "0.8"},
{:name => "gem_plugin", :version => "0.2.3"},
{:name => "god", :version => "0.11.0"},
{:name => "haml", :version => "3.0.25"},
{:name => "highline", :version => "1.5.0"},
{:name => "hoe", :version => "2.3.2"},
{:name => "hpricot", :version => "0.6"},
{:name => "httparty", :version => "0.4.3"},
{:name => "jaxn-parse_user_agent", :version => "0.1.1"},
{:name => "linecache", :version => "0.43"},
{:name => "log4r", :version => "1.1.9"},
{:name => "mailfactory", :version => "1.4.0"},
{:name => "mash", :version => "0.1.1"}, # :version => "0.0.3"},
{:name => "mechanize", :version => "1.0.0"},
{:name => "mime-types", :version => "1.16"},
{:name => "mongrel", :version => "1.1.5"},
{:name => "mysql", :version => "2.8.1"},
{:name => "nokogiri", :version => "1.4.1"},
{:name => "oauth", :version => "0.3.4"},
{:name => "paperclip", :version => "2.3.1.1"},
{:name => "ParseTree", :version => "3.0.3"},
{:name => "polyglot", :version => "0.2.5"},
{:name => "postmark", :version => "0.9.1"},
{:name => "postmark-rails", :version => "0.4.0"},
{:name => "rack", :version => "1.2.1"},
{:name => "rails", :version => "2.1.1"},
{:name => "rake", :version => "0.8.7"},
{:name => "randexp", :version => "0.1.4"},
{:name => "responds_to_parent", :version => "1.0.20091013"},
{:name => "right_aws", :version => "2.1.0"},
{:name => "right_http_connection", :version => "1.3.0"},
{:name => "route53", :version => "0.1.8"},
{:name => "rspec", :version => "1.1.4"},
{:name => "rubigen", :version => "1.5.6"},
{:name => "ruby-debug", :version => "0.10.4"},
{:name => "ruby-debug-base", :version => "0.10.4"},
{:name => "ruby-hmac", :version => "0.3.2"},
{:name => "ruby2ruby", :version => "1.2.2"},
{:name => "rubyforge", :version => "1.0.3"},
{:name => "RubyInline", :version => "3.8.1"},
{:name => "sexp_processor", :version => "3.0.1"},
{:name => "simple-rss", :version => "1.2"},
{:name => "skynet", :version => "0.9.3"},
{:name => "sources", :version => "0.0.1"},
{:name => "spreedly", :version => "1.3.1"},
{:name => "templater", :version => "0.5.0"},
{:name => "term-ansicolor", :version => "1.0.3"},
{:name => "test-unit", :version => "2.0.2"},
{:name => "text-format", :version => "1.0.0"},
{:name => "text-hyphen", :version => "1.0.0"},
{:name => "thin", :version => "1.2.8"},
{:name => "thor", :version => "0.9.9"},
{:name => "tmail", :version => "1.2.6"},
{:name => "tmm1-amqp", :version => "0.6.4"},
{:name => "treetop", :version => "1.2.5"},
{:name => "twitter", :version => "0.6.12"},
{:name => "tzinfo", :version => "0.3.13"},
{:name => "uuidtools", :version => "1.0.3"},
{:name => "will_paginate", :version => "2.2.2"},
{:name => "xml-simple", :version => "1.0.12"},
{:name => "capistrano", :version => "2.5.19"},
{:name => "newrelic_rpm", :version => "3.0.0"},
{:name => "capistrano-ext", :version => "1.2.1"},
{:name => "capistrano_colors", :version => "0.5.4"},
{:name => "sunnytrail", :version => "0.0.1.5"},
{:name => "wkhtmltopdf-binary", :version => "0.9.5.1"},
{:name => "pdfkit", :version => "0.5.0"},
{:name => "whenever", :version => "0.7.0"},
{:name => "zip", :version => "2.0.2"},
{:name => "remote_syslog", :version => "1.4.1"}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment