Class: DevSuite::Utils::PathMatcher::Matcher
- Inherits:
-
Object
- Object
- DevSuite::Utils::PathMatcher::Matcher
- Defined in:
- lib/dev_suite/utils/path_matcher/matcher.rb
Instance Method Summary collapse
-
#initialize(includes: [], excludes: []) ⇒ Matcher
constructor
A new instance of Matcher.
- #match?(path) ⇒ Boolean
Constructor Details
#initialize(includes: [], excludes: []) ⇒ Matcher
Returns a new instance of Matcher.
7 8 9 10 |
# File 'lib/dev_suite/utils/path_matcher/matcher.rb', line 7 def initialize(includes: [], excludes: []) @include_patterns = includes.map { |pattern| Pattern.new(pattern) } @exclude_patterns = excludes.map { |pattern| Pattern.new(pattern) } end |
Instance Method Details
#match?(path) ⇒ Boolean
12 13 14 15 16 17 |
# File 'lib/dev_suite/utils/path_matcher/matcher.rb', line 12 def match?(path) return false if excluded?(path) return true if included?(path) false end |