Class: VivlioStarter::CLI::SamovarCommands::PdfReadCommand
- Inherits:
-
VsCommand
- Object
- Samovar::Command
- VsCommand
- VivlioStarter::CLI::SamovarCommands::PdfReadCommand
- Defined in:
- lib/vivlio_starter/cli/samovar/pdf_command.rb
Overview
pdf:read コマンドの Samovar 実装(Public コマンド)
Constant Summary
Constants included from OptionTokenNormalizer
OptionTokenNormalizer::BARE_VALUE_DEFAULTS
Instance Method Summary collapse
Methods included from OptionTokenNormalizer
Instance Method Details
#call ⇒ Object
199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 |
# File 'lib/vivlio_starter/cli/samovar/pdf_command.rb', line 199 def call if [:help] || target.to_s.strip.empty? print_usage return 0 end # 前提条件の検証(ProjectRoot ○) # target は章トークンの場合があるため PdfArtifactCheck は適用せず、 # PDF パス解決の失敗はドメイン層(MissingPdfError)に委ねる guard_failure = Guards.precheck(Guards::RelaxedCheck.new(Guards::ProjectRootCheck.new)) return guard_failure if guard_failure pdf_reader.call 0 rescue Commands::PdfReadCommand::InvalidInputError => e Common.log_error("[pdf:read] #{e.}") 1 rescue Commands::PdfReadCommand::MissingPdfError => e Common.log_error("[pdf:read] #{e.}") 1 rescue StandardError => e Common.log_error("[pdf:read] 実行中にエラー: #{e.}") Common.log_error(e.backtrace.first(5).join("\n")) if ENV['VERBOSE'] 1 end |