Sha256: 27a75d865fa02292ff07826590097d935f92edaa395e0914bc7040eed68e7bba

Contents?: true

Size: 1.29 KB

Versions: 7

Compression:

Stored size: 1.29 KB

Contents

module VagrantPlugins
  module Invade
    module InvadeModule
      module Plugin

        class WinNFSd < InvadeModule

          attr_reader :result
          attr_accessor :machine_name, :ui, :winnfsd_data

          def initialize(machine_name, ui, winnfsd_data, result: nil)
            @machine_name = machine_name
            @ui = ui
            @winnfsd_data = winnfsd_data
            @result = result
          end

          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
        end

      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
vagrant-invade-0.8.0 lib/vagrant-invade/module/plugin/winnfsd/winnfsd.rb
vagrant-invade-0.7.0 lib/vagrant-invade/module/plugin/winnfsd/winnfsd.rb
vagrant-invade-0.6.4 lib/vagrant-invade/module/plugin/winnfsd/winnfsd.rb
vagrant-invade-0.6.3 lib/vagrant-invade/module/plugin/winnfsd/winnfsd.rb
vagrant-invade-0.6.2 lib/vagrant-invade/module/plugin/winnfsd/winnfsd.rb
vagrant-invade-0.6.1 lib/vagrant-invade/module/plugin/winnfsd/winnfsd.rb
vagrant-invade-0.6.0 lib/vagrant-invade/module/plugin/winnfsd/winnfsd.rb