Skip to content

Instantly share code, notes, and snippets.

@raggi raggi/sha_compare.rb Secret
Created Jan 31, 2013

Embed
What would you like to do?
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
You can’t perform that action at this time.