Repository: rails/rails
File: activestorage/lib/active_storage/engine.rb (Ruby)

Code before:
    end

    initializer "active_storage.configs" do
      config.before_initialize do |app|
        ActiveStorage.touch_attachment_records = app.config.active_storage.touch_attachment_records != false
      end

      config.after_initialize do |app|
        ActiveStorage.logger            = app.config.active_storage.logger || Rails.logger
        ActiveStorage.variant_processor = app.config.active_storage.variant_processor || :mini_magick
        ActiveStorage.previewers        = app.config.active_storage.previewers || []
        ActiveStorage.analyzers         = app.config.active_storage.analyzers || []

        begin
          ActiveStorage.variant_transformer =
            case ActiveStorage.variant_processor
            when :disabled
              ActiveStorage::Transformers::NullTransformer
            when :vips
              ActiveStorage::Transformers::Vips
            when :mini_magick
              ActiveStorage::Transformers::ImageMagick
            else
              ActiveStorage.deprecator.warn(<<~WARN.squish)
                ActiveStorage.variant_processor must be set to :vips, :mini_magick, or :disabled.
                Passing #{ActiveStorage.variant_processor.inspect} is deprecated and will raise an exception in Rails 8.1.
              WARN
              ActiveStorage.variant_processor
            end
        rescue LoadError => error
          case error.message
          when /libvips/
            ActiveStorage.logger.warn <<~WARNING.squish
              Using vips to process variants requires the libvips library.
              Please install libvips using the instructions on the libvips website.
            WARNING
          when /image_processing/
            ActiveStorage.logger.warn <<~WARNING.squish
              Generating image variants require the image_processing gem.
              Please add `gem 'image_processing', '~> 1.2'` to your Gemfile.
            WARNING
          else
            raise
          end
        end

        ActiveStorage.paths             = app.config.active_storage.paths || {}
        ActiveStorage.routes_prefix     = app.config.active_storage.routes_prefix || "/rails/active_storage"
        ActiveStorage.draw_routes       = app.config.active_storage.draw_routes != false
        ActiveStorage.resolve_model_to_route = app.config.active_storage.resolve_model_to_route || :rails_storage_redirect


Review comment (suggestion):
I guess this part can wait, or we can split the PR. 🤔 
The goal was to help when people fumble the name, e.g. input `variant_processor = :minimagick` instead of `:mini_magick`.

Code after:
    end

    initializer "active_storage.configs" do
      config.before_initialize do |app|
        ActiveStorage.touch_attachment_records = app.config.active_storage.touch_attachment_records != false
      end

      config.after_initialize do |app|
        ActiveStorage.logger            = app.config.active_storage.logger || Rails.logger
        ActiveStorage.variant_processor = app.config.active_storage.variant_processor || :mini_magick
        ActiveStorage.previewers        = app.config.active_storage.previewers || []
        ActiveStorage.analyzers         = app.config.active_storage.analyzers || []

        begin
          ActiveStorage.variant_transformer =
            case ActiveStorage.variant_processor
            when :disabled
              ActiveStorage::Transformers::NullTransformer
            when :vips
              ActiveStorage::Transformers::Vips
            when :mini_magick
              ActiveStorage::Transformers::ImageMagick
            end
        rescue LoadError => error
          case error.message
          when /libvips/
            ActiveStorage.logger.warn <<~WARNING.squish
              Using vips to process variants requires the libvips library.
              Please install libvips using the instructions on the libvips website.
            WARNING
          when /image_processing/
            ActiveStorage.logger.warn <<~WARNING.squish
              Generating image variants require the image_processing gem.
              Please add `gem 'image_processing', '~> 1.2'` to your Gemfile.
            WARNING
          else
            raise
          end
        end

        ActiveStorage.paths             = app.config.active_storage.paths || {}
        ActiveStorage.routes_prefix     = app.config.active_storage.routes_prefix || "/rails/active_storage"
        ActiveStorage.draw_routes       = app.config.active_storage.draw_routes != false
        ActiveStorage.resolve_model_to_route = app.config.active_storage.resolve_model_to_route || :rails_storage_redirect

        ActiveStorage.supported_image_processing_methods += app.config.active_storage.supported_image_processing_methods || []
        ActiveStorage.unsupported_image_processing_arguments = app.config.active_storage.unsupported_image_processing_arguments || %w(
          -debug
          -display
          -distribute-cache
          -help