<commit_before>require "rails/engine"

module ActiveStorage
  class Engine < Rails::Engine # :nodoc:
    config.active_storage = ActiveSupport::OrderedOptions.new

    config.eager_load_namespaces << ActiveStorage

    initializer "active_storage.logger" do
      require "active_storage/service"

      config.after_initialize do |app|
        ActiveStorage::Service.logger = app.config.active_storage.logger || Rails.logger
      end
    end

    initializer "active_storage.attached" do
      require "active_storage/attached"

      ActiveSupport.on_load(:active_record) do
        extend ActiveStorage::Attached::Macros
      end
    end

    initializer "active_storage.verifier" do
      config.after_initialize do |app|
        ActiveStorage.verifier = Rails.application.message_verifier("ActiveStorage")
      end
    end

    initializer "active_storage.services" do
      config.after_initialize do |app|
        if config_choice = app.config.active_storage.service
          config_file = Pathname.new(Rails.root.join("config/storage_services.yml"))
          raise("Couldn't find Active Storage configuration in #{config_file}") unless config_file.exist?<commit_msg>Refer to the yielded app<commit_after>require "rails/engine"

module ActiveStorage
  class Engine < Rails::Engine # :nodoc:
    config.active_storage = ActiveSupport::OrderedOptions.new

    config.eager_load_namespaces << ActiveStorage

    initializer "active_storage.logger" do
      require "active_storage/service"

      config.after_initialize do |app|
        ActiveStorage::Service.logger = app.config.active_storage.logger || Rails.logger
      end
    end

    initializer "active_storage.attached" do
      require "active_storage/attached"

      ActiveSupport.on_load(:active_record) do
        extend ActiveStorage::Attached::Macros
      end
    end

    initializer "active_storage.verifier" do
      config.after_initialize do |app|
        ActiveStorage.verifier = app.message_verifier("ActiveStorage")
      end
    end

    initializer "active_storage.services" do
      config.after_initialize do |app|
        if config_choice = app.config.active_storage.service
          config_file = Pathname.new(Rails.root.join("config/storage_services.yml"))
          raise("Couldn't find Active Storage configuration in #{config_file}") unless config_file.exist?
{'fraction_non_alphanumeric': 0.08365180467091295, 'fraction_numerical': 0.0, 'mean_word_length': 3.548262548262548, 'pattern_counts': {'":': 0, '<': 9, '<?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': '3281579', 'n_tokens_mistral': 664, 'n_tokens_neox': 639, 'n_words': 135}