Class: Coco::HtmlFormatter

Inherits:
Formatter show all
Defined in:
lib/coco/formatter/html_formatter.rb

Overview

TODO:

document and change name to HtmlFilesFormatter

I format coverages information into html files.

Instance Method Summary collapse

Constructor Details

#initialize(raw_coverages) ⇒ HtmlFormatter

Returns a new instance of HtmlFormatter.


12
13
14
15
16
17
# File 'lib/coco/formatter/html_formatter.rb', line 12

def initialize(raw_coverages)
  super(raw_coverages, [])
  @formatted_output_files = {}
  @context = nil
  @template = Template.open File.join(Coco::ROOT, 'template/file.erb')
end

Instance Method Details

#formatObject


19
20
21
22
23
24
# File 'lib/coco/formatter/html_formatter.rb', line 19

def format
  @raw_coverages.each do |filename, coverage|
    build_html filename, coverage
  end
  @formatted_output_files
end