<commit_before>module Sevenhelpers
  module ViewHelpers
    def copyright_years(start_year = Time.now.year)
      current_year = Time.now.year
      if start_year > current_year # trap if user sets start year ahead of current year
        output = current_year.to_s
      else
        output = start_year.to_s
        output << "-#{current_year.to_s}" if start_year != current_year
      end
      output
    end

    def google_analytics_code(tracking_id, options = {})
      options.reverse_merge!(show_placeholder: true, environments: %w(production), universal: false)

      if options[:environments].include? Rails.env
        output = '<!-- Google Analytics -->\n'
        output << if options[:universal]
          google_analytics_universal(tracking_id, options[:domain])
        else
          google_analytics_classic(tracking_id)
        end
        output << '<!-- end Google Analytics -->'
      elsif options[:show_placeholder]
        output = "<!-- actual Google Analytics code will render here in #{ options[:environments].map(&:capitalize).to_sentence } -->"
      else
        output = ''
      end
      raw(output)
    end

    def error_messages_for(obj)
      content = ""
      if obj.errors.any?
        content << '<div class="error-messages">'
        content << "<h2>#{pluralize(obj.errors.count, "error")} prohibited this form from being saved:</h2>"
        content << "<ul>"
        obj.errors.full_messages.each do |msg|
          content << "<li>#{msg}</li>"
        end
        content << "</ul>"
        content << "</div>"
      end
      raw(content) if content
    end<commit_msg>Update view_helpers.rb<commit_after>module Sevenhelpers
  module ViewHelpers
    def copyright_years(start_year = Time.now.year)
      current_year = Time.now.year
      if start_year > current_year # trap if user sets start year ahead of current year
        output = current_year.to_s
      else
        output = start_year.to_s
        output << "-#{current_year.to_s}" if start_year != current_year
      end
      output
    end

    def google_analytics_code(tracking_id, options = {})
      options.reverse_merge!(show_placeholder: true, environments: %w(production), universal: false)

      if options[:environments].include? Rails.env
        output = "<!-- Google Analytics -->\n"
        output << if options[:universal]
          google_analytics_universal(tracking_id, options[:domain])
        else
          google_analytics_classic(tracking_id)
        end
        output << '<!-- end Google Analytics -->'
      elsif options[:show_placeholder]
        output = "<!-- actual Google Analytics code will render here in #{ options[:environments].map(&:capitalize).to_sentence } -->"
      else
        output = ''
      end
      raw(output)
    end

    def error_messages_for(obj)
      content = ""
      if obj.errors.any?
        content << '<div class="error-messages">'
        content << "<h2>#{pluralize(obj.errors.count, "error")} prohibited this form from being saved:</h2>"
        content << "<ul>"
        obj.errors.full_messages.each do |msg|
          content << "<li>#{msg}</li>"
        end
        content << "</ul>"
        content << "</div>"
      end
      raw(content) if content
    end
{'fraction_non_alphanumeric': 0.11987673343605547, 'fraction_numerical': 0.0012326656394453005, 'mean_word_length': 2.464247598719317, 'pattern_counts': {'":': 0, '<': 61, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3081660', 'n_tokens_mistral': 924, 'n_tokens_neox': 904, 'n_words': 228}