Class: BrokenLinkFinder::HTMLReporter

Inherits:
Reporter
  • Object
show all
Defined in:
lib/broken_link_finder/reporter/html_reporter.rb

Overview

Class responsible for reporting in a HTML format.

Constant Summary

Constants inherited from Reporter

Reporter::NUM_VALUES

Instance Method Summary collapse

Constructor Details

#initialize(stream, sort, broken_links, ignored_links, broken_link_map, crawl_stats) ⇒ HTMLReporter

Returns a new HTMLReporter instance. stream is any Object that responds to :puts and :print.



8
9
10
11
12
# File 'lib/broken_link_finder/reporter/html_reporter.rb', line 8

def initialize(stream, sort,
               broken_links, ignored_links,
               broken_link_map, crawl_stats)
  super
end

Instance Method Details

#call(broken_verbose: true, ignored_verbose: false) ⇒ Object Also known as: report

Pretty print a report detailing the full link summary.



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/broken_link_finder/reporter/html_reporter.rb', line 15

def call(broken_verbose: true, ignored_verbose: false)
  puts '<div class="broken_link_finder_report">'

  report_crawl_summary
  report_broken_links(verbose: broken_verbose)
  report_ignored_links(verbose: ignored_verbose)

  puts '</div>'

  nil
end