Class: Rackprof::Middleware

Inherits:
Object
  • Object
show all
Defined in:
lib/rackprof/middleware.rb

Constant Summary collapse

IGNORE_REQUESTS =
/(assets|rackprof)/

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ Middleware

Returns a new instance of Middleware.



5
6
7
# File 'lib/rackprof/middleware.rb', line 5

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/rackprof/middleware.rb', line 9

def call(env)
  if env['PATH_INFO'] !~ IGNORE_REQUESTS
    RequestNotify.instance.notify { @app.call(env) }
  else
    @app.call(env)
  end
end