Class: Coco::HtmlIndexWriter
- Inherits:
-
Object
- Object
- Coco::HtmlIndexWriter
- Defined in:
- lib/coco/writer/html_index_writer.rb
Overview
Public: I write the index.html
Instance Method Summary collapse
-
#initialize(index) ⇒ HtmlIndexWriter
constructor
Public: Initialize a new HtmlIndexWriter object.
-
#write ⇒ Object
Public: Write the index file in the right place.
Constructor Details
#initialize(index) ⇒ HtmlIndexWriter
Public: Initialize a new HtmlIndexWriter object.
index - A String HTML document.
11 12 13 14 |
# File 'lib/coco/writer/html_index_writer.rb', line 11 def initialize(index) @index = index @dir = HtmlDirectory.new.coverage_dir end |
Instance Method Details
#write ⇒ Object
Public: Write the index file in the right place.
Returns nothing.
20 21 22 23 24 |
# File 'lib/coco/writer/html_index_writer.rb', line 20 def write if File.exist?(@dir) FileWriter.write File.join(@dir, 'index.html'), @index end end |