lib/ehbrs/videos/unsupported/search.rb in ehbrs-tools-0.3.1 vs lib/ehbrs/videos/unsupported/search.rb in ehbrs-tools-0.5.0

- old
+ new

@@ -1,16 +1,18 @@ # frozen_string_literal: true -require 'eac_ruby_utils/filesystem_traverser' +require 'eac_ruby_utils/fs/traversable' require 'eac_ruby_utils/core_ext' require 'ehbrs/videos/unsupported/file' module Ehbrs module Videos module Unsupported class Search + include ::EacRubyUtils::Fs::Traversable enable_console_speaker + enable_simple_cache VALID_EXTENSIONS = %w[.avi .mp4 .mkv .m4v].freeze def initialize(root, file_options) @root = root @@ -19,25 +21,26 @@ @videos = 0 @unsupported = 0 run end + def traverser_recursive + true + end + + def traverser_sort + true + end + private def run start_banner - traverser = ::EacRubyUtils::FilesystemTraverser.new - traverser.recursive = true - traverser.check_file = method(:check_file) - traverser.check_path(@root) + traverser_check_path(@root) end_banner end - def recursive? - true - end - - def check_file(file) + def traverser_check_file(file) @files += 1 check_video(file) if video_file?(file) end def check_video(file)