Class: Puppet::FileSystem::PathPattern Private

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

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Direct Known Subclasses

AbsolutePathPattern, RelativePathPattern

Defined Under Namespace

Classes: InvalidPattern

Constant Summary collapse

DOTDOT =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

'..'.freeze
ABSOLUTE_UNIX =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

/^\//
ABSOLUTE_WINDOWS =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

/^[a-z]:/i
CURRENT_DRIVE_RELATIVE_WINDOWS =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

/^\\/

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.absolute(pattern) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


17
18
19
# File 'lib/puppet/file_system/path_pattern.rb', line 17

def self.absolute(pattern)
  AbsolutePathPattern.new(pattern)
end

.relative(pattern) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


13
14
15
# File 'lib/puppet/file_system/path_pattern.rb', line 13

def self.relative(pattern)
  RelativePathPattern.new(pattern)
end

Instance Method Details

#globObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


33
34
35
# File 'lib/puppet/file_system/path_pattern.rb', line 33

def glob
  Dir.glob(@pathstr)
end

#prefix_with(prefix) ⇒ AbsolutePathPattern

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns A new AbsolutePathPattern prepended with the passed prefix's pattern.

Parameters:

Returns:

  • (AbsolutePathPattern)

    A new AbsolutePathPattern prepended with the passed prefix's pattern.


28
29
30
31
# File 'lib/puppet/file_system/path_pattern.rb', line 28

def prefix_with(prefix)
  new_pathname = prefix.pathname + pathname
  self.class.absolute(new_pathname.to_s)
end

#to_sObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


37
38
39
# File 'lib/puppet/file_system/path_pattern.rb', line 37

def to_s
  @pathstr
end