#!/usr/local/bin/ruby -Ks
#require 'reqnora'
require 'web/common'
require 'web/interface'
require 'web/cookie'
require 'web/response'
def noratest(req,rsp)
rsp.content_type = 'text/html; charset=Shift_JIS'
rsp.write <<-EOS
Nora Test
Nora Test
EOS
# attr
rsp << ""
rsp << "method | #{Web::escapeHTML(req.method)} |
"
rsp << "query_string | #{Web::escapeHTML(req.query_string)} |
"
rsp << "script_name | #{Web::escapeHTML(req.script_name)} |
"
rsp << "path_info | #{Web::escapeHTML(req.path_info)} |
"
rsp << "host | #{Web::escapeHTML(req.host.to_s)} |
"
rsp << "remote_addr | #{Web::escapeHTML(req.remote_addr.to_s)} |
"
rsp << "remote_host | #{Web::escapeHTML(req.remote_host.to_s)} |
"
rsp << "remote_ident | #{Web::escapeHTML(req.remote_ident || '')} |
"
rsp << "remote_user | #{Web::escapeHTML(req.remote_user || '')} |
"
rsp << "
"
# query
rsp << "query
"
rsp << ""
req.query.each {|key,value|
rsp << "#{Web::escapeHTML(key)} | #{Web::escapeHTML(value.inspect)} |
"
}
rsp << "
"
# form
rsp << "form
"
rsp << ""
req.form.each {|key,value|
rsp << "#{Web::escapeHTML(key)} | #{Web::escapeHTML(value.inspect)} |
"
}
rsp << "
"
rsp << "Web::Request
"
rsp << "" << Web::escapeHTML(req.inspect) << "
"
rsp.write <<-EOS
EOS
rsp
end
api = Web::Interface::AUTO.new
api.each {|req|
rsp = Web::Response.new
rsp = noratest(req,rsp)
api.response req, rsp
}