Sha256: e57e9f13cc8e48b3832a9f8ce9a3abf88077d9c5f6dc9e393b87225c7a98d73b
Contents?: true
Size: 476 Bytes
Versions: 15
Compression:
Stored size: 476 Bytes
Contents
module Roger module Rack # Listens to the "sleep" parameter and sleeps the amount of seconds specified by the parameter. There is however a maximum of 5 seconds. class Sleep def initialize(app) @app = app end def call(env) r = ::Rack::Request.new(env) if r.params["sleep"] sleeptime = [r.params["sleep"].to_i, 5].min sleep sleeptime end @app.call(env) end end end end
Version data entries
15 entries across 15 versions & 1 rubygems