Class: VagrantPlugins::Skytap::Action::IsParallelized

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-skytap/action/is_parallelized.rb

Overview

This can be used with “Call” built-in to check if the action is being performed as part of a parallel operation.

Instance Method Summary collapse

Constructor Details

#initialize(app, env) ⇒ IsParallelized

Returns a new instance of IsParallelized.



7
8
9
10
# File 'lib/vagrant-skytap/action/is_parallelized.rb', line 7

def initialize(app, env)
  @app = app
  @logger = Log4r::Logger.new("vagrant_skytap::action::is_parallelized")
end

Instance Method Details

#call(env) ⇒ Object



12
13
14
15
16
17
# File 'lib/vagrant-skytap/action/is_parallelized.rb', line 12

def call(env)
  env[:result] = env[:parallel]
  @logger.info("Parallelization is #{env[:result] ? 'on' : 'off'}")

  @app.call(env)
end