lib/raindrops/middleware.rb in raindrops-0.15.0 vs lib/raindrops/middleware.rb in raindrops-0.16.0
- old
+ new
@@ -75,15 +75,13 @@
# A Raindrops::Struct used to count the number of :calling and :writing
# clients. This struct is intended to be shared across multiple processes
# and both counters are updated atomically.
#
# This is supported on all operating systems supported by Raindrops
- class Stats < Raindrops::Struct.new(:calling, :writing)
- end
+ Stats = Raindrops::Struct.new(:calling, :writing)
# :stopdoc:
- PATH_INFO = "PATH_INFO"
require "raindrops/middleware/proxy"
# :startdoc:
# +app+ may be any Rack application, this middleware wraps it.
# +opts+ is a hash that understands the following members:
@@ -109,10 +107,10 @@
end
end
# standard Rack endpoint
def call(env) # :nodoc:
- env[PATH_INFO] == @path and return stats_response
+ env['PATH_INFO'] == @path and return stats_response
begin
@stats.incr_calling
status, headers, body = @app.call(env)
rv = [ status, headers, Proxy.new(body, @stats) ]