Sha256: b2e6c72ed3c7cc6dc6ef24b745c551d672add0467c491bafb431bd5e9f3289fb
Contents?: true
Size: 875 Bytes
Versions: 6
Compression:
Stored size: 875 Bytes
Contents
require 'colorize' module Rubycritic module Generator module Text class List class << self TEMPLATE_PATH = File.expand_path('../templates/list.erb', __FILE__) def erb_template @erb_template ||= ERB.new(File.read(TEMPLATE_PATH), nil, '-') end end RATING_TO_COLOR = { 'A' => :green, 'B' => :green, 'C' => :yellow, 'D' => :light_red, 'F' => :red }.freeze def initialize(analysed_module) @analysed_module = analysed_module end def render erb_template.result(binding) end private def erb_template self.class.erb_template end def color @color ||= RATING_TO_COLOR[@analysed_module.rating.to_s] end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems