Class: Coco::HtmlFilesWriter

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

Overview

Public: I populate the coverage/ directory with files, if any.

Instance Method Summary collapse

Constructor Details

#initialize(html_files) ⇒ HtmlFilesWriter

Public: Initialize a new HtmlFilesWriter.

html_files - Hash, key is filename, value is html content.



11
12
13
14
# File 'lib/coco/writer/html_files_writer.rb', line 11

def initialize(html_files)
  @html_files = html_files
  @html_dir = HtmlDirectory.new
end

Instance Method Details

#writeObject

Public: Write HTML files in the right place.

Returns nothing.



19
20
21
22
23
24
25
# File 'lib/coco/writer/html_files_writer.rb', line 19

def write
  @html_dir.clean
  if @html_files.size > 0
    @html_dir.setup
    write_each_file
  end
end