Class: Ffmprb::Execution

Inherits:
Thor
  • Object
show all
Defined in:
lib/ffmprb/execution.rb

Class Method Summary collapse

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args) ⇒ Object



32
33
34
35
# File 'lib/ffmprb/execution.rb', line 32

def method_missing(method, *args)
  args = [:process, method.to_s] + args
  self.class.start(args)
end

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (Boolean)


7
# File 'lib/ffmprb/execution.rb', line 7

def self.exit_on_failure?; true; end

Instance Method Details

#process(*ios) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/ffmprb/execution.rb', line 16

def process(*ios)
  script = eval("lambda{#{STDIN.read}}")
  Ffmprb.log_level =
    if options[:debug]
      Logger::DEBUG
    elsif options[:verbose]
      Logger::INFO
    elsif options[:quiet]
      Logger::ERROR
    else
      Logger::WARN
    end
  Ffmprb.process *ios, &script
end