Class: HTMLFormatter
- Inherits:
-
YAMLFormatter
- Object
- BaseFormatter
- ArrayFormatter
- YAMLFormatter
- HTMLFormatter
- Defined in:
- lib/teuton/report/formatter/html_formatter.rb
Overview
HTMLFormatter class receive a [Report] and generates HAML output.
Instance Method Summary collapse
-
#build_page ⇒ Object
Build html case page.
-
#initialize(report) ⇒ HTMLFormatter
constructor
Class constructor.
-
#process ⇒ Object
Process data from parent object and export it into YAML format.
Methods inherited from ArrayFormatter
#build_data, #build_final_data, #build_history_data, #build_hof_data, #build_initial_data
Methods inherited from BaseFormatter
Constructor Details
#initialize(report) ⇒ HTMLFormatter
Class constructor
13 14 15 16 17 18 |
# 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 |
Instance Method Details
#build_page ⇒ Object
Build html case page
30 31 32 33 34 35 36 37 38 39 40 |
# 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 ⇒ Object
Process data from parent object and export it into YAML format.
22 23 24 25 26 |
# File 'lib/teuton/report/formatter/html_formatter.rb', line 22 def process build_data build_page deinit end |