Class: VivlioStarter::CLI::SamovarCommands::PdfRasterizeCommand

Inherits:
VsCommand
  • Object
show all
Defined in:
lib/vivlio_starter/cli/samovar/pdf_command.rb

Overview

pdf:rasterize コマンドの Samovar 実装(Public コマンド)

Constant Summary

Constants included from OptionTokenNormalizer

OptionTokenNormalizer::BARE_VALUE_DEFAULTS

Instance Method Summary collapse

Methods included from OptionTokenNormalizer

#initialize, prepended

Instance Method Details

#callObject



153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
# File 'lib/vivlio_starter/cli/samovar/pdf_command.rb', line 153

def call
  return print_usage if options[:help]

  # 前提条件の検証(ProjectRoot ○ / PdfArtifact ◎: 明示パス指定時のみ)
  guard_failure = Guards.precheck(
    Guards::RelaxedCheck.new(Guards::ProjectRootCheck.new),
    Guards::PdfArtifactCheck.new(input)
  )
  return guard_failure if guard_failure

  PdfCommands.execute_pdf_rasterize(build_options, input)
  0
rescue StandardError => e
  Common.log_error("[pdf:rasterize] #{e.message}")
  Common.log_error(e.backtrace.first(5).join("\n")) if ENV['VERBOSE']
  1
end