Skip to content

Instantly share code, notes, and snippets.

@raggi
Created January 31, 2013 01:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save raggi/4e1990b144780936eef7 to your computer and use it in GitHub Desktop.
Save raggi/4e1990b144780936eef7 to your computer and use it in GitHub Desktop.
cf = open('rubygems-shas')
cf_list = cf.each_line.map { |l| l.split(/\s+/) }
cf_sums = Hash[cf_list.map! { |sum, n| [File.basename(n), sum] }]
db = open('drbrain-shas')
db_list = db.each_line.map { |l| l.split(/\s+/) }
db_sums = Hash[db_list.map! { |sum, n| [File.basename(n), sum] }]
cf_sums.each do |name, sum|
db_sum = db_sums[name]
puts "Missing : #{name}" unless db_sum
puts "Mismatch: #{name}" unless db_sum == sum
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment