Class: PathSpec::RegexSpec
Overview
Simple regex-based spec
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Spec
Instance Method Summary collapse
- #inclusive? ⇒ Boolean
-
#initialize(pattern) ⇒ RegexSpec
constructor
A new instance of RegexSpec.
- #match(path) ⇒ Object
Methods inherited from Spec
Constructor Details
#initialize(pattern) ⇒ RegexSpec
Returns a new instance of RegexSpec.
6 7 8 9 10 11 |
# File 'lib/pathspec/regexspec.rb', line 6 def initialize(pattern) @pattern = pattern.dup @regex = Regexp.compile pattern super end |
Instance Method Details
#inclusive? ⇒ Boolean
13 14 15 |
# File 'lib/pathspec/regexspec.rb', line 13 def inclusive? true end |
#match(path) ⇒ Object
17 18 19 |
# File 'lib/pathspec/regexspec.rb', line 17 def match(path) @regex&.match(path) end |