class HTMLFormatter

HTMLFormatter class receive a [Report] and generates HAML output.

Public Class Methods

new(report) click to toggle source

Class constructor @param report [Report] Parent object that contains data to be exported.

Calls superclass method YAMLFormatter::new
# File lib/teuton/report/formatter/html_formatter.rb, line 13
def initialize(report)
  super(report)
  @data = {}
  filepath = File.join(File.dirname(__FILE__), '..', '..', 'files', 'template', 'case.html')
  @template = File.read(filepath)
end

Public Instance Methods

build_page() click to toggle source

Build html case page

# File lib/teuton/report/formatter/html_formatter.rb, line 30
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
process() click to toggle source

Process data from parent object and export it into YAML format.

# File lib/teuton/report/formatter/html_formatter.rb, line 22
def process
  build_data
  build_page
  deinit
end