Skip to content

Instantly share code, notes, and snippets.

@wildfalcon
Created April 23, 2010 15:25
Show Gist options
  • Save wildfalcon/376673 to your computer and use it in GitHub Desktop.
Save wildfalcon/376673 to your computer and use it in GitHub Desktop.
#Compares to Bundler lock files and prints a report
#of which gems have changed version
require "yaml"
old = YAML.load_file("Gemfile.lock.old")
current = YAML.load_file("Gemfile.lock")
old['specs'].each do |elem|
elem.each do |name, details|
old_name = name
old_version = details['version']
current_gem = current['specs'].detect{|e| e.keys.first==old_name}
current_version = current_gem[old_name]['version']
puts "#{old_name} changed from #{old_version} to #{current_version}" unless old_version==current_version
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment