Class: VagrantPlugins::CORL::BaseAction
- Inherits:
-
Object
- Object
- VagrantPlugins::CORL::BaseAction
- Defined in:
- lib/core/vagrant/action.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#network ⇒ Object
readonly
—————————————————————————– Property accessor / modifiers.
-
#node ⇒ Object
readonly
—————————————————————————– Property accessor / modifiers.
-
#vm ⇒ Object
readonly
—————————————————————————– Property accessor / modifiers.
Instance Method Summary collapse
-
#call(env) ⇒ Object
—————————————————————————– Action execution.
-
#initialize(app, env) ⇒ BaseAction
constructor
—————————————————————————– Constructor / Destructor.
Constructor Details
#initialize(app, env) ⇒ BaseAction
Constructor / Destructor
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/core/vagrant/action.rb', line 9 def initialize(app, env) @app = app @env = env[:machine].env @network = nil @node = nil @vm = nil if @corl_config_loaded = ::CORL.vagrant_config_loaded? if @network = ::CORL::Vagrant::Config.load_network(env[:root_path]) @vm = env[:machine] @node = network.node(:vagrant, @vm.name) if @vm end end unless ::CORL::Vagrant.command # Hackish solution to ensure our code has access to Vagrant machines. # This serves as a Vagrant VM manager. ::CORL::Vagrant.command = Command::Launcher.new([], @env) end end |
Instance Attribute Details
#network ⇒ Object (readonly)
Property accessor / modifiers
34 35 36 |
# File 'lib/core/vagrant/action.rb', line 34 def network @network end |
#node ⇒ Object (readonly)
Property accessor / modifiers
34 35 36 |
# File 'lib/core/vagrant/action.rb', line 34 def node @node end |
#vm ⇒ Object (readonly)
Property accessor / modifiers
34 35 36 |
# File 'lib/core/vagrant/action.rb', line 34 def vm @vm end |
Instance Method Details
#call(env) ⇒ Object
Action execution
39 40 41 |
# File 'lib/core/vagrant/action.rb', line 39 def call(env) yield if block_given? && @corl_config_loaded && @network && @node end |