Class: EhbrsRubyUtils::Videos::Series::Rename::File::Renamer

Inherits:
Object
  • Object
show all
Defined in:
lib/ehbrs_ruby_utils/videos/series/rename/file/renamer.rb

Instance Method Summary collapse

Instance Method Details

#performObject



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/ehbrs_ruby_utils/videos/series/rename/file/renamer.rb', line 15

def perform
  return unless rename?

  version_number = 0
  loop do
    target_path = dirname.join(build_target_name(version_number))
    break perform_rename(target_path) unless target_path.exist?

    version_number += 1
  end
end