From 90d43225ebb70db5aeb221b7d7191764058520d9 Mon Sep 17 00:00:00 2001 From: zzak Date: Fri, 30 Nov 2012 05:06:45 +0000 Subject: [PATCH] * lib/cgi.rb: CGI example for HTML generation Patch by Marcus Stollsteimer [ruby-core:50303] [Bug #7465] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38033 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ lib/cgi.rb | 32 ++++++++++++++++++-------------- 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index b135514ca6..527835a06d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Nov 30 14:05:00 2012 Zachary Scott + + * lib/cgi.rb: CGI example for HTML generation + Patch by Marcus Stollsteimer [ruby-core:50303] [Bug #7465] + Fri Nov 30 13:52:00 2012 Zachary Scott * time.c: Documentation improvements, grammar and formatting diff --git a/lib/cgi.rb b/lib/cgi.rb index 95baf04449..1c5ccd369f 100644 --- a/lib/cgi.rb +++ b/lib/cgi.rb @@ -234,22 +234,26 @@ raise "Please, use ruby 1.9.0 or later." if RUBY_VERSION < "1.9.0" # === Print http header and html string to $DEFAULT_OUTPUT ($>) # # require "cgi" -# cgi = CGI.new("html3") # add HTML generation methods -# cgi.out() do -# cgi.html() do -# cgi.head{ cgi.title{"TITLE"} } + -# cgi.body() do -# cgi.form() do -# cgi.textarea("get_text") + -# cgi.br + -# cgi.submit +# cgi = CGI.new("html4") # add HTML generation methods +# cgi.out do +# cgi.html do +# cgi.head do +# cgi.title { "TITLE" } +# end + +# cgi.body do +# cgi.form("ACTION" => "uri") do +# cgi.p do +# cgi.textarea("get_text") + +# cgi.br + +# cgi.submit +# end # end + -# cgi.pre() do +# cgi.pre do # CGI::escapeHTML( -# "params: " + cgi.params.inspect + "\n" + -# "cookies: " + cgi.cookies.inspect + "\n" + -# ENV.collect() do |key, value| -# key + " --> " + value + "\n" +# "params: #{cgi.params.inspect}\n" + +# "cookies: #{cgi.cookies.inspect}\n" + +# ENV.collect do |key, value| +# "#{key} --> #{value}\n" # end.join("") # ) # end