Skip to content

Instantly share code, notes, and snippets.

@Aenigma
Created July 21, 2012 03:14
Show Gist options
  • Save Aenigma/3154427 to your computer and use it in GitHub Desktop.
Save Aenigma/3154427 to your computer and use it in GitHub Desktop.
def mkhash(filelist)
hash = Hash.new()
hash.default = []
filelist.each do |path|
File.open(path) do |f|
tmp = f.read
hash[tmp].push(path)
end
end
return hash
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment