Class: Vx::ContainerConnector::Local::Spawner

Inherits:
Object
  • Object
show all
Includes:
Vx::Common::Spawn
Defined in:
lib/vx/container_connector/local/spawner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(work_dir) ⇒ Spawner

Returns a new instance of Spawner.



12
13
14
# File 'lib/vx/container_connector/local/spawner.rb', line 12

def initialize(work_dir)
  @work_dir = work_dir
end

Instance Attribute Details

#work_dirObject (readonly)

Returns the value of attribute work_dir.



10
11
12
# File 'lib/vx/container_connector/local/spawner.rb', line 10

def work_dir
  @work_dir
end

Instance Method Details

#idObject



26
27
28
# File 'lib/vx/container_connector/local/spawner.rb', line 26

def id
  'local'
end

#spawn(*args, &logger) ⇒ Object



16
17
18
19
20
21
22
23
24
# File 'lib/vx/container_connector/local/spawner.rb', line 16

def spawn(*args, &logger)
  env     = args.first.is_a?(Hash) ? args.shift : {}
  options = args.last.is_a?(Hash)  ? args.pop   : {}
  cmd     = args

  options.merge!(chdir: work_dir)

  super(env, cmd, options, &logger)
end