Class: Pandocomatic::SummaryPrinter

Inherits:
Printer
  • Object
show all
Defined in:
lib/pandocomatic/printer/summary_printer.rb

Overview

Printer for printing a summary of the conversion process in non-quiet mode

Direct Known Subclasses

FinishPrinter

Instance Method Summary collapse

Methods inherited from Printer

#print, #template, #to_s

Constructor Details

#initialize(command, configuration) ⇒ SummaryPrinter

Create a new SummaryPrinter

pandocomatic invokation

Parameters:

  • command (Command)

    the command to summarize

  • configuration (Configuration)

    the configuration of the



31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/pandocomatic/printer/summary_printer.rb', line 31

def initialize(command, configuration)
  super('summary.txt')
  @command = command
  @input = configuration.input.to_s
  @output = if configuration.stdout?
              nil
            else
              configuration.output
            end

  @config_files = configuration.config_files
end

Instance Method Details

#commandsString

A string representation of the commands being executed

Returns:

  • (String)


47
48
49
# File 'lib/pandocomatic/printer/summary_printer.rb', line 47

def commands
  "#{@command.count} command#{'s' if @command.count != 1}"
end

#output?Boolean

Is there an output file?

Returns:

  • (Boolean)

    True if there is an output defined in this SummaryPrinter, false otherwise



55
56
57
# File 'lib/pandocomatic/printer/summary_printer.rb', line 55

def output?
  !@output.nil? and !@output.empty?
end