Class: Coco::HtmlFilesWriter

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

Overview

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

Instance Method Summary collapse

Constructor Details

#initialize(html_files) ⇒ HtmlFilesWriter

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



9
10
11
12
# File 'lib/coco/writer/html_files_writer.rb', line 9

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

Instance Method Details

#writeObject



14
15
16
17
18
19
20
# File 'lib/coco/writer/html_files_writer.rb', line 14

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