Class: Vivlio::Starter::CLI::PdfCommands::SingleDocDecider

Inherits:
Object
  • Object
show all
Defined in:
lib/vivlio/starter/cli/pdf.rb

Overview

–single-doc オプションの有効化可否を判定する

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ SingleDocDecider

Returns a new instance of SingleDocDecider.



210
211
212
# File 'lib/vivlio/starter/cli/pdf.rb', line 210

def initialize(config)
  @config = config
end

Instance Method Details

#callObject

single-doc を有効化すべきかどうか返す



215
216
217
218
219
220
221
222
223
224
# File 'lib/vivlio/starter/cli/pdf.rb', line 215

def call
  return false unless requested?
  return false unless config_allows_single_doc?
  return false unless entries_js_allows_single_doc?

  true
rescue StandardError => e
  Common.log_warn("[pdf] --single-doc 判定に失敗: #{e}。安全側で無効化します")
  false
end