Sha256: 02b6d55326800a19d243491a00c92e8fbcd55c8a67a633f9e0a3ccd93ae6f919

Contents?: true

Size: 663 Bytes

Versions: 5

Compression:

Stored size: 663 Bytes

Contents

module Formatters

  class HtmlIndex

    include Formatters::Base

    attr_accessor :file_summary

    def initialize(file_summary)
      self.file_summary = file_summary
    end

    def filename
      "index.htm"
    end

    def output_path
      FileUtils.mkpath(root_path)
      root_path
    end

    def content
      Haml::Engine.new(output_template).render(
        Object.new, {
          file_summary: file_summary,
          date: Time.now.strftime("%Y/%m/%d"),
          time: Time.now.strftime("%l:%M %P")
        }
      )
    end

    def output_template
      File.read(File.dirname(__FILE__) + "/templates/index.html.haml")
    end

  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fukuzatsu-0.10.1 lib/fukuzatsu/formatters/html_index.rb
fukuzatsu-0.9.16 lib/fukuzatsu/formatters/html_index.rb
fukuzatsu-0.9.15 lib/fukuzatsu/formatters/html_index.rb
fukuzatsu-0.9.14 lib/fukuzatsu/formatters/html_index.rb
fukuzatsu-0.9.13 lib/fukuzatsu/formatters/html_index.rb