Sha256: 7100f971d2a553cf7e79bba05357b5f8732127fe19b4908c4049638d44cb4ebc

Contents?: true

Size: 504 Bytes

Versions: 2

Compression:

Stored size: 504 Bytes

Contents

module Coco

  # Public: I write the index.html
  #
  class HtmlIndexWriter

    # Public: Initialize a new HtmlIndexWriter object.
    #
    # index - A String HTML document.
    #
    def initialize(index)
      @index = index
      @dir = HtmlDirectory.new.coverage_dir
    end

    # Public: Write the index file in the right place.
    #
    # Returns nothing.
    #
    def write
      if File.exist?(@dir)
        FileWriter.write File.join(@dir, 'index.html'), @index
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
coco-0.15.0 lib/coco/writer/html_index_writer.rb
coco-0.14.0 lib/coco/writer/html_index_writer.rb