Class: RVideo::Tools::AbstractTool

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

Overview

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

Defined Under Namespace

Modules: InstanceMethods

Class Method Summary collapse

Class Method Details

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



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

def self.assign(cmd, options = {})
  tool_name = cmd.split(" ").first
  begin
    tool = "RVideo::Tools::#{tool_name.underscore.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
    RVideo.logger.info e.message
    RVideo.logger.info e.backtrace.join("\n")
    raise e
  end
end