Class: VivlioStarter::CLI::SamovarCommands::PdfPagesCommand

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

Overview

pdf:pages コマンドの 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



104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# File 'lib/vivlio_starter/cli/samovar/pdf_command.rb', line 104

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_pages(build_options, input)
  0
rescue StandardError => e
  Common.log_error("[pdf:pages] #{e.message}")
  Common.log_error(e.backtrace.first(5).join("\n")) if ENV['VERBOSE']
  1
end