diff options
Diffstat (limited to 'new/lib/crys/batch_builder.rb')
-rw-r--r-- | new/lib/crys/batch_builder.rb | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/new/lib/crys/batch_builder.rb b/new/lib/crys/batch_builder.rb index 43dbec62..d8f1d7b6 100644 --- a/new/lib/crys/batch_builder.rb +++ b/new/lib/crys/batch_builder.rb @@ -2,30 +2,29 @@ module Crys class BatchBuilder - def initialize(pages_db:, output_dir:, image_dir:, builder_class:) - @pages_db = pages_db + def initialize(pages_db_manager:, output_dir:, image_dir:, builder_class:) + @pages_db_manager = pages_db_manager @output_dir = output_dir @image_dir = image_dir @builder_class = builder_class + end def build - db.pages.each do |page| + pages_db_manager.pages.each do |page| builder_class.new( - file_path: page.file_path, + file_path: page.source, output_dir: output_dir, - image_dir: image_dir + image_dir: image_dir, + pages_db_manager: pages_db_manager ).build - puts "processed: #{page.filename}" + puts "processed: #{page.filename}" end end private - attr_reader :pages_db, :output_dir, :image_dir, :builder_class + attr_reader :pages_db_manager, :output_dir, :image_dir, :builder_class - def db - pages_db.new - end end end |