Class: MD5FindCommand
- Inherits:
-
FindCommand
- Object
- FindCommand
- MD5FindCommand
- Defined in:
- lib/justy/commands/md5_find_command.rb
Instance Attribute Summary
Attributes inherited from FindCommand
Instance Method Summary collapse
Methods inherited from FindCommand
Constructor Details
This class inherits a constructor from FindCommand
Instance Method Details
#run(folder) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/justy/commands/md5_find_command.rb', line 9 def run(folder) Dir.glob(folder + '**/*', File::FNM_DOTMATCH).each do |filename| next if File.directory?(filename) key = Digest::MD5.hexdigest(IO.read(filename)).to_sym if @files.has_key? key @files[key].push filename else @files[key] = [filename] end end output() end |