Class: Timber::Integrations::ActionView::LogSubscriber
- Inherits:
-
Integrator
- Object
- Integrator
- Timber::Integrations::ActionView::LogSubscriber
- Defined in:
- lib/timber-rails/action_view/log_subscriber.rb,
lib/timber-rails/action_view/log_subscriber/timber_log_subscriber.rb
Overview
Reponsible for uninstalling the default ‘ActionView::LogSubscriber` and installing the TimberLogSubscriber.
Defined Under Namespace
Classes: TimberLogSubscriber
Instance Method Summary collapse
-
#initialize ⇒ LogSubscriber
constructor
A new instance of LogSubscriber.
- #integrate! ⇒ Object
Constructor Details
#initialize ⇒ LogSubscriber
Returns a new instance of LogSubscriber.
9 10 11 12 13 14 |
# File 'lib/timber-rails/action_view/log_subscriber.rb', line 9 def initialize require "action_view/log_subscriber" require "timber-rails/action_view/log_subscriber/timber_log_subscriber" rescue LoadError => e raise RequirementNotMetError.new(e.) end |
Instance Method Details
#integrate! ⇒ Object
16 17 18 19 20 21 |
# File 'lib/timber-rails/action_view/log_subscriber.rb', line 16 def integrate! return true if Timber::Integrations::Rails::ActiveSupportLogSubscriber.subscribed?(:action_view, TimberLogSubscriber) Timber::Integrations::Rails::ActiveSupportLogSubscriber.unsubscribe!(:action_view, ::ActionView::LogSubscriber) TimberLogSubscriber.attach_to(:action_view) end |