Skip to content

Instantly share code, notes, and snippets.

@julik
Created November 19, 2014 21:51
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 julik/0115bb1ce1e61b8b3d3a to your computer and use it in GitHub Desktop.
Save julik/0115bb1ce1e61b8b3d3a to your computer and use it in GitHub Desktop.
# Make a little report :-)
added_keys = preserved.keys - ENV.keys
removed_keys = ENV.keys - preserved.keys
changed_keys = preserved.keys.select{|k| ENV.keys.include?(k) }.select{|k| preserved[k] != ENV[k] }
puts "Added to ENV and not removed #{added_keys.join(', ')}" if added_keys.any?
puts "Removed from ENV and not re-added #{removed_keys.join(', ')}" if removed_keys.any?
puts "Mutated in ENV and not reset #{changed_keys.join(', ')}" if changed_keys.any?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment