| Server IP : 109.234.162.214 / Your IP : 216.73.216.112 Web Server : Apache System : Linux servd162214.srv.odns.fr 4.18.0-372.26.1.lve.1.el8.x86_64 #1 SMP Fri Sep 16 14:08:19 EDT 2022 x86_64 User : carpe ( 1178) PHP Version : 8.0.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /opt/alt/ruby19/lib64/ruby/gems/1.9.1/gems/rack-1.6.4/test/rackup/ |
Upload File : |
require "#{File.dirname(__FILE__)}/../testrequest"
$stderr = File.open("#{File.dirname(__FILE__)}/log_output", "w")
class EnvMiddleware
def initialize(app)
@app = app
end
def call(env)
# provides a way to test that lint is present
if env["PATH_INFO"] == "/broken_lint"
return [200, {}, ["Broken Lint"]]
# provides a way to kill the process without knowing the pid
elsif env["PATH_INFO"] == "/die"
exit!
end
env["test.$DEBUG"] = $DEBUG
env["test.$EVAL"] = BUKKIT if defined?(BUKKIT)
env["test.$VERBOSE"] = $VERBOSE
env["test.$LOAD_PATH"] = $LOAD_PATH
env["test.stderr"] = File.expand_path($stderr.path)
env["test.Ping"] = defined?(Ping)
env["test.pid"] = Process.pid
@app.call(env)
end
end
use EnvMiddleware
run TestRequest.new