Class: Ehbrs::Tools::Runner::Videos::Series::Rename
- Inherits:
-
Object
- Object
- Ehbrs::Tools::Runner::Videos::Series::Rename
- Includes:
- EacFs::Traversable
- Defined in:
- lib/ehbrs/tools/runner/videos/series/rename.rb
Instance Method Summary collapse
- #banner ⇒ Object
- #files_uncached ⇒ Object
- #paths ⇒ Object
- #rename_files ⇒ Object
- #run ⇒ Object
- #series_file_options_uncached ⇒ Object
- #show_results ⇒ Object
- #traverser_check_file(path) ⇒ Object
- #traverser_recursive ⇒ Object
Instance Method Details
#banner ⇒ Object
32 33 34 35 |
# File 'lib/ehbrs/tools/runner/videos/series/rename.rb', line 32 def infov 'Paths', paths.count infov 'Files found', files.count end |
#files_uncached ⇒ Object
37 38 39 40 41 |
# File 'lib/ehbrs/tools/runner/videos/series/rename.rb', line 37 def files_uncached @files = [] paths.each { |path| traverser_check_path(path) } @files end |
#paths ⇒ Object
43 44 45 |
# File 'lib/ehbrs/tools/runner/videos/series/rename.rb', line 43 def paths parsed.paths.if_present(['.']) end |
#rename_files ⇒ Object
64 65 66 67 68 69 |
# File 'lib/ehbrs/tools/runner/videos/series/rename.rb', line 64 def rename_files return unless .confirm infom 'Renaming files...' files.each(&:rename) end |
#run ⇒ Object
26 27 28 29 30 |
# File 'lib/ehbrs/tools/runner/videos/series/rename.rb', line 26 def run show_results rename_files end |
#series_file_options_uncached ⇒ Object
56 57 58 |
# File 'lib/ehbrs/tools/runner/videos/series/rename.rb', line 56 def ::EhbrsRubyUtils::Videos::Series::Rename::File::Options.new(parsed) end |
#show_results ⇒ Object
60 61 62 |
# File 'lib/ehbrs/tools/runner/videos/series/rename.rb', line 60 def show_results ::EhbrsRubyUtils::Videos::Series::Rename::ResultsBuilder.new(files).show(0) end |
#traverser_check_file(path) ⇒ Object
51 52 53 54 |
# File 'lib/ehbrs/tools/runner/videos/series/rename.rb', line 51 def traverser_check_file(path) @files << ::EhbrsRubyUtils::Videos::Series::Rename::File .new(path, ) end |
#traverser_recursive ⇒ Object
47 48 49 |
# File 'lib/ehbrs/tools/runner/videos/series/rename.rb', line 47 def traverser_recursive parsed.recursive end |