Class: Templatecop::PathFinder
- Inherits:
-
Object
- Object
- Templatecop::PathFinder
- Defined in:
- lib/templatecop/path_finder.rb
Overview
Collect file paths from given path patterns.
Instance Method Summary collapse
- #call ⇒ Array<String>
-
#initialize(default_patterns:, exclude_patterns:, patterns:) ⇒ PathFinder
constructor
A new instance of PathFinder.
Constructor Details
#initialize(default_patterns:, exclude_patterns:, patterns:) ⇒ PathFinder
Returns a new instance of PathFinder.
11 12 13 14 15 16 17 18 19 |
# File 'lib/templatecop/path_finder.rb', line 11 def initialize( default_patterns:, exclude_patterns:, patterns: ) @default_patterns = default_patterns @exclude_patterns = exclude_patterns || [] @patterns = patterns end |
Instance Method Details
#call ⇒ Array<String>
22 23 24 25 26 |
# File 'lib/templatecop/path_finder.rb', line 22 def call matching_paths(patterns) do |path| !excluded?(path) end.sort end |