Class: ShopifyThemeBuilder::Builder
- Inherits:
-
Object
- Object
- ShopifyThemeBuilder::Builder
- Defined in:
- lib/shopify_theme_builder/builder.rb
Overview
Builder is responsible for building Shopify theme files by delegating processing to appropriate classes based on file types.
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(files_to_process:) ⇒ Builder
constructor
A new instance of Builder.
Constructor Details
#initialize(files_to_process:) ⇒ Builder
Returns a new instance of Builder.
7 8 9 10 |
# File 'lib/shopify_theme_builder/builder.rb', line 7 def initialize(files_to_process:) @files_to_process = files_to_process @processed_files = [] end |
Instance Method Details
#build ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/shopify_theme_builder/builder.rb', line 12 def build puts "Processing #{@files_to_process.count} files..." @files_to_process.each do |file, event| @processed_files << ShopifyThemeBuilder::LiquidProcessor.new(file:, event:).process end puts "Built #{@processed_files.count} files." if @processed_files.any? end |