class Puppet::FileSystem::PathPattern

Constants

ABSOLUTE_UNIX
ABSOLUTE_WINDOWS
CURRENT_DRIVE_RELATIVE_WINDOWS

ABSOLUT_VODKA notappearinginthisclass

TRAVERSAL

Attributes

pathname[R]

Public Instance Methods

glob() click to toggle source
# File lib/puppet/file_system/path_pattern.rb, line 33
def glob
  Dir.glob(pathname.to_s)
end
prefix_with(prefix) click to toggle source

@param prefix [AbsolutePathPattern] An absolute path pattern instance @return [AbsolutePathPattern] A new AbsolutePathPattern prepended with

the passed prefix's pattern.
# 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_s() click to toggle source
# File lib/puppet/file_system/path_pattern.rb, line 37
def to_s
  pathname.to_s
end

Public Class Methods

absolute(pattern) click to toggle source
# File lib/puppet/file_system/path_pattern.rb, line 17
def self.absolute(pattern)
  AbsolutePathPattern.new(pattern)
end
new(pattern) click to toggle source
# File lib/puppet/file_system/path_pattern.rb, line 59
def initialize(pattern)
  begin
    @pathname = Pathname.new(pattern.strip)
  rescue ArgumentError => error
    raise InvalidPattern.new("PathPatterns cannot be created with a zero byte.", error)
  end
  validate
end
relative(pattern) click to toggle source
# File lib/puppet/file_system/path_pattern.rb, line 13
def self.relative(pattern)
  RelativePathPattern.new(pattern)
end