diff options
author | mms <git@sapka.me> | 2025-01-06 22:17:43 +0100 |
---|---|---|
committer | mms <git@sapka.me> | 2025-01-06 22:17:43 +0100 |
commit | b50e4a5f40bc64fa1893d249d83c05ecd217de1d (patch) | |
tree | d98b5c3a378975d095aa3dad8d1a642c3cf0f3d2 /new/bin | |
parent | bfd8209ad0d80b5027bea8a1a095dadc8bffdc61 (diff) |
feat(new): rss + batch
Diffstat (limited to 'new/bin')
-rw-r--r-- | new/bin/builder.rb | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/new/bin/builder.rb b/new/bin/builder.rb index 47195b27..d3a273a4 100644 --- a/new/bin/builder.rb +++ b/new/bin/builder.rb @@ -12,24 +12,33 @@ OptionParser.new do |opts| opts.on('-fPATH', '--file=PATH', 'File path') do |n| @options[:filepath] = n end + + opts.on('-a', '--all', 'Process all files') do |v| + @options[:filepath] = :all + end end.parse! module Crys class BuilderRunner - def initialize(file_path:, image_dir:, output_dir:, builder_class:) + def initialize(file_path:, image_dir:, output_dir:, builder_class:, batch_builder_class:) @file_path = file_path @output_dir = output_dir @builder_class = builder_class + @batch_builder_class = batch_builder_class @image_dir = image_dir end - def run + def run + if file_path == :all + batch_builder_class.new.build + else builder_class.new(file_path: file_path, output_dir: output_dir, image_dir: image_dir).build end + end private - attr_reader :builder_class, :file_path, :output_dir, :image_dir + attr_reader :builder_class, :file_path, :output_dir, :image_dir, :batch_builder_class end end |