Class: Vivlio::Starter::CLI::SamovarCommands::CoverCommand

Inherits:
Samovar::Command
  • Object
show all
Defined in:
lib/vivlio/starter/cli/samovar/cover_command.rb

Overview

cover コマンドの Samovar 実装

Instance Method Summary collapse

Instance Method Details

#callObject



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/vivlio/starter/cli/samovar/cover_command.rb', line 27

def call
  return print_usage if options[:help]

  case target || 'auto'
  when 'auto', 'all'
    CoverCommands.execute_generate(self)
  when 'a4'
    CoverCommands.execute_for_size(:a4, self)
  when 'b5'
    CoverCommands.execute_for_size(:b5, self)
  when 'a5'
    CoverCommands.execute_for_size(:a5, self)
  when 'epub'
    CoverCommands.execute_epub(self)
  else
    Common.log_error("未知のカバー種別です: #{target}")
    Common.log_info('指定可能な値: auto, a4, b5, a5, epub')
    return 1
  end

  0
end