diff options
author | mms <git@sapka.me> | 2025-01-09 22:53:46 +0100 |
---|---|---|
committer | mms <git@sapka.me> | 2025-01-09 22:53:46 +0100 |
commit | 27a14097e6705f6665e8fe5a7a4ca078799f3647 (patch) | |
tree | e6e7063071d8b369b829cb2461e9aa1ef84204e4 /new/userfriendly/bin/build.rb | |
parent | edb8b8b15c2c7963daa453b0fa1753aad37ee1f4 (diff) |
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 |