Class: Rack::Insight::RackStaticBugAvoider

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/insight/rack_static_bug_avoider.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, static_app) ⇒ RackStaticBugAvoider

Returns a new instance of RackStaticBugAvoider.



3
4
5
6
# File 'lib/rack/insight/rack_static_bug_avoider.rb', line 3

def initialize(app, static_app)
  @app = app
  @static_app = static_app
end

Instance Method Details

#call(env) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/rack/insight/rack_static_bug_avoider.rb', line 8

def call(env)
  if env["PATH_INFO"]
    @static_app.call(env)
  else
    @app.call(env)
  end
end