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.

'..'
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.

%r{^/}
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.



19
20
21
# File 'lib/puppet/file_system/path_pattern.rb', line 19

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.



15
16
17
# File 'lib/puppet/file_system/path_pattern.rb', line 15

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.



35
36
37
# File 'lib/puppet/file_system/path_pattern.rb', line 35

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.



30
31
32
33
# File 'lib/puppet/file_system/path_pattern.rb', line 30

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.



39
40
41
# File 'lib/puppet/file_system/path_pattern.rb', line 39

def to_s
  @pathstr
end