Skip to content

Instantly share code, notes, and snippets.

@alekseyl
Last active January 31, 2017 16:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alekseyl/4dbc61124cc5f96e1b3f93560457b7f2 to your computer and use it in GitHub Desktop.
Save alekseyl/4dbc61124cc5f96e1b3f93560457b7f2 to your computer and use it in GitHub Desktop.
Digest on all files from folder in rails
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