class Pandocomatic::SummaryPrinter

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

Public Class Methods

new(command, configuration) click to toggle source

Create a new SummaryPrinter

@param command [Command] the command to summarize @param configuration [Configuration] the configuration of the pandocomatic invokation

Calls superclass method Pandocomatic::Printer::new
# 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

Public Instance Methods

commands() click to toggle source

A string representation of the commands being executed

@return [String]

# File lib/pandocomatic/printer/summary_printer.rb, line 47
def commands
  "#{@command.count} command#{'s' if @command.count != 1}"
end
output?() click to toggle source

Is there an output file?

@return [Boolean] True if there is an output defined in this

SummaryPrinter, false otherwise
# File lib/pandocomatic/printer/summary_printer.rb, line 55
def output?
  !@output.nil? and !@output.empty?
end