Skip to content

Instantly share code, notes, and snippets.

@takeru
Created January 18, 2010 05:11
Show Gist options
  • Save takeru/279800 to your computer and use it in GitHub Desktop.
Save takeru/279800 to your computer and use it in GitHub Desktop.
require "date"
gem_names = []
gem_names += %w(google-appengine appengine-tools appengine-sdk appengine-rack appengine-jruby-jars appengine-apis rack)
#gem_names += %w(rack rails activesupport actionpack erubis builder i18n)
#gem_names += %w(sinatra)
["gem", "jgem"].each do |gem_command|
puts "appengine gem versions[#{gem_command}]: #{Time.now}"
cmd = "#{gem_command} list"
#puts cmd
gems = `#{cmd}`.split("\n").collect{|v| v.strip }.sort
gems.each do |gem|
if gem =~ /^(\S+) \((.+)\)$/
name = $1
next unless gem_names.include?(name)
versions = $2.split(",").collect{|v| v.strip }.sort
puts " #{name}"
versions.each do |version|
cmd = "#{gem_command} specification #{name} -v #{version} | grep date:"
#puts cmd
date = Date.parse(`#{cmd}`[/(\d\d\d\d-\d\d-\d\d)/, 1])
puts " %-12s %s" % [version, date.strftime("%Y-%m-%d")]
end
end
end
end
% ruby gae_jruby_versions.rb
appengine gem versions[gem]: Wed Jan 20 15:02:36 +0900 2010
appengine-apis
0.0.12 2009-12-21
appengine-jruby-jars
0.0.6 2009-12-21
0.0.7.pre 2009-12-15
appengine-rack
0.0.6 2009-12-21
appengine-sdk
1.3.0 2009-12-21
appengine-tools
0.0.8 2010-01-16
google-appengine
0.0.8 2010-01-15
rack
1.0.1 2009-10-18
appengine gem versions[jgem]: Wed Jan 20 15:02:44 +0900 2010
appengine-apis
0.0.12 2009-12-21
appengine-jruby-jars
0.0.6 2009-12-21
0.0.7.pre 2009-12-15
appengine-rack
0.0.6 2009-12-21
appengine-sdk
1.3.0 2009-12-21
appengine-tools
0.0.8 2010-01-16
google-appengine
0.0.8 2010-01-15
rack
1.0.1 2009-10-18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment