Class: Pandocomatic::WarningPrinter

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

Overview

Printer for warnings

Instance Method Summary collapse

Methods inherited from Printer

#template, #to_s

Constructor Details

#initialize(warning) ⇒ WarningPrinter

Create a new WarningPrinter

Parameters:

  • warning (Warning)

    the warning to print



29
30
31
32
33
# File 'lib/pandocomatic/printer/warning_printer.rb', line 29

def initialize(warning)
  template = 'warning.txt'
  super(template)
  @warning = warning
end

Instance Method Details

Print warnings to STDERR rather than STDOUT



36
37
38
39
# File 'lib/pandocomatic/printer/warning_printer.rb', line 36

def print
  Pandocomatic::LOG.warn self
  warn self
end