class RubyCritic::Generator::Html::SimpleCovIndex

Constants

TEMPLATE

Public Class Methods

new(analysed_modules) click to toggle source
# File lib/rubycritic/generators/html/simple_cov_index.rb, line 11
def initialize(analysed_modules)
  @analysed_modules = sorted(filtered(analysed_modules))
  set_header_links if Config.compare_branches_mode?
end

Public Instance Methods

file_name() click to toggle source
# File lib/rubycritic/generators/html/simple_cov_index.rb, line 22
def file_name
  'simple_cov_index.html'
end
filtered(mods) click to toggle source
# File lib/rubycritic/generators/html/simple_cov_index.rb, line 35
def filtered(mods)
  mods.reject do |a_module|
    path = a_module.pathname.to_s
    path.start_with?('spec', 'test')
  end
end
render() click to toggle source
# File lib/rubycritic/generators/html/simple_cov_index.rb, line 26
def render
  index_body = TEMPLATE.result(base_binding)
  LAYOUT_TEMPLATE.result(base_binding { index_body })
end
sorted(mods) click to toggle source
# File lib/rubycritic/generators/html/simple_cov_index.rb, line 31
def sorted(mods)
  mods.sort_by(&:coverage)
end