diff options
author | xibbar <xibbar@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-04 11:48:05 +0000 |
---|---|---|
committer | xibbar <xibbar@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-04 11:48:05 +0000 |
commit | 6837f3dc54ac4afd89c185e520c250ef2eb42c4e (patch) | |
tree | 06680b80e18091c209238498f0f735c33ca41a1b /lib/cgi/core.rb | |
parent | 2142287c8696f5c8b1ca8e68c557ff61ab921f8e (diff) |
Sun Nov 4 20:41:28 2012 Takeyuki FUJIOKA <[email protected]>
* lib/cgi.rb, lib/cgi/*/rb: rename CGI#header to
CGI#http_header,
add and update HTML5 tag generater. [Bug #7110]
Patch provided by Marcus Stollsteimer, thank you !
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/cgi/core.rb')
-rw-r--r-- | lib/cgi/core.rb | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/lib/cgi/core.rb b/lib/cgi/core.rb index f1e8d3467a..63ab3c81d6 100644 --- a/lib/cgi/core.rb +++ b/lib/cgi/core.rb @@ -67,8 +67,8 @@ class CGI # Create an HTTP header block as a string. # # :call-seq: - # header(content_type_string="text/html") - # header(headers_hash) + # http_header(content_type_string="text/html") + # http_header(headers_hash) # # Includes the empty line that ends the header block. # @@ -127,29 +127,29 @@ class CGI # # Examples: # - # header + # http_header # # Content-Type: text/html # - # header("text/plain") + # http_header("text/plain") # # Content-Type: text/plain # - # header("nph" => true, - # "status" => "OK", # == "200 OK" - # # "status" => "200 GOOD", - # "server" => ENV['SERVER_SOFTWARE'], - # "connection" => "close", - # "type" => "text/html", - # "charset" => "iso-2022-jp", - # # Content-Type: text/html; charset=iso-2022-jp - # "length" => 103, - # "language" => "ja", - # "expires" => Time.now + 30, - # "cookie" => [cookie1, cookie2], - # "my_header1" => "my_value" - # "my_header2" => "my_value") + # http_header("nph" => true, + # "status" => "OK", # == "200 OK" + # # "status" => "200 GOOD", + # "server" => ENV['SERVER_SOFTWARE'], + # "connection" => "close", + # "type" => "text/html", + # "charset" => "iso-2022-jp", + # # Content-Type: text/html; charset=iso-2022-jp + # "length" => 103, + # "language" => "ja", + # "expires" => Time.now + 30, + # "cookie" => [cookie1, cookie2], + # "my_header1" => "my_value" + # "my_header2" => "my_value") # # This method does not perform charset conversion. - def header(options='text/html') + def http_header(options='text/html') if options.is_a?(String) content_type = options buf = _header_for_string(content_type) @@ -170,7 +170,7 @@ class CGI buf << EOL # empty line of separator return buf end - end # header() + end # http_header() def _header_for_string(content_type) #:nodoc: buf = '' @@ -283,7 +283,7 @@ class CGI # +content_type_string+:: # If a string is passed, it is assumed to be the content type. # +headers_hash+:: - # This is a Hash of headers, similar to that used by #header. + # This is a Hash of headers, similar to that used by #http_header. # +block+:: # A block is required and should evaluate to the body of the response. # @@ -344,7 +344,7 @@ class CGI options["length"] = content.bytesize.to_s output = stdoutput output.binmode if defined? output.binmode - output.print header(options) + output.print http_header(options) output.print content unless "HEAD" == env_table['REQUEST_METHOD'] end |