class YardJunk::Janitor::HtmlReporter

Reporter that just outputs everything in HTML format. Useful for usage with Jenkins. See {BaseReporter} for details about reporters.

Constants

Helper
ROW
SECTION
STATS

Attributes

html[R]

Public Class Methods

new(*) click to toggle source
Calls superclass method YardJunk::Janitor::BaseReporter::new
# File lib/yard-junk/janitor/html_reporter.rb, line 81
def initialize(*)
  super
  @html = HEADER.dup
end

Public Instance Methods

finalize() click to toggle source
# File lib/yard-junk/janitor/html_reporter.rb, line 86
def finalize
  @html << FOOTER
  @io.puts(@html)
end

Private Instance Methods

_stats(**stat) click to toggle source
# File lib/yard-junk/janitor/html_reporter.rb, line 93
def _stats(**stat)
  render(STATS, **stat)
end
header(title, explanation) click to toggle source
# File lib/yard-junk/janitor/html_reporter.rb, line 97
def header(title, explanation)
  render(SECTION, title: title, explanation: explanation)
end
render(template, values) click to toggle source
# File lib/yard-junk/janitor/html_reporter.rb, line 105
def render(template, values)
  html <<
    ERB.new(template)
       .result(Helper.new(values).the_binding)
end
row(message) click to toggle source
# File lib/yard-junk/janitor/html_reporter.rb, line 101
def row(message)
  render(ROW, **message.to_h)
end