aboutsummaryrefslogtreecommitdiffstats
path: root/lib/cgi.rb
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-26 02:42:27 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-26 02:42:27 +0000
commitae86df99f73c16a54f74358538eb8c630d930733 (patch)
tree11a644a81290528ac57bc397a46b637d260ac884 /lib/cgi.rb
parent3c66a5b25eeee2a0b1b7768e3155048339ff5be8 (diff)
downloadruby-ae86df99f73c16a54f74358538eb8c630d930733.tar.gz
* lib/cgi.rb (nOE_element_def): fix error when cascade methods which
don't have arguments. Patch by Takeyuki Fujioka. [ruby-dev:35964] * lib/cgi.rb (blockquote): String#collect (this depends on String#each) is no longer exists. Patch by Takeyuki Fujioka. [ruby-dev:35946] * lib/cgi.rb (blockquote): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/cgi.rb')
-rw-r--r--lib/cgi.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/cgi.rb b/lib/cgi.rb
index 52137d85ed..9900923ed8 100644
--- a/lib/cgi.rb
+++ b/lib/cgi.rb
@@ -1283,6 +1283,7 @@ class CGI
# - O EMPTY
def nOE_element_def(element, append = nil)
s = <<-END
+ attributes={attributes=>nil} if attributes.kind_of?(String)
"<#{element.upcase}" + attributes.collect{|name, value|
next unless value
" " + CGI::escapeHTML(name) +
@@ -1389,11 +1390,11 @@ class CGI
#
# blockquote("http://www.example.com/quotes/foo.html") { "Foo!" }
# #=> "<BLOCKQUOTE CITE=\"http://www.example.com/quotes/foo.html\">Foo!</BLOCKQUOTE>
- def blockquote(cite = nil) # :yield:
+ def blockquote(cite = {}) # :yield:
attributes = if cite.kind_of?(String)
{ "CITE" => cite }
else
- cite or ""
+ cite
end
if block_given?
super(attributes){ yield }
@@ -1413,11 +1414,11 @@ class CGI
#
# caption("left") { "Capital Cities" }
# # => <CAPTION ALIGN=\"left\">Capital Cities</CAPTION>
- def caption(align = nil) # :yield:
+ def caption(align = {}) # :yield:
attributes = if align.kind_of?(String)
{ "ALIGN" => align }
else
- align or ""
+ align
end
if block_given?
super(attributes){ yield }