Sha256: 50e876b24715389b876782132af1fa17f0f28351e39f7a90edd75a79028c50eb
Contents?: true
Size: 1.19 KB
Versions: 74
Compression:
Stored size: 1.19 KB
Contents
# frozen_string_literal: true require 'avm/eac_writings_base0/project_build' require 'eac_cli/core_ext' module Avm module Tools class Runner class AppSrc class EacWritingsBase0 class BuildChapters runner_with :help do arg_opt '-o', '--output-dir', 'Output chapters to specific directory.' end def run runner_context.call(:project_banner) output_dir.mkpath project.chapters.each_with_index do |c, i| ::Avm::EacWritingsBase0::ProjectBuild.new(project, chapter_build_options(c, i)) end end private def chapter_build_options(chapter, index) output_name = "#{(index + 1).to_s.rjust(3, '0')}_#{chapter}.pdf" { output_file: output_dir.join(output_name), chapter: chapter } end def output_dir_uncached ( parsed.output_dir || project.default_output_dir.join('chapters') ).to_pathname end def project runner_context.call(:project) end end end end end end end
Version data entries
74 entries across 74 versions & 2 rubygems