Skip to content

Instantly share code, notes, and snippets.

@JackDanger
Forked from tenderlove/results.txt
Created May 30, 2009 08:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JackDanger/120442 to your computer and use it in GitHub Desktop.
Save JackDanger/120442 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'yaml'
require 'set'
SEATTLERB = [
'aaron patterson',
'alex vollmer',
'andy smith',
'damon danieli',
'dave myron',
'eric hodel',
'evan phoenix',
'geoff grosenbach',
'jack danger canty',
'john barnette',
'mike mondragon',
'phil hagelderg',
'ryan davis',
]
file = 'yaml.marshal'
if !File.exists?(file)
system("wget http://gems. github.com/yaml ||" +
" curl -O http://gems.github.com/yaml")
File.open(file, 'wb') { |f|
f.write(Marshal.dump(YAML.load_file('yaml')))
}
end
### Ryan is a special little girl
RYAN = [
"InlineFortran",
"ParseTree",
"RubyInline",
"RubyToC",
"ZenHacks",
"ZenTest",
"bfts",
"box_layout",
"flog",
"heckle",
"hoe",
"image_science",
"miniunit",
"minitest",
"png",
"ruby2ruby",
"ruby_parser",
"rubyforge",
"test-unit",
"vlad",
"zentest",
]
specs = []
Marshal.load(File.read(file)).gems.each do |name, spec|
next unless spec.authors.any? { |author|
SEATTLERB.any? { |seattlerb|
author =~ /#{seattlerb}/i
}
}
next if spec.description =~ /too lazy to write/
if spec.authors.any? { |author| author =~ /Ryan/ }
next unless RYAN.include?(spec.name)
end
specs << spec
end
puts "total gem count: #{specs.length}"
puts "unique gem count: #{specs.map { |x| x.name }.uniq.length}"
dates = Hash.new { |dates,year|
dates[year] = Hash.new { |yr,month| yr[month] = [] }
}
specs.each do |spec|
dates[spec.date.year][spec.date.month] << spec
end
dates.sort_by { |k,v| k }.each do |year,hash|
hash.sort_by { |k,v| k }.each do |month,specs|
puts "#{year}-#{month}: #{specs.length}"
end
end
dates.sort_by { |k,v| k }.each do |year,hash|
hash.sort_by { |k,v| k }.each do |month,specs|
puts "#{year}-#{month}: #{specs.length}"
specs.sort_by { |x| x.name }.each do |spec|
puts " #{spec.full_name}"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment