class VagrantPlugins::CORL::BaseAction

Attributes

network[R]
node[R]
vm[R]

Public Class Methods

new(app, env) click to toggle source
   # File lib/core/vagrant/action.rb
 9 def initialize(app, env)
10   @app     = app
11   @env     = env[:machine].env
12 
13   @network = nil
14   @node    = nil
15   @vm      = nil
16 
17   if @corl_config_loaded = ::CORL.vagrant_config_loaded?
18     if @network = ::CORL::Vagrant::Config.load_network(env[:root_path])
19       @vm   = env[:machine]
20       @node = network.node(:vagrant, @vm.name) if @vm
21     end
22   end
23 
24   unless ::CORL::Vagrant.command
25     # Hackish solution to ensure our code has access to Vagrant machines.
26     # This serves as a Vagrant VM manager.
27     ::CORL::Vagrant.command = Command::Launcher.new([], @env)
28   end
29 end

Public Instance Methods

call(env) { || ... } click to toggle source
   # File lib/core/vagrant/action.rb
39 def call(env)
40   yield if block_given? && @corl_config_loaded && @network && @node
41 end