Class: Coco::HtmlIndexFormatter
- Inherits:
-
Object
- Object
- Coco::HtmlIndexFormatter
- Defined in:
- lib/coco/formatter/html_index_formatter.rb
Overview
I format the index.html
Instance Method Summary collapse
- #format ⇒ Object
-
#initialize(uncovered, result, threshold = 100) ⇒ HtmlIndexFormatter
constructor
uncovered - An Array list of uncovered files.
Constructor Details
#initialize(uncovered, result, threshold = 100) ⇒ HtmlIndexFormatter
uncovered - An Array list of uncovered files. result - CoverageResult. threshold - Fixnum.
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/coco/formatter/html_index_formatter.rb', line 13 def initialize(uncovered, result, threshold = 100) @uncovered = uncovered @result = result @threshold = threshold @summary = Summary.new(result, uncovered) @context = nil @template = Template.open(File.join(Coco::ROOT, 'template/index.erb')) @lines = [] build_lines_for_context end |
Instance Method Details
#format ⇒ Object
24 25 26 27 28 |
# File 'lib/coco/formatter/html_index_formatter.rb', line 24 def format @context = IndexContext.new(Helpers.index_title, @lines, uncovered_files, @summary, @threshold) @template.result(@context.variables) end |