class MultimediaParadise::MergeMultimedia

Public Class Methods

new( merge_these_files = nil, run_already = true ) click to toggle source
#

initialize

#
# File lib/multimedia_paradise/multimedia/merge_multimedia.rb, line 30
def initialize(
    merge_these_files = nil,
    run_already       = true
  )
  reset
  set_merge_these_files(
    merge_these_files
  )
  run if run_already
end

Public Instance Methods

check_whether_the_files_exist( these_files = @merge_these_files ) click to toggle source
#

check_whether_the_files_exist

#
# File lib/multimedia_paradise/multimedia/merge_multimedia.rb, line 70
def check_whether_the_files_exist(
    these_files = @merge_these_files
  )
  these_files.each {|entry|
    if File.exist? entry
    else
      ewarn 'The file at `'+sfile(entry)+'` does not exist.'
    end
  }
end
merge( these_files = which_files? ) click to toggle source
#

merge

#
# File lib/multimedia_paradise/multimedia/merge_multimedia.rb, line 105
def merge(
    these_files = which_files?
  )
  if these_files.is_a? Array
    check_whether_the_files_exist
    result = MultimediaParadise.merge_multimedia_file(these_files) # bl conversions.rb
    set_output_file(result)
  end
end
output?()
Alias for: output_file?
output_file?() click to toggle source
#

output_file?

#
# File lib/multimedia_paradise/multimedia/merge_multimedia.rb, line 98
def output_file?
  @output_file
end
Also aliased as: output?
reset() click to toggle source
#

reset (reset tag)

#
Calls superclass method MultimediaParadise::Base#reset
# File lib/multimedia_paradise/multimedia/merge_multimedia.rb, line 44
def reset
  super()
  # ======================================================================= #
  # === @output_file
  # ======================================================================= #
  @output_file = nil
end
run() click to toggle source
#

run (run tag)

#
# File lib/multimedia_paradise/multimedia/merge_multimedia.rb, line 118
def run
  merge
end
set_merge_these_files( i = '' ) click to toggle source
#

set_merge_these_files

#
# File lib/multimedia_paradise/multimedia/merge_multimedia.rb, line 55
def set_merge_these_files(
    i = ''
  )
  i = i.dup if i
  case i
  when '*'
    i = Dir['*'].select {|entry| is_this_a_multimedia_file?(entry) }
  end
  i.compact! if i.is_a? Array
  @merge_these_files = i
end
set_output_file(i) click to toggle source
#

set_output_file

#
# File lib/multimedia_paradise/multimedia/merge_multimedia.rb, line 91
def set_output_file(i)
  @output_file = i
end
which_files?() click to toggle source
#

which_files?

#
# File lib/multimedia_paradise/multimedia/merge_multimedia.rb, line 84
def which_files?
  @merge_these_files
end