Class: RVideo::Tools::AbstractTool

Inherits:
Object
  • Object
show all
Defined in:
lib/rvideo/tools/abstract_tool.rb

Defined Under Namespace

Modules: InstanceMethods

Class Method Summary collapse

Class Method Details

.assign(cmd, options = {}) ⇒ Object

AbstractTool is an interface to every transcoder tool class (e.g. ffmpeg, flvtool2). Called by the Transcoder class.



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/rvideo/tools/abstract_tool.rb', line 10

def self.assign(cmd, options = {})
  tool_name = File.split(cmd.split(" ").first).last
  begin
    tool = "RVideo::Tools::#{tool_name.classify}".constantize.send(:new, cmd, options)
  # rescue NameError, /uninitialized constant/
    # raise TranscoderError::UnknownTool, "The recipe tried to use the '#{tool_name}' tool, which does not exist."
  rescue => e
    LOGGER.info $!
    LOGGER.info e.backtrace.join("\n")
  end
end