Class: EhbrsRubyUtils::Videos2::Extract::PackageFile

Inherits:
Object
  • Object
show all
Defined in:
lib/ehbrs_ruby_utils/videos2/extract/package_file.rb

Constant Summary collapse

DEFAULT_QUALITY =
'__default__'

Instance Method Summary collapse

Instance Method Details

#copy_to_selected_dirObject



16
17
18
# File 'lib/ehbrs_ruby_utils/videos2/extract/package_file.rb', line 16

def copy_to_selected_dir
  ::FileUtils.cp(path.to_path, selected_dir.to_path)
end

#match_quality?(quality) ⇒ Boolean

Returns:

  • (Boolean)


20
21
22
23
# File 'lib/ehbrs_ruby_utils/videos2/extract/package_file.rb', line 20

def match_quality?(quality)
  path.basename_sub { |b| b.to_s.downcase }.basename
    .fnmatch?("*#{quality.downcase}*".gsub(/\A\*+/, '*').gsub(/\*+\z/, '*'))
end

#move_to_quality_dirObject



25
26
27
# File 'lib/ehbrs_ruby_utils/videos2/extract/package_file.rb', line 25

def move_to_quality_dir
  ::FileUtils.mv(path.to_path, quality_dir.to_path)
end