Sha256: 40214baffff746985a26e553ccbdfb3d15cec50f35fa4e01093a2623407210ef

Contents?: true

Size: 852 Bytes

Versions: 34

Compression:

Stored size: 852 Bytes

Contents

require "timber/integrator"

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

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

          Util::ActiveSupportLogSubscriber.unsubscribe!(:action_view, ::ActionView::LogSubscriber)
          TimberLogSubscriber.attach_to(:action_view)
        end
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
timber-2.6.2 lib/timber/integrations/action_view/log_subscriber.rb
timber-2.6.1 lib/timber/integrations/action_view/log_subscriber.rb
timber-2.6.0 lib/timber/integrations/action_view/log_subscriber.rb
timber-2.6.0.pre.beta2 lib/timber/integrations/action_view/log_subscriber.rb
timber-2.6.0.pre.beta1 lib/timber/integrations/action_view/log_subscriber.rb
timber-2.5.1 lib/timber/integrations/action_view/log_subscriber.rb
timber-2.5.0 lib/timber/integrations/action_view/log_subscriber.rb
timber-2.4.0 lib/timber/integrations/action_view/log_subscriber.rb
timber-2.3.4 lib/timber/integrations/action_view/log_subscriber.rb
timber-2.3.3 lib/timber/integrations/action_view/log_subscriber.rb
timber-2.3.2 lib/timber/integrations/action_view/log_subscriber.rb
timber-2.3.1 lib/timber/integrations/action_view/log_subscriber.rb
timber-2.3.0 lib/timber/integrations/action_view/log_subscriber.rb
timber-2.2.3 lib/timber/integrations/action_view/log_subscriber.rb
timber-2.2.2 lib/timber/integrations/action_view/log_subscriber.rb
timber-2.2.1 lib/timber/integrations/action_view/log_subscriber.rb
timber-2.2.0 lib/timber/integrations/action_view/log_subscriber.rb
timber-2.1.10 lib/timber/integrations/action_view/log_subscriber.rb
timber-2.1.9 lib/timber/integrations/action_view/log_subscriber.rb
timber-2.1.8 lib/timber/integrations/action_view/log_subscriber.rb