Skip to content

Instantly share code, notes, and snippets.

@ericdke
Created March 28, 2014 11:04
Show Gist options
  • Save ericdke/9830254 to your computer and use it in GitHub Desktop.
Save ericdke/9830254 to your computer and use it in GitHub Desktop.
Find new entries in a hash (difference between two hashes)
entries = {
1372284000 => "CVE-2013-4073",
1368482400 => "CVE-2013-2065"
}
updated_entries = {
1385074800 => "CVE-2013-4164",
1372284000 => "CVE-2013-4073",
1368482400 => "CVE-2013-2065"
}
# Usage
new_entries = updated_entries.reject { |k, _| entries.include? k }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment