<commit_before>if defined?(ActiveSupport)
  # check for a compatible Rails version when Haml is loaded
  if (activesupport_spec = Gem.loaded_specs['activesupport'])
    if activesupport_spec.version.to_s < '3.2'
      raise Exception.new("\n\n** Haml now requires Rails 3.2 and later. Use Haml version 4.0.4\n\n")
    end
  end

  require 'haml/template/options'
  ActiveSupport.on_load(:before_initialize) do
    ActiveSupport.on_load(:action_view) do
      require "haml/template"

      if defined? Erubi
        require "haml/helpers/safe_erubi_template"
        Haml::Filters::Erb.template_class = Haml::SafeErubiTemplate
      else
        require "haml/helpers/safe_erubis_template"
        Haml::Filters::Erb.template_class = Haml::SafeErubisTemplate
      end
    end
  end
end

module Haml
  class Railtie < ::Rails::Railtie
    initializer :haml do |app|
      require "haml/template"
      if defined?(::Sass::Rails::SassTemplate) && app.config.assets.enabled
        require "haml/sass_rails_filter"
      end
    end
  end<commit_msg>We're not always initializing a Rails app when using Action View<commit_after>if defined?(ActiveSupport)
  # check for a compatible Rails version when Haml is loaded
  if (activesupport_spec = Gem.loaded_specs['activesupport'])
    if activesupport_spec.version.to_s < '3.2'
      raise Exception.new("\n\n** Haml now requires Rails 3.2 and later. Use Haml version 4.0.4\n\n")
    end
  end

  require 'haml/template/options'
  ActiveSupport.on_load(:action_view) do
    require "haml/template"

    if defined? Erubi
      require "haml/helpers/safe_erubi_template"
      Haml::Filters::Erb.template_class = Haml::SafeErubiTemplate
    else
      require "haml/helpers/safe_erubis_template"
      Haml::Filters::Erb.template_class = Haml::SafeErubisTemplate
    end
  end
end

module Haml
  class Railtie < ::Rails::Railtie
    initializer :haml do |app|
      require "haml/template"
      if defined?(::Sass::Rails::SassTemplate) && app.config.assets.enabled
        require "haml/sass_rails_filter"
      end
    end
  end
{'fraction_non_alphanumeric': 0.09884281581485053, 'fraction_numerical': 0.006750241080038573, 'mean_word_length': 3.443254817987152, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, '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': '875501', 'n_tokens_mistral': 704, 'n_tokens_neox': 699, 'n_words': 158}