Created
May 4, 2017 18:11
-
-
Save mark-d-holmberg/2da7283eb106f89b8d7f698815a952bc to your computer and use it in GitHub Desktop.
MD5Sum a Directory in Ruby.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'digest' | |
files = Dir["#{Dir.pwd}/db-migrate/**/*.rb"] | |
sorted = files.map { |file| Digest::MD5.file(file).hexdigest }.sort | |
content = "" | |
sorted.each { |k| content << "#{k}\n" } | |
Digest::MD5.hexdigest(content) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment