<commit_before>require "seymour"
require "seymour/config"
require "rails"

module Rails #:nodoc:
  module Mongoid #:nodoc:
    class Railtie < Rails::Railtie #:nodoc:

      # Exposes Seymour's configuration to the Rails application configuration.
      #
      # @example Set up configuration in the Rails app.
      #   module MyApplication
      #     class Application < Rails::Application
      #       config.seymour.activity_directory = 'app/activities'
      #     end
      #   end
      config.seymour = ::Seymour::Config

      # Due to all models not getting loaded and messing up inheritance queries
      # and indexing, we need to preload the models in order to address this.
      #
      # This will happen every request in development, once in ther other
      # environments.
      initializer "preload all activity models" do |app|
        config.to_prepare do
          puts "********************* Loading all Seymour activities"
          load_activities
        end
      end

      def self.load_activities
        puts "***** load_activities"
        if path = ::Seymour::Config.activity_directory
          Dir.glob("#{path}/**/*.rb").sort.each do |file|<commit_msg>Fixed naming<commit_after>require "seymour"
require "seymour/config"
require "rails"

module Rails #:nodoc:
  module Seymour #:nodoc:
    class Railtie < Rails::Railtie #:nodoc:

      # Exposes Seymour's configuration to the Rails application configuration.
      #
      # @example Set up configuration in the Rails app.
      #   module MyApplication
      #     class Application < Rails::Application
      #       config.seymour.activity_directory = 'app/activities'
      #     end
      #   end
      config.seymour = ::Seymour::Config

      # Due to all models not getting loaded and messing up inheritance queries
      # and indexing, we need to preload the models in order to address this.
      #
      # This will happen every request in development, once in ther other
      # environments.
      initializer "preload all activity models" do |app|
        config.to_prepare do
          puts "********************* Loading all Seymour activities"
          ::Rails::Seymour::Railtie.load_activities
        end
      end

      def self.load_activities
        puts "***** load_activities"
        if path = ::Seymour::Config.activity_directory
          Dir.glob("#{path}/**/*.rb").sort.each do |file|
{'fraction_non_alphanumeric': 0.10087173100871731, 'fraction_numerical': 0.0, 'mean_word_length': 2.5703703703703704, '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': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4855303', 'n_tokens_mistral': 685, 'n_tokens_neox': 650, 'n_words': 214}