Class: RegexSpec

Inherits:
Spec show all
Defined in:
lib/puppet/vendor/pathspec/lib/pathspec/regexspec.rb

Direct Known Subclasses

GitIgnoreSpec

Instance Attribute Summary

Attributes inherited from Spec

#regex

Instance Method Summary collapse

Constructor Details

#initialize(regex) ⇒ RegexSpec


4
5
6
7
8
# File 'lib/puppet/vendor/pathspec/lib/pathspec/regexspec.rb', line 4

def initialize(regex)
  @regex = Regexp.compile regex

  super
end

Instance Method Details

#inclusive?Boolean


10
11
12
# File 'lib/puppet/vendor/pathspec/lib/pathspec/regexspec.rb', line 10

def inclusive?
  true
end

#match(path) ⇒ Object


14
15
16
# File 'lib/puppet/vendor/pathspec/lib/pathspec/regexspec.rb', line 14

def match(path)
  @regex.match(path) if @regex
end