Project

General

Profile

Bug #489

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

Added by xibbar (Takeyuki FUJIOKA) almost 10 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
[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!" }
# #=> "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" } # # => 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
test_cgi_tag_helper.diff (11.8 KB) test_cgi_tag_helper.diff xibbar (Takeyuki FUJIOKA), 08/26/2008 12:04 AM

History

#1 Updated by xibbar (Takeyuki FUJIOKA) almost 10 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

#2 Updated by xibbar (Takeyuki FUJIOKA) almost 10 years ago

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

#3 Updated by naruse (Yui NARUSE) almost 10 years ago

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

=begin
Applied in changeset r18860.
=end

Also available in: Atom PDF