Sha256: 7ea06834da96c0aaaf1444976faad3cb5f84b2e7357ec924530f80fdca497ea5

Contents?: true

Size: 1015 Bytes

Versions: 21

Compression:

Stored size: 1015 Bytes

Contents

module VagrantPlugins
  module Invade
    module Validator
      module SyncedFolder

        class NFS

          attr_accessor :env
          attr_accessor :nfs

          DEFAULT = {
            'uid' => nil,
            'gid' => nil,
            'mount_options' => ['nolock']
          }

          def initialize(env, nfs)
            @env = env
            @nfs = SyncedFolder.validate_base(env, nfs)
          end

          def validate
            return nil unless @nfs

            # USER ID
            @nfs['uid'] = Validator.validate_integer(
              @nfs['uid'], 'uid', DEFAULT['uid']
            )

            # GROUP ID
            @nfs['gid'] = Validator.validate_integer(
              @nfs['gid'], 'gid', DEFAULT['gid']
            )

            # NFS OPTIONS
            @nfs['mount_options'] = Validator.validate_array(
              @nfs['mount_options'], 'mount_options', DEFAULT['mount_options']
            )

            @nfs
          end
        end
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
vagrant-invade-0.5.5 lib/vagrant-invade/validator/synced_folder/nfs.rb
vagrant-invade-0.5.4 lib/vagrant-invade/validator/synced_folder/nfs.rb
vagrant-invade-0.5.3 lib/vagrant-invade/validator/synced_folder/nfs.rb
vagrant-invade-0.5.2 lib/vagrant-invade/validator/synced_folder/nfs.rb
vagrant-invade-0.5.1 lib/vagrant-invade/validator/synced_folder/nfs.rb
vagrant-invade-0.5.0 lib/vagrant-invade/validator/synced_folder/nfs.rb
vagrant-invade-0.4.8 lib/vagrant-invade/validator/synced_folder/nfs.rb
vagrant-invade-0.4.7 lib/vagrant-invade/validator/synced_folder/nfs.rb
vagrant-invade-0.4.6 lib/vagrant-invade/validator/synced_folder/nfs.rb
vagrant-invade-0.4.5 lib/vagrant-invade/validator/synced_folder/nfs.rb
vagrant-invade-0.4.4 lib/vagrant-invade/validator/synced_folder/nfs.rb
vagrant-invade-0.4.3 lib/vagrant-invade/validator/synced_folder/nfs.rb
vagrant-invade-0.4.2 lib/vagrant-invade/validator/synced_folder/nfs.rb
vagrant-invade-0.4.1 lib/vagrant-invade/validator/synced_folder/nfs.rb
vagrant-invade-0.4.0 lib/vagrant-invade/validator/synced_folder/nfs.rb
vagrant-invade-0.4.0.pre.alpha lib/vagrant-invade/validator/synced_folder/nfs.rb
vagrant-invade-0.3.4 lib/vagrant-invade/validator/synced_folder/nfs.rb
vagrant-invade-0.3.3 lib/vagrant-invade/validator/synced_folder/nfs.rb
vagrant-invade-0.3.2 lib/vagrant-invade/validator/synced_folder/nfs.rb
vagrant-invade-0.3.0 lib/vagrant-invade/validator/synced_folder/nfs.rb