Class: Debugbar::QuietRoutes

Inherits:
Object
  • Object
show all
Defined in:
lib/debugbar/middlewares/quiet_routes.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ QuietRoutes

Returns a new instance of QuietRoutes.



10
11
12
13
# File 'lib/debugbar/middlewares/quiet_routes.rb', line 10

def initialize(app)
  @app = app
  @route_regex = %r(\A/{0,2}#{::Debugbar.config.prefix})
end

Instance Method Details

#call(env) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/debugbar/middlewares/quiet_routes.rb', line 15

def call(env)
  if env['PATH_INFO'] =~ @route_regex
    ::Rails.logger.silence { @app.call(env) }
  else
    @app.call(env)
  end
end