Class: VagrantPlugins::Invade::InvadeModule::Plugin::WinNFSd
- Inherits:
-
InvadeModule
- Object
- InvadeModule
- VagrantPlugins::Invade::InvadeModule::Plugin::WinNFSd
- Defined in:
- lib/vagrant-invade/module/plugin/winnfsd/winnfsd.rb
Instance Attribute Summary collapse
-
#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.
-
#winnfsd_data ⇒ Object
Returns the value of attribute winnfsd_data.
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(machine_name, ui, winnfsd_data, result: nil) ⇒ WinNFSd
constructor
A new instance of WinNFSd.
Methods inherited from InvadeModule
Constructor Details
#initialize(machine_name, ui, winnfsd_data, result: nil) ⇒ WinNFSd
Returns a new instance of WinNFSd.
11 12 13 14 15 16 |
# File 'lib/vagrant-invade/module/plugin/winnfsd/winnfsd.rb', line 11 def initialize(machine_name, ui, winnfsd_data, result: nil) @machine_name = machine_name @ui = ui @winnfsd_data = winnfsd_data @result = result end |
Instance Attribute Details
#machine_name ⇒ Object
Returns the value of attribute machine_name.
9 10 11 |
# File 'lib/vagrant-invade/module/plugin/winnfsd/winnfsd.rb', line 9 def machine_name @machine_name end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
8 9 10 |
# File 'lib/vagrant-invade/module/plugin/winnfsd/winnfsd.rb', line 8 def result @result end |
#ui ⇒ Object
Returns the value of attribute ui.
9 10 11 |
# File 'lib/vagrant-invade/module/plugin/winnfsd/winnfsd.rb', line 9 def ui @ui end |
#winnfsd_data ⇒ Object
Returns the value of attribute winnfsd_data.
9 10 11 |
# File 'lib/vagrant-invade/module/plugin/winnfsd/winnfsd.rb', line 9 def winnfsd_data @winnfsd_data end |
Instance Method Details
#build ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/vagrant-invade/module/plugin/winnfsd/winnfsd.rb', line 18 def build if !Vagrant.has_plugin?('vagrant-winnfsd') @ui.error("[Invade] Plugin 'vagrant-winnfsd' not installed but defined. Use 'vagrant plugin install vagrant-winnfsd' to install it.") @result = '' else b = binding begin # Get machine name machine_name = @machine_name # Values for winnfsd section logging = @winnfsd_data['logging'] uid = @winnfsd_data['uid'] gid = @winnfsd_data['gid'] eruby = Erubis::Eruby.new(File.read(self.get_template_path(__FILE__))) @result = eruby.result b rescue TypeError, SyntaxError, SystemCallError => e raise(e) end end end |