Class: Sentiero::Rails::Engine
- Inherits:
-
Rails::Engine
- Object
- Rails::Engine
- Sentiero::Rails::Engine
- Defined in:
- lib/sentiero/rails/engine.rb
Class Method Summary collapse
Class Method Details
.insert_reporter_middleware(app) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/sentiero/rails/engine.rb', line 21 def self.insert_reporter_middleware(app) return false unless reporter_middleware_enabled? # Install whenever opted in — not gated on Reporter.active? at boot, since # the user's Reporter.configure runs in an initializer after this one. The # middleware is a cheap pass-through and Reporter.notify guards on active? # at request time, so an unconfigured reporter just does nothing. app.middleware.use Sentiero::Reporter::Middleware true rescue => e warn "[Sentiero::Reporter] middleware auto-install failed: #{e.class}: #{e.}" false end |
.reporter_middleware_enabled? ⇒ Boolean
35 36 37 38 39 |
# File 'lib/sentiero/rails/engine.rb', line 35 def self.reporter_middleware_enabled? flag = Sentiero::Rails.configuration.reporter_middleware return true if flag.nil? flag end |