Class: VagrantPlugins::Invade::InvadeModule::Plugin::Hostmanager
- Inherits:
-
InvadeModule
- Object
- InvadeModule
- VagrantPlugins::Invade::InvadeModule::Plugin::Hostmanager
- Defined in:
- lib/vagrant-invade/module/plugin/hostmanager/hostmanager.rb
Instance Attribute Summary collapse
-
#hostmanager_data ⇒ Object
Returns the value of attribute hostmanager_data.
-
#machine_name ⇒ Object
Returns the value of attribute machine_name.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
-
#ui ⇒ Object
Returns the value of attribute ui.
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(machine_name, hostmanager_data, result: nil) ⇒ Hostmanager
constructor
A new instance of Hostmanager.
Methods inherited from InvadeModule
Constructor Details
#initialize(machine_name, hostmanager_data, result: nil) ⇒ Hostmanager
Returns a new instance of Hostmanager.
13 14 15 16 17 |
# File 'lib/vagrant-invade/module/plugin/hostmanager/hostmanager.rb', line 13 def initialize(machine_name, hostmanager_data, result: nil) @machine_name = machine_name @hostmanager_data = hostmanager_data @result = result end |
Instance Attribute Details
#hostmanager_data ⇒ Object
Returns the value of attribute hostmanager_data.
11 12 13 |
# File 'lib/vagrant-invade/module/plugin/hostmanager/hostmanager.rb', line 11 def hostmanager_data @hostmanager_data end |
#machine_name ⇒ Object
Returns the value of attribute machine_name.
11 12 13 |
# File 'lib/vagrant-invade/module/plugin/hostmanager/hostmanager.rb', line 11 def machine_name @machine_name end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
10 11 12 |
# File 'lib/vagrant-invade/module/plugin/hostmanager/hostmanager.rb', line 10 def result @result end |
#ui ⇒ Object
Returns the value of attribute ui.
11 12 13 |
# File 'lib/vagrant-invade/module/plugin/hostmanager/hostmanager.rb', line 11 def ui @ui end |
Instance Method Details
#build ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/vagrant-invade/module/plugin/hostmanager/hostmanager.rb', line 19 def build b = binding begin # Get machine name machine_name = @machine_name # Values for hostmanager section enabled = @hostmanager_data['enabled'] aliases = @hostmanager_data['aliases'] eruby = Erubis::Eruby.new(File.read(self.get_template_path(__FILE__))) @result = eruby.result b rescue TypeError, SyntaxError, SystemCallError => e raise(e) end end |