Sha256: 6e6e75b03b04135c483a38c28a5a7ecf8293484dc8d5729ba3e4cc0b6f03697c

Contents?: true

Size: 823 Bytes

Versions: 23

Compression:

Stored size: 823 Bytes

Contents

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

23 entries across 23 versions & 1 rubygems

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