Class: Slimcop::PathFinder
- Inherits:
-
Object
- Object
- Slimcop::PathFinder
- Defined in:
- lib/slimcop/path_finder.rb
Overview
Collect file paths from given path patterns.
Instance Method Summary collapse
- #call ⇒ Array<String>
-
#initialize(patterns:) ⇒ PathFinder
constructor
A new instance of PathFinder.
Constructor Details
#initialize(patterns:) ⇒ PathFinder
9 10 11 |
# File 'lib/slimcop/path_finder.rb', line 9 def initialize(patterns:) @patterns = patterns end |
Instance Method Details
#call ⇒ Array<String>
14 15 16 17 18 |
# File 'lib/slimcop/path_finder.rb', line 14 def call @patterns.flat_map do |pattern| ::Pathname.glob(pattern).select(&:file?).map(&:to_s) end end |