<commit_before>if defined?(Rails::Railtie)
  module RailsConfig
    class Railtie < Rails::Railtie

      # manually load the custom initializer before everything else
      initializer :load_custom_rails_config, :before => :bootstrap_hook do
        initializer = Rails.root.join("config", "initializers", "rails_config")
        require initializer if File.exist?(initializer)
      end

      # Parse the settings before any of the initializers
      ActiveSupport.on_load :before_initialize, :yield => true do
        RailsConfig.load_and_set_settings(
          Rails.root.join("config", "settings.yml").to_s,
          Rails.root.join("config", "settings", "#{Rails.env}.yml").to_s,
          Rails.root.join("config", "environments", "#{Rails.env}.yml").to_s
        )
      end

      # Rails Dev environment should reload the Settings on every request
      if Rails.env.development?
        initializer :rails_config_reload_on_development do
          ActionController::Base.class_eval do<commit_msg>use before_configuration hook to set up rails_config in Rails<commit_after>if defined?(Rails::Railtie)
  module RailsConfig
    class Railtie < Rails::Railtie

      # manually load the custom initializer before everything else
      initializer :load_custom_rails_config, :before => :bootstrap_hook do
        initializer = Rails.root.join("config", "initializers", "rails_config")
        require initializer if File.exist?(initializer)
      end

      # Parse the settings before any of the initializers
      ActiveSupport.on_load :before_configuration, :yield => true do
        RailsConfig.load_and_set_settings(
          Rails.root.join("config", "settings.yml").to_s,
          Rails.root.join("config", "settings", "#{Rails.env}.yml").to_s,
          Rails.root.join("config", "environments", "#{Rails.env}.yml").to_s
        )
      end

      # Rails Dev environment should reload the Settings on every request
      if Rails.env.development?
        initializer :rails_config_reload_on_development do
          ActionController::Base.class_eval do
{'fraction_non_alphanumeric': 0.09850313858039594, 'fraction_numerical': 0.0, 'mean_word_length': 3.325678496868476, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '7291057', 'n_tokens_mistral': 611, 'n_tokens_neox': 566, 'n_words': 145}