diff options
Diffstat (limited to 'new/userfriendly/bin/build.rb')
-rwxr-xr-x | new/userfriendly/bin/build.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/new/userfriendly/bin/build.rb b/new/userfriendly/bin/build.rb new file mode 100755 index 00000000..a72a5294 --- /dev/null +++ b/new/userfriendly/bin/build.rb @@ -0,0 +1,22 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +require_relative '../lib/userfriendly' +require_relative '../../bin/builder' + +output_dir = "#{File.dirname(File.dirname(__FILE__))}/output" +image_dir = "#{File.dirname(File.dirname(File.expand_path(__FILE__)))}/assets/images" +pages_db_path = "#{File.dirname(File.dirname(__FILE__))}/db/pages.yaml" +pages_db_manager = Crys::PagesDbManager.new(db_path: pages_db_path) + +file_path = @options[:filepath] +batch = file_path == :all + +builder = Crys::Builder.new(file_path: file_path, output_dir: output_dir, image_dir: image_dir, pages_db_manager: pages_db_manager) +batch_builder = Crys::BatchBuilder.new(pages_db_manager: pages_db_manager, output_dir: output_dir, image_dir: image_dir, builder_class: Crys::Builder) + +Crys::BuilderRunner.new( + builder: builder, + batch_builder: batch_builder, + batch: batch +).run |