Sha256: 7b89770850c0c9aa3deb26490e1e3be04765a1c94be77eb5d934df31c6801eab

Contents?: true

Size: 678 Bytes

Versions: 17

Compression:

Stored size: 678 Bytes

Contents

module Lita
  module Handlers
    # Warns about any handlers using deprecated features.
    # @since 4.0.0
    class DeprecationCheck
      extend Lita::Handler::EventRouter

      on :loaded, :check_handlers_for_default_config

      # Warns about handlers using the old +default_config+ method.
      def check_handlers_for_default_config(_payload)
        robot.registry.handlers.each do |handler|
          next unless handler.respond_to?(:default_config)
          Lita.logger.warn(
            I18n.t("lita.config.handler_default_config_deprecated", name: handler.namespace)
          )
        end
      end
    end

    Lita.register_handler(DeprecationCheck)
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
lita-4.8.0 lib/lita/handlers/deprecation_check.rb
lita-4.8.0.beta1 lib/lita/handlers/deprecation_check.rb
lita-4.7.1 lib/lita/handlers/deprecation_check.rb
lita-4.7.0 lib/lita/handlers/deprecation_check.rb
lita-4.6.1 lib/lita/handlers/deprecation_check.rb
lita-4.6.0 lib/lita/handlers/deprecation_check.rb
lita-4.5.0 lib/lita/handlers/deprecation_check.rb
lita-4.4.3 lib/lita/handlers/deprecation_check.rb
lita-4.4.2 lib/lita/handlers/deprecation_check.rb
lita-4.4.1 lib/lita/handlers/deprecation_check.rb
lita-4.4.0 lib/lita/handlers/deprecation_check.rb
lita-4.3.2 lib/lita/handlers/deprecation_check.rb
lita-4.3.1 lib/lita/handlers/deprecation_check.rb
lita-4.3.0 lib/lita/handlers/deprecation_check.rb
lita-4.2.1 lib/lita/handlers/deprecation_check.rb
lita-4.2.0 lib/lita/handlers/deprecation_check.rb
lita-4.1.0 lib/lita/handlers/deprecation_check.rb