Class: Indoctrinatr::Tools::Commands::Pdf

Inherits:
Dry::CLI::Command
  • Object
show all
Defined in:
lib/indoctrinatr/tools/commands/pdf.rb

Instance Method Summary collapse

Instance Method Details

#call(template_pack_name:, **options) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/indoctrinatr/tools/commands/pdf.rb', line 10

def call(template_pack_name:, **options)
  template_pack_name = CommandAutocompleteHelpers.handle_autocomplete(template_pack_name)
  keep_aux_files = options.fetch(:keep_aux_files)

  Indoctrinatr::Tools::Transactions::TemplatePackDefaultValuesParser.new.call(template_pack_name) do |result|
    result.success do |message|
      puts message
    end

    result.failure do |message|
      puts message
      exit 1
    end
  end

  Indoctrinatr::Tools::Transactions::TemplatePackDefaultValuesCompiler.new.call(template_pack_name:, keep_aux_files:) do |result|
    result.success do |message|
      puts message
    end

    result.failure do |message|
      puts message
      exit 1
    end
  end
end