1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
zzak 2012-11-30 05:06:45 +00:00
parent 088b04e8a4
commit 90d43225eb
2 changed files with 23 additions and 14 deletions

View file

@ -1,3 +1,8 @@
Fri Nov 30 14:05:00 2012 Zachary Scott <zachary@zacharyscott.net>
* 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 <zachary@zacharyscott.net> Fri Nov 30 13:52:00 2012 Zachary Scott <zachary@zacharyscott.net>
* time.c: Documentation improvements, grammar and formatting * time.c: Documentation improvements, grammar and formatting

View file

@ -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 ($>) # === Print http header and html string to $DEFAULT_OUTPUT ($>)
# #
# require "cgi" # require "cgi"
# cgi = CGI.new("html3") # add HTML generation methods # cgi = CGI.new("html4") # add HTML generation methods
# cgi.out() do # cgi.out do
# cgi.html() do # cgi.html do
# cgi.head{ cgi.title{"TITLE"} } + # cgi.head do
# cgi.body() do # cgi.title { "TITLE" }
# cgi.form() do # end +
# cgi.textarea("get_text") + # cgi.body do
# cgi.br + # cgi.form("ACTION" => "uri") do
# cgi.submit # cgi.p do
# cgi.textarea("get_text") +
# cgi.br +
# cgi.submit
# end
# end + # end +
# cgi.pre() do # cgi.pre do
# CGI::escapeHTML( # CGI::escapeHTML(
# "params: " + cgi.params.inspect + "\n" + # "params: #{cgi.params.inspect}\n" +
# "cookies: " + cgi.cookies.inspect + "\n" + # "cookies: #{cgi.cookies.inspect}\n" +
# ENV.collect() do |key, value| # ENV.collect do |key, value|
# key + " --> " + value + "\n" # "#{key} --> #{value}\n"
# end.join("") # end.join("")
# ) # )
# end # end