Last active
January 31, 2017 16:09
-
-
Save alekseyl/4dbc61124cc5f96e1b3f93560457b7f2 to your computer and use it in GitHub Desktop.
Digest on all files from folder in rails
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
def all_files_in(dir) | |
Dir[ File.join(dir, '**', '*') ].reject { |p| File.directory? p } | |
end | |
new_namespace = Digest::SHA256.hexdigest( all_files_in( 'app/views' ) | |
.map{|fl| Digest::SHA256.file(fl).hexdigest } | |
.join ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment