Sha256: 7b253c5e3e036e23493b269f9c6987cbd6e254938d5b413c43c27167983dc1c3

Contents?: true

Size: 725 Bytes

Versions: 30

Compression:

Stored size: 725 Bytes

Contents

module Timber
  module Probes
    # Reponsible for automatically tracking template rendering events in `ActionView` while
    # still preserving the default log style.
    class ActionViewLogSubscriber < Probe
      def initialize
        require "action_view/log_subscriber"
        require "timber/probes/action_view_log_subscriber/log_subscriber"
      rescue LoadError => e
        raise RequirementNotMetError.new(e.message)
      end

      def insert!
        return true if Util::ActiveSupportLogSubscriber.subscribed?(:action_view, LogSubscriber)
        Util::ActiveSupportLogSubscriber.unsubscribe(:action_view, ::ActionView::LogSubscriber)
        LogSubscriber.attach_to(:action_view)
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 2 rubygems

Version Path
timber-1.0.8 lib/timber/probes/action_view_log_subscriber.rb
timber-1.0.7 lib/timber/probes/action_view_log_subscriber.rb
timber-1.0.6 lib/timber/probes/action_view_log_subscriber.rb
timber-1.0.5 lib/timber/probes/action_view_log_subscriber.rb
timber-1.0.4 lib/timber/probes/action_view_log_subscriber.rb
timber-1.0.3 lib/timber/probes/action_view_log_subscriber.rb
timberio-1.0.3 lib/timber/probes/action_view_log_subscriber.rb
timberio-1.0.2 lib/timber/probes/action_view_log_subscriber.rb
timberio-1.0.1 lib/timber/probes/action_view_log_subscriber.rb
timberio-1.0.0 lib/timber/probes/action_view_log_subscriber.rb