Sha256: 9aeedf922329069c6a5b0e25b9d2cb765f1c631a51488262fd33ece7f2fa301a

Contents?: true

Size: 628 Bytes

Versions: 4

Compression:

Stored size: 628 Bytes

Contents

require_relative 'options'
require_relative 'processor'

module FLV
  module Edit
    class Runner
      attr_reader :options, :commands
      
      def initialize(*arg)
        @commands, @options = (arg.length == 1 ? Options.new(arg.first).to_a : arg)
      end
      
      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[:dont_catch_errors]
        Processor.chain(commands, @options).process_all
      end
      
      alias_method :run!,  :run
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
marcandre-flvedit-0.6.1 lib/flv/edit/runner.rb
marcandre-flvedit-0.6.2 lib/flv/edit/runner.rb
flvedit-0.6.1 lib/flv/edit/runner.rb
flvedit-0.6.2 lib/flv/edit/runner.rb