module Crys class BatchBuilder def db_path output_dir = "#{File.dirname(File.dirname(File.dirname(__FILE__)))}/db/pages.yaml" end def output_dir "#{File.dirname(File.dirname(__FILE__))}/output" end def image_dir "#{File.dirname(File.dirname(File.expand_path(__FILE__)))}/assets/images" end def builder_class Crys::Builder end def db Crys::PagesDbManager.new end def build db.pages.each do |page| builder_class.new( file_path: page.file_path, output_dir: output_dir, image_dir: image_dir, ).build puts "processed: " + page.filename end end end end