class Simp::Media::Type::Base

Attributes

engine[RW]
options[RW]

Public Class Methods

new(options, engine) click to toggle source
# File lib/simp/media/type/base.rb, line 9
def initialize(options, engine)
  @options = options
  @engine = engine
end

Public Instance Methods

add_component(_component, _options) click to toggle source
# File lib/simp/media/type/base.rb, line 61
def add_component(_component, _options)
  raise '`add_component` not implemented'
end
cleanup() click to toggle source
# File lib/simp/media/type/base.rb, line 53
def cleanup
  true
end
critical(output) click to toggle source
# File lib/simp/media/type/base.rb, line 34
def critical(output)
  engine.critical(output)
end
debug1(output) click to toggle source
# File lib/simp/media/type/base.rb, line 18
def debug1(output)
  engine.debug1(output)
end
debug2(output) click to toggle source
# File lib/simp/media/type/base.rb, line 14
def debug2(output)
  engine.debug2(output)
end
error(output) click to toggle source
# File lib/simp/media/type/base.rb, line 30
def error(output)
  engine.error(output)
end
fetch_component(_component, _options) click to toggle source
# File lib/simp/media/type/base.rb, line 57
def fetch_component(_component, _options)
  raise '`fetch_component` not implemented'
end
finalize() click to toggle source
# File lib/simp/media/type/base.rb, line 65
def finalize
  raise '`finalize` not implemented'
end
info(output) click to toggle source
# File lib/simp/media/type/base.rb, line 22
def info(output)
  engine.info(output)
end
run(command) click to toggle source
# File lib/simp/media/type/base.rb, line 38
def run(command)
  exitcode = nil
  Open3.popen3(command) do |_stdin, stdout, stderr, thread|
    pid = thread.pid
    debug1(stdout.read.chomp)
    debug1(stderr.read.chomp)
    exitcode = thread.value
  end
  exitcode
end
target_directory() click to toggle source
# File lib/simp/media/type/base.rb, line 49
def target_directory
  nil
end
warning(output) click to toggle source
# File lib/simp/media/type/base.rb, line 26
def warning(output)
  engine.warning(output)
end