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 |
# 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? # 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) if @network = ::CORL::Vagrant::Config.load_network(env[:root_path]) @vm = env[:machine] @node = network.node(:vagrant, @vm.name) if @vm end end end |
Instance Attribute Details
#network ⇒ Object (readonly)
Property accessor / modifiers
32 33 34 |
# File 'lib/core/vagrant/action.rb', line 32 def network @network end |
#node ⇒ Object (readonly)
Property accessor / modifiers
32 33 34 |
# File 'lib/core/vagrant/action.rb', line 32 def node @node end |
#vm ⇒ Object (readonly)
Property accessor / modifiers
32 33 34 |
# File 'lib/core/vagrant/action.rb', line 32 def vm @vm end |
Instance Method Details
#call(env) ⇒ Object
Action execution
37 38 39 |
# File 'lib/core/vagrant/action.rb', line 37 def call(env) yield if block_given? && @corl_config_loaded && @network && @node end |