<commit_before># frozen_string_literal: true

class ThinkingSphinx::Railtie < Rails::Railtie
  config.to_prepare do
    ThinkingSphinx::Configuration.reset
  end

  initializer 'thinking_sphinx.initialisation' do
    ActiveSupport.on_load(:active_record) do
      require 'thinking_sphinx/active_record'
      ActiveRecord::Base.include ThinkingSphinx::ActiveRecord::Base
    end

    if ActiveSupport::VERSION::MAJOR > 5
      if Rails.application.config.autoloader == :zeitwerk
        ActiveSupport::Dependencies.autoload_paths.delete(
          Rails.root.join("app", "indices").to_s
        )
      end
    end
  end

  rake_tasks do
    load File.expand_path('../tasks.rb', __FILE__)
  end
end
<commit_msg>Remove indices from eager load paths.<commit_after># frozen_string_literal: true

class ThinkingSphinx::Railtie < Rails::Railtie
  config.to_prepare do
    ThinkingSphinx::Configuration.reset
  end

  initializer 'thinking_sphinx.initialisation' do
    ActiveSupport.on_load(:active_record) do
      require 'thinking_sphinx/active_record'
      ActiveRecord::Base.include ThinkingSphinx::ActiveRecord::Base
    end

    if ActiveSupport::VERSION::MAJOR > 5
      if Rails.application.config.autoloader == :zeitwerk
        ActiveSupport::Dependencies.autoload_paths.delete(
          Rails.root.join("app", "indices").to_s
        )
      end

      Rails.application.config.eager_load_paths -= [
        Rails.root.join("app", "indices").to_s
      ]
      Rails.application.config.eager_load_paths.freeze
    end
  end

  rake_tasks do
    load File.expand_path('../tasks.rb', __FILE__)
  end
end

{'fraction_non_alphanumeric': 0.09801488833746898, 'fraction_numerical': 0.0012406947890818859, 'mean_word_length': 3.5308988764044944, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '7196221', 'n_tokens_mistral': 532, 'n_tokens_neox': 500, 'n_words': 87}