<commit_before># This class exists so including the Rails HTML sanitization helpers doesn't polute your models.
class RailsSanitize
  include ActionView::Helpers::SanitizeHelper
end<commit_msg>Support Rails 2.2 as well as 2.x by checking the ActionPack::VERSION (technique stolen from Erubis)<commit_after>require 'action_pack/version'

# This class exists so including the Rails HTML sanitization helpers doesn't polute your models.
class RailsSanitize
  if ActionPack::VERSION::MINOR >= 2 # Rails 2.2+
    extend ActionView::Helpers::SanitizeHelper::ClassMethods
  else # Rails 2.1 or earlier (note: xss_terminate does not support Rails 1.x)
    include ActionView::Helpers::SanitizeHelper
  end
end
{'fraction_non_alphanumeric': 0.07132667617689016, 'fraction_numerical': 0.012838801711840228, 'mean_word_length': 5.815533980582524, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '3703390', 'n_tokens_mistral': 208, 'n_tokens_neox': 196, 'n_words': 74}