Middleware to update the process title ($0) with information about the current request. Based loosely on:
NOTE: This will not work properly in a multi-threaded environment.
# File lib/rack/contrib/proctitle.rb, line 20 def call(env) host, port = env['SERVER_NAME'], env['SERVER_PORT'] meth, path = env['REQUEST_METHOD'], env['PATH_INFO'] @requests += 1 $0 = "#{PROGNAME} [#{@appname}/#{port}] (#{@requests}) " "#{meth} #{path}" @app.call(env) end
Generated with the Darkfish Rdoc Generator 2.