Class: AssetFinder::Stylesheet::PathCollector
- Inherits:
-
Object
- Object
- AssetFinder::Stylesheet::PathCollector
- Defined in:
- lib/asset_finder/stylesheet/path_collector.rb
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(root_dir:, path_pattern_collection:) ⇒ PathCollector
constructor
A new instance of PathCollector.
Constructor Details
#initialize(root_dir:, path_pattern_collection:) ⇒ PathCollector
Returns a new instance of PathCollector.
6 7 8 9 10 11 |
# File 'lib/asset_finder/stylesheet/path_collector.rb', line 6 def initialize(root_dir:, path_pattern_collection:) @root_dir = root_dir @path_pattern_collection = path_pattern_collection freeze end |
Instance Method Details
#execute ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/asset_finder/stylesheet/path_collector.rb', line 13 def execute [].tap do |paths| Find.find(root_dir).each do |path| next unless path_pattern_collection.match?(path: path) paths << path end end end |