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, theme = 'light') ⇒ HtmlFilesWriter

Public: Initialize a new HtmlFilesWriter.

html_files - Hash, key is filename, value is html content. theme - The String name of the theme. Default is light.



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

def initialize(html_files, theme = 'light')
  @html_files = html_files
  @html_dir = HtmlDirectory.new(theme)
end

Instance Method Details

#writeObject

Public: Write HTML files in the right place.

Returns nothing.



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

def write
  @html_dir.clean
  return if @html_files.empty?

  @html_dir.setup
  write_each_file
end