Class: FLV::Edit::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/flvedit/runner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*arg) ⇒ Runner

Returns a new instance of Runner.



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

def initialize(*arg)
  @commands, @options = (arg.length == 1 ? Options.new(arg.first).to_a : arg)
end

Instance Attribute Details

#commandsObject (readonly)

Returns the value of attribute commands.



7
8
9
# File 'lib/flvedit/runner.rb', line 7

def commands
  @commands
end

#optionsObject (readonly)

Returns the value of attribute options.



7
8
9
# File 'lib/flvedit/runner.rb', line 7

def options
  @options
end

Instance Method Details

#runObject Also known as: run!



13
14
15
16
17
18
# File 'lib/flvedit/runner.rb', line 13

def run
  commands = [*@commands].map{|c| c.is_a?(Class) ? c : Processor.const_get(c.to_s.camelize)}
  commands.unshift Processor::Reader
  commands << Processor::CommandLine unless options[:trace]
  Processor.chain(commands, @options).process_all
end