Class: Vx::ContainerConnector::Local
- Inherits:
-
Object
- Object
- Vx::ContainerConnector::Local
- Includes:
- Instrument
- Defined in:
- lib/vx/container_connector/local.rb,
lib/vx/container_connector/local/spawner.rb
Defined Under Namespace
Classes: Spawner
Instance Attribute Summary collapse
-
#work_dir ⇒ Object
readonly
Returns the value of attribute work_dir.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Local
constructor
A new instance of Local.
- #start {|spawner| ... } ⇒ Object
Methods included from Instrument
Constructor Details
#initialize(options = {}) ⇒ Local
Returns a new instance of Local.
16 17 18 19 |
# File 'lib/vx/container_connector/local.rb', line 16 def initialize( = {}) @work_dir = [:work_dir] || default_work_dir @work_dir = File.(@work_dir) end |
Instance Attribute Details
#work_dir ⇒ Object (readonly)
Returns the value of attribute work_dir.
14 15 16 |
# File 'lib/vx/container_connector/local.rb', line 14 def work_dir @work_dir end |
Instance Method Details
#start {|spawner| ... } ⇒ Object
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/vx/container_connector/local.rb', line 21 def start(&block) instrument( "start_container", container_type: 'local', container: { work_dir: work_dir }) do FileUtils.rm_rf(work_dir) FileUtils.mkdir_p(work_dir) end spawner = Spawner.new(work_dir) yield spawner end |