diff options
author | mms <git@sapka.me> | 2025-01-08 22:20:17 +0100 |
---|---|---|
committer | mms <git@sapka.me> | 2025-01-08 22:20:17 +0100 |
commit | 3d13bedaaffdae466621788d808a6b71b9ed9f59 (patch) | |
tree | 5e941bb44ad7cd37252459bfe48d57778b76342a /new/bin/builder.rb | |
parent | 4004a55b0e324c35cbc7d58b831e49efd484ab93 (diff) |
feat: batch-first
Diffstat (limited to 'new/bin/builder.rb')
-rw-r--r-- | new/bin/builder.rb | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/new/bin/builder.rb b/new/bin/builder.rb index 7172cf85..b5f5270b 100644 --- a/new/bin/builder.rb +++ b/new/bin/builder.rb @@ -22,27 +22,23 @@ end.parse! module Crys class BuilderRunner - def initialize(file_path:, image_dir:, output_dir:, builder_class:, batch_builder_class:, theme_dir:, pages_db:) - @file_path = file_path - @output_dir = output_dir - @builder_class = builder_class - @batch_builder_class = batch_builder_class - @image_dir = image_dir - @theme_dir = theme_dir - @pages_db = pages_db + def initialize(batch_builder:, builder:, batch:) + @builder = builder + @batch_builder = batch_builder + @batch = batch end def run - if file_path == :all - batch_builder_class.new(pages_db: pages_db, output_dir: output_dir, image_dir: image_dir, - builder_class: builder_class).build + p batch + if batch + batch_builder.build else - builder_class.new(file_path: file_path, output_dir: output_dir, image_dir: image_dir).build + builder.build end end private - attr_reader :builder_class, :file_path, :output_dir, :image_dir, :batch_builder_class, :theme_dir, :pages_db + attr_reader :builder, :batch_builder, :batch end end |