Class: FLV::Edit::Processor::CommandLine

Inherits:
Base
  • Object
show all
Includes:
Dispatcher
Defined in:
lib/flvedit/processor/command_line.rb

Overview

CommandLine is a Processor (see Base) added automatically as the last level for all command line executions

Constant Summary

Constants included from Dispatcher

Dispatcher::ALL_EVENTS, Dispatcher::EVENT_TRIGGER, Dispatcher::EVENT_TRIGGER_LIST, Dispatcher::MAIN_EVENTS

Instance Attribute Summary

Attributes inherited from Base

#options

Instance Method Summary collapse

Methods included from Dispatcher

#absorb, #dispatch_instead, #each, included, #initialize, #stop

Methods inherited from Base

#clone, #each, #initialize, #process_all

Instance Method Details

#each_sourceObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/flvedit/processor/command_line.rb', line 13

def each_source
  return to_enum(:each_source) unless block_given?
  ok, errors = [], []
  super do
    begin
      each{}
      ok << @last
    rescue Exception => e
      errors << [@last, e]
    end
  end
  puts (["Processed successfully:"] + ok).join("\n") unless ok.empty?
  puts "**** Processed with errors: ****" unless errors.empty?
  errors.map do |path, err|
    puts "#{path}: #{err}\n"+err.backtrace.join("\n")
  end
end

#on_header(h) ⇒ Object



9
10
11
# File 'lib/flvedit/processor/command_line.rb', line 9

def on_header(h)
  @last = h.path
end