lib/file_scanner/worker.rb in file_scanner-3.2.2 vs lib/file_scanner/worker.rb in file_scanner-3.2.3
- old
+ new
@@ -20,11 +20,13 @@
@filecheck = filecheck
@logger = logger
end
def call
+ @logger.info { "scanning \e[33m#{path}\e[0m" }
@logger.debug { "skipping directories" } if @filecheck
+ @logger.debug { "applying \e[36m#{@filters.size}\e[0m filters by \e[35m#{@mode}\e[0m" }
paths.lazy.select { |file| valid?(file) && filter(file) }
rescue StandardError => e
@logger.error { e.message }
raise e
end
@@ -37,12 +39,11 @@
return true unless @filecheck
FileTest.file?(file)
end
private def filter(file)
- @logger.debug { "filters applied by \e[35m#{@mode}\e[0m" }
@filters.send(@mode) do |filter|
- @logger.debug { "filtering on \e[33m#{File.basename(file)}\e[0m" }
+ @logger.debug { "filtering \e[37m#{File.basename(file)}\e[0m" }
filter.call(file)
end
end
private def paths