From 9ff1e787f915539b1980654e3d3d2013ff5c81d2 Mon Sep 17 00:00:00 2001 From: shyouhei Date: Mon, 7 Jul 2008 07:38:25 +0000 Subject: wrong commit; sorry git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/v1_8_6_269@17938 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ruby_1_8_6/sample/webrick/demo-app.rb | 66 ----------------------------------- 1 file changed, 66 deletions(-) delete mode 100644 ruby_1_8_6/sample/webrick/demo-app.rb (limited to 'ruby_1_8_6/sample/webrick/demo-app.rb') diff --git a/ruby_1_8_6/sample/webrick/demo-app.rb b/ruby_1_8_6/sample/webrick/demo-app.rb deleted file mode 100644 index c7a2a0a6a4..0000000000 --- a/ruby_1_8_6/sample/webrick/demo-app.rb +++ /dev/null @@ -1,66 +0,0 @@ -require "pp" - -module DemoApplication - def initialize(config, enctype) - super - @enctype = enctype - end - - def do_GET(req, res) - if req.path_info != "/" - res.set_redirect(WEBrick::HTTPStatus::Found, req.script_name + "/") - end - res.body =<<-_end_of_html_ - -
- text:
- file:
- check: - a, - b, - c, -
- -
- - _end_of_html_ - res['content-type'] = 'text/html; charset=iso-8859-1' - end - - def do_POST(req, res) - if req["content-length"].to_i > 1024*10 - raise WEBrick::HTTPStatus::Forbidden, "file size too large" - end - res.body =<<-_end_of_html_ - -

Query Parameters

- #{display_query(req.query)} - return -

Request

-
#{WEBrick::HTMLUtils::escape(PP::pp(req, "", 80))}
-

Response

-
#{WEBrick::HTMLUtils::escape(PP::pp(res, "", 80))}
- - _end_of_html_ - res['content-type'] = 'text/html; charset=iso-8859-1' - end - - private - - def display_query(q) - ret = "" - q.each{|key, val| - ret << "

#{WEBrick::HTMLUtils::escape(key)}

" - ret << "" - ret << make_tr("val", val.inspect) - ret << make_tr("val.to_a", val.to_a.inspect) - ret << make_tr("val.to_ary", val.to_ary.inspect) - ret << "
" - } - ret - end - - def make_tr(arg0, arg1) - "#{arg0}#{WEBrick::HTMLUtils::escape(arg1)}" - end -end -- cgit v1.2.3