Sha256: dd0b6ed23b31429c1f0b5ed63d14af8c9757b40da89e02b51432c3d2d03386ab

Contents?: true

Size: 993 Bytes

Versions: 10

Compression:

Stored size: 993 Bytes

Contents

# frozen_string_literal: true

require 'erb'
require_relative 'yaml_formatter'
require_relative '../../application'

##
# HTMLFormatter class receive a [Report] and generates HAML output.
class HTMLFormatter < YAMLFormatter
  ##
  # Class constructor
  # @param report [Report] Parent object that contains data to be exported.
  def initialize(report)
    super(report)
    @data = {}
    filepath = File.join(File.dirname(__FILE__), '..', '..', 'files', 'template', 'case.html')
    @template = File.read(filepath)
  end

  ##
  # Process data from parent object and export it into YAML format.
  def process
    build_data
    build_page
    deinit
  end

  ##
  # Build html case page
  def build_page
    config = @data[:config]
    results = @data[:results]
    logs = @data[:logs]
    groups = @data[:groups]
    groups = @data[:groups]
    hall_of_fame = @data[:hall_of_fame]
    version = Application::VERSION
    renderer = ERB.new(@template)
    w renderer.result(binding)
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
teuton-2.3.6 lib/teuton/report/formatter/html_formatter.rb
teuton-2.3.5 lib/teuton/report/formatter/html_formatter.rb
teuton-2.3.4 lib/teuton/report/formatter/html_formatter.rb
teuton-2.3.3 lib/teuton/report/formatter/html_formatter.rb
teuton-2.3.2 lib/teuton/report/formatter/html_formatter.rb
teuton-2.3.1 lib/teuton/report/formatter/html_formatter.rb
teuton-2.2.2 lib/teuton/report/formatter/html_formatter.rb
teuton-2.1.11 lib/teuton/report/formatter/html_formatter.rb
teuton-2.1.10 lib/teuton/report/formatter/html_formatter.rb
teuton-2.1.9 lib/teuton/report/formatter/html_formatter.rb