Method: NauktisUtils::Duplicate::HandlingStrategy::NoDeleteIn#handle
- Defined in:
- lib/nauktis_utils/duplicate.rb
#handle(files) ⇒ Object
66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/nauktis_utils/duplicate.rb', line 66 def handle(files) files = files.sort files_kept, files_deleted = files.partition do |e| @directories.any? {|d| e.start_with?(d) } end if files_kept.size > 0 files_deleted.each do |duplicate| @deleting_strategy.delete_duplicate(duplicate, files_kept.first) end end end |