Class: Blender::Driver::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/blender/drivers/base.rb

Direct Known Subclasses

Ruby, Scp, ShellOut, Ssh

Defined Under Namespace

Classes: ExecOutput

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config = {}) ⇒ Base

Returns a new instance of Base.



27
28
29
30
31
32
33
# File 'lib/blender/drivers/base.rb', line 27

def initialize(config = {})
  cfg = config.dup
  @stdout = cfg.delete(:stdout) || File.open(File::NULL, 'w')
  @stderr = cfg.delete(:stderr) || File.open(File::NULL, 'w')
  @events = cfg.delete(:events) or fail 'Events needed'
  @config = cfg
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



23
24
25
# File 'lib/blender/drivers/base.rb', line 23

def config
  @config
end

#eventsObject (readonly)

Returns the value of attribute events.



23
24
25
# File 'lib/blender/drivers/base.rb', line 23

def events
  @events
end

#stderrObject (readonly)

Returns the value of attribute stderr.



23
24
25
# File 'lib/blender/drivers/base.rb', line 23

def stderr
  @stderr
end

#stdoutObject (readonly)

Returns the value of attribute stdout.



23
24
25
# File 'lib/blender/drivers/base.rb', line 23

def stdout
  @stdout
end

Instance Method Details

#execute(tasks, hosts) ⇒ Object

Raises:

  • (RuntimeError)


35
36
37
# File 'lib/blender/drivers/base.rb', line 35

def execute(tasks, hosts)
  raise RuntimeError, 'this method must be overridden'
end