Project

General

Profile

Actions

Bug #489

closed

cgi.rbのCGI#blockquoteとCGI#captionがエラー

Added by xibbar (Takeyuki FUJIOKA) over 15 years ago. Updated almost 13 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
Backport:
[ruby-dev:35946]

Description

=begin
String#collectが使えなくなった影響で
2つのタグ生成メソッドがエラーになります。
html3、html4、html4trで全てチェックしましたが、
以上の2つだけでした。
Index: lib/cgi.rb

--- lib/cgi.rb (revision 18827)
+++ lib/cgi.rb (working copy)
@@ -1389,11 +1389,11 @@
#
# blockquote("http://www.example.com/quotes/foo.html") { "Foo!" }
# #=> "<BLOCKQUOTE CITE="http://www.example.com/quotes/foo.html\">Foo!

  • 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 +1413,11 @@
#
# caption("left") { "Capital Cities" }
# # => <CAPTION ALIGN="left">Capital Cities

  • 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 }
    

=end


Files

test_cgi_tag_helper.diff (11.8 KB) test_cgi_tag_helper.diff xibbar (Takeyuki FUJIOKA), 08/26/2008 12:04 AM
Actions #1

Updated by xibbar (Takeyuki FUJIOKA) over 15 years ago

=begin
引数を取らないタグ生成メソッド(CGI#ttなど)をCGI.new("html3").tt("foo")などとやるとエラーになるので
パッチを追加します。
Index: lib/cgi.rb

--- lib/cgi.rb (revision 18827)
+++ lib/cgi.rb (working copy)
@@ -1283,6 +1283,7 @@
# - 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) +
    

=end

Actions #2

Updated by xibbar (Takeyuki FUJIOKA) over 15 years ago

=begin
html3の分だけテストを書きましたのでdiffの形式で添付します。
=end

Actions #3

Updated by naruse (Yui NARUSE) over 15 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
Applied in changeset r18860.
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0