Class: HTMLFormatter

Inherits:
YAMLFormatter show all
Defined in:
lib/teuton/report/formatter/default/html.rb

Instance Attribute Summary

Attributes inherited from BaseFormatter

#ext

Instance Method Summary collapse

Methods inherited from ArrayFormatter

#build_data

Methods inherited from BaseFormatter

#deinit, #init, #trim, #w

Constructor Details

#initialize(report) ⇒ HTMLFormatter

Returns a new instance of HTMLFormatter.



5
6
7
8
9
10
11
12
# File 'lib/teuton/report/formatter/default/html.rb', line 5

def initialize(report)
  super
  @ext = "html"
  @data = {}
  basedir = File.join(File.dirname(__FILE__), "..", "..", "..")
  filepath = File.join(basedir, "files", "template", "case.html")
  @template = File.read(filepath)
end

Instance Method Details

#build_pageObject



20
21
22
23
# File 'lib/teuton/report/formatter/default/html.rb', line 20

def build_page
  render = ERB.new(@template)
  w render.result(binding)
end

#process(options = {}) ⇒ Object



14
15
16
17
18
# File 'lib/teuton/report/formatter/default/html.rb', line 14

def process(options = {})
  build_data(options)
  build_page
  deinit
end