Class: Dragnet::Exporters::HTMLExporter

Inherits:
Exporter
  • Object
show all
Includes:
Helpers::RepositoryHelper
Defined in:
lib/dragnet/exporters/html_exporter.rb

Overview

Creates an HTML report from the given Test Records and Errors data.

Constant Summary collapse

TEMPLATE =
File.join(__dir__, 'templates', 'template.html.erb').freeze

Instance Attribute Summary

Attributes inherited from Exporter

#errors, #logger, #repository, #test_records

Instance Method Summary collapse

Methods included from Helpers::RepositoryHelper

#relative_to_repo, #repo_base, #shorten_sha1

Methods inherited from Exporter

#initialize

Constructor Details

This class inherits a constructor from Dragnet::Exporters::Exporter

Instance Method Details

#exportString

Generates the report and returns it as a string.

Returns:

  • (String)

    The generated HTML report.



18
19
20
21
# File 'lib/dragnet/exporters/html_exporter.rb', line 18

def export
  logger.info "Generating HTML report from template: #{TEMPLATE}..."
  ERB.new(File.read(TEMPLATE)).result(binding)
end