Sha256: a195dc48bae921991ae9f6ec507be26e4398562e61e1005f250ceca5a2e56e96
Contents?: true
Size: 780 Bytes
Versions: 7
Compression:
Stored size: 780 Bytes
Contents
# frozen_string_literal: true require 'cgi' require 'rubycritic/generators/html/base' module RubyCritic module Generator module Html class Line < Base NORMAL_TEMPLATE = erb_template('line.html.erb') SMELLY_TEMPLATE = erb_template('smelly_line.html.erb') attr_reader :file_directory def initialize(file_directory, text, smells) @file_directory = file_directory @text = CGI.escapeHTML(text.chomp) @smells = smells end def render template.result(binding).delete("\n") + "\n" end private def template if @smells.empty? NORMAL_TEMPLATE else SMELLY_TEMPLATE end end end end end end
Version data entries
7 entries across 7 versions & 1 rubygems