Class: Coco::HtmlIndexWriter

Inherits:
Object
  • Object
show all
Defined in:
lib/coco/writer/html_index_writer.rb

Overview

I write the index.html

Instance Method Summary collapse

Constructor Details

#initialize(index) ⇒ HtmlIndexWriter

Returns a new instance of HtmlIndexWriter.



8
9
10
11
# File 'lib/coco/writer/html_index_writer.rb', line 8

def initialize index
  @index = index
  @dir = HtmlDirectory.new.coverage_dir
end

Instance Method Details

#writeObject



13
14
15
16
17
# File 'lib/coco/writer/html_index_writer.rb', line 13

def write
  if File.exist?(@dir)
    FileWriter.write File.join(@dir, 'index.html'), @index
  end
end