Class: Puppet::FileSystem::RelativePathPattern

Inherits:
PathPattern show all
Defined in:
lib/puppet/file_system/path_pattern.rb

Constant Summary

Constants inherited from PathPattern

PathPattern::ABSOLUTE_UNIX, PathPattern::ABSOLUTE_WINDOWS, PathPattern::CURRENT_DRIVE_RELATIVE_WINDOWS, PathPattern::TRAVERSAL

Instance Method Summary collapse

Methods inherited from PathPattern

absolute, #glob, #prefix_with, relative, #to_s

Instance Method Details

#absolute?Boolean

Returns:

  • (Boolean)


70
71
72
# File 'lib/puppet/file_system/path_pattern.rb', line 70

def absolute?
  false
end

#validateObject



74
75
76
77
78
79
80
81
82
# File 'lib/puppet/file_system/path_pattern.rb', line 74

def validate
  super
  case @pathname.to_s
  when ABSOLUTE_WINDOWS
    raise(InvalidPattern, "A relative PathPattern cannot be prefixed with a drive.")
  when ABSOLUTE_UNIX
    raise(InvalidPattern, "A relative PathPattern cannot be an absolute path.")
  end
end