Sha256: fc64a1d59bd7c891dff05e1b7993d03a23117b6537004caf70c109fd1177664f

Contents?: true

Size: 689 Bytes

Versions: 7

Compression:

Stored size: 689 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|
          if handler.respond_to?(:default_config)
            Lita.logger.warn(
              I18n.t("lita.config.handler_default_config_deprecated", name: handler.namespace)
            )
          end
        end
      end
    end

    Lita.register_handler(DeprecationCheck)
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
lita-4.0.4 lib/lita/handlers/deprecation_check.rb
lita-4.0.3 lib/lita/handlers/deprecation_check.rb
lita-4.0.2 lib/lita/handlers/deprecation_check.rb
lita-4.0.1 lib/lita/handlers/deprecation_check.rb
lita-4.0.0 lib/lita/handlers/deprecation_check.rb
lita-4.0.0.rc2 lib/lita/handlers/deprecation_check.rb
lita-4.0.0.rc1 lib/lita/handlers/deprecation_check.rb