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
20
21
# File 'lib/rvideo/tools/abstract_tool.rb', line 8

def self.assign(cmd, options = {})
  tool_name = cmd.split(" ").first
  begin
    tool_class_name = tool_name.underscore.classify
    tool = RVideo::Tools.const_get(tool_class_name).new(cmd, options)
  rescue NameError => e
    raise TranscoderError::UnknownTool,
      "The recipe tried to use #{tool_name.inspect}, " +
      "which expands to #{tool_class_name.inspect}, which does not exist. \n#{e.message}"
  rescue Object => e
    RVideo.logger.info e.message
    raise e
  end
end