Sha256: 99dde63850ed90d202c6c7ccda3214f42d49721056a05575ac7bee33a85c792a

Contents?: true

Size: 865 Bytes

Versions: 23

Compression:

Stored size: 865 Bytes

Contents

module Timber
  module Integrations
    module ActionController
      # Responsible for removing the default ActionController::LogSubscriber and installing
      # the TimberLogSubscriber
      #
      # @private
      class LogSubscriber < Integrator
        def initialize
          require "action_controller/log_subscriber"
          require "timber/integrations/action_controller/log_subscriber/timber_log_subscriber"
        rescue LoadError => e
          raise RequirementNotMetError.new(e.message)
        end

        def integrate!
          return true if Util::ActiveSupportLogSubscriber.subscribed?(:action_controller, TimberLogSubscriber)

          Util::ActiveSupportLogSubscriber.unsubscribe!(:action_controller, ::ActionController::LogSubscriber)
          TimberLogSubscriber.attach_to(:action_controller)
        end
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
timber-2.0.24 lib/timber/integrations/action_controller/log_subscriber.rb
timber-2.0.23 lib/timber/integrations/action_controller/log_subscriber.rb
timber-2.0.22 lib/timber/integrations/action_controller/log_subscriber.rb
timber-2.0.21 lib/timber/integrations/action_controller/log_subscriber.rb
timber-2.0.20 lib/timber/integrations/action_controller/log_subscriber.rb
timber-2.0.19 lib/timber/integrations/action_controller/log_subscriber.rb
timber-2.0.17 lib/timber/integrations/action_controller/log_subscriber.rb
timber-2.0.16 lib/timber/integrations/action_controller/log_subscriber.rb
timber-2.0.15 lib/timber/integrations/action_controller/log_subscriber.rb
timber-2.0.14 lib/timber/integrations/action_controller/log_subscriber.rb
timber-2.0.12 lib/timber/integrations/action_controller/log_subscriber.rb
timber-2.0.11 lib/timber/integrations/action_controller/log_subscriber.rb
timber-2.0.10 lib/timber/integrations/action_controller/log_subscriber.rb
timber-2.0.9 lib/timber/integrations/action_controller/log_subscriber.rb
timber-2.0.8 lib/timber/integrations/action_controller/log_subscriber.rb
timber-2.0.7 lib/timber/integrations/action_controller/log_subscriber.rb
timber-2.0.6 lib/timber/integrations/action_controller/log_subscriber.rb
timber-2.0.5 lib/timber/integrations/action_controller/log_subscriber.rb
timber-2.0.4 lib/timber/integrations/action_controller/log_subscriber.rb
timber-2.0.3 lib/timber/integrations/action_controller/log_subscriber.rb