Class: AssetFinder::Stylesheet::SprocketsConfigGenerator
- Inherits:
-
Object
- Object
- AssetFinder::Stylesheet::SprocketsConfigGenerator
- Defined in:
- lib/asset_finder/stylesheet/sprockets_config_generator.rb
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(root_dir: nil) ⇒ SprocketsConfigGenerator
constructor
A new instance of SprocketsConfigGenerator.
Constructor Details
#initialize(root_dir: nil) ⇒ SprocketsConfigGenerator
Returns a new instance of SprocketsConfigGenerator.
6 7 8 9 10 11 12 13 |
# File 'lib/asset_finder/stylesheet/sprockets_config_generator.rb', line 6 def initialize(root_dir: nil) @root_dir = root_dir || File.join(Rails.root, 'app/assets/stylesheets/') @path_pattern_collection = PathPatternCollection.build @path_collector = PathCollector.new(root_dir: @root_dir, path_pattern_collection: @path_pattern_collection) @normalizer = Normalizer.new(root_dir: @root_dir, path_pattern_collection: @path_pattern_collection) freeze end |
Instance Method Details
#execute ⇒ Object
15 16 17 |
# File 'lib/asset_finder/stylesheet/sprockets_config_generator.rb', line 15 def execute path_collector.execute.map { |path| normalizer.normalize(path) }.compact end |