Class: Crawlscope::StructuredData::Reporter
- Inherits:
-
Object
- Object
- Crawlscope::StructuredData::Reporter
- Defined in:
- lib/crawlscope/structured_data/reporter.rb
Instance Method Summary collapse
- #details(result, debug:, renderer:) ⇒ Object
-
#initialize(io:, report_path: nil) ⇒ Reporter
constructor
A new instance of Reporter.
- #report(result) ⇒ Object
Constructor Details
#initialize(io:, report_path: nil) ⇒ Reporter
Returns a new instance of Reporter.
9 10 11 12 |
# File 'lib/crawlscope/structured_data/reporter.rb', line 9 def initialize(io:, report_path: nil) @io = io @report_path = report_path end |
Instance Method Details
#details(result, debug:, renderer:) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/crawlscope/structured_data/reporter.rb', line 25 def details(result, debug:, renderer:) @io.puts("JavaScript mode enabled (Ferrum)") if renderer == :browser @io.puts("Validating JSON-LD on #{result.entries.size} URL(s)") @io.puts("") result.entries.each do |entry| report_entry(entry, debug: debug) end @io.puts("STATUS: #{result.ok? ? "OK" : "FAILED"}") end |