Sha256: de1f53e9e795b39440e35a4310825c89785b84d0bd7c0c4111fa13f82e5612e7

Contents?: true

Size: 472 Bytes

Versions: 3

Compression:

Stored size: 472 Bytes

Contents

require "erb"
require "rubycritic/report_generators/base_generator"

module Rubycritic

  class SmellsIndexGenerator < BaseGenerator
    TEMPLATE = erb_template("smells_index.html.erb")

    def initialize(smells)
      @smells = smells.sort { |a, b| a.type <=> b.type }
    end

    def file_name
      "smells_index.html"
    end

    def render
      index_body = TEMPLATE.result(get_binding)
      LAYOUT_TEMPLATE.result(get_binding { index_body })
    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rubycritic-0.0.12 lib/rubycritic/report_generators/smells_index_generator.rb
rubycritic-0.0.11 lib/rubycritic/report_generators/smells_index_generator.rb
rubycritic-0.0.10 lib/rubycritic/report_generators/smells_index_generator.rb