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