Merge branch 'benchmarking' of github.com:github/linguist into benchmarking

This commit is contained in:
Arfon Smith
2014-09-10 17:07:01 -05:00
3 changed files with 39 additions and 151 deletions

View File

@@ -1,19 +0,0 @@
module HashDiff
def deep_diff(b)
a = self
(a.keys | b.keys).inject({}) do |diff, k|
if a[k] != b[k]
if a[k].respond_to?(:deep_diff) && b[k].respond_to?(:deep_diff)
diff[k] = a[k].deep_diff(b[k])
else
diff[k] = [a[k], b[k]]
end
end
diff
end
end
end
class Hash
include HashDiff
end