ruby-changes:22311
From: naruse <ko1@a...>
Date: Mon, 23 Jan 2012 17:13:13 +0900 (JST)
Subject: [ruby-changes:22311] naruse:r34360 (trunk): * lib/uri/mailto.rb (URI::MailTo.build): follow Array#to_s change of
naruse 2012-01-23 17:12:52 +0900 (Mon, 23 Jan 2012) New Revision: 34360 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=34360 Log: * lib/uri/mailto.rb (URI::MailTo.build): follow Array#to_s change of Ruby 1.9; use Array#join. [Bug #5840] Modified files: trunk/ChangeLog trunk/lib/uri/mailto.rb trunk/test/uri/test_mailto.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 34359) +++ ChangeLog (revision 34360) @@ -1,3 +1,8 @@ +Mon Jan 23 17:06:17 2012 NARUSE, Yui <naruse@r...> + + * lib/uri/mailto.rb (URI::MailTo.build): follow Array#to_s change of + Ruby 1.9; use Array#join. [Bug #5840] + Mon Jan 23 16:42:28 2012 NARUSE, Yui <naruse@r...> * io.c (extract_binmode): raise an exception if binmode/textmode Index: lib/uri/mailto.rb =================================================================== --- lib/uri/mailto.rb (revision 34359) +++ lib/uri/mailto.rb (revision 34360) @@ -103,7 +103,7 @@ if tmp[:headers].kind_of?(Array) tmp[:opaque] << tmp[:headers].collect { |x| if x.kind_of?(Array) - x[0] + '=' + x[1..-1].to_s + x[0] + '=' + x[1..-1].join else x.to_s end Index: test/uri/test_mailto.rb =================================================================== --- test/uri/test_mailto.rb (revision 34359) +++ test/uri/test_mailto.rb (revision 34360) @@ -82,6 +82,16 @@ ok[-1] << {:to => "unlikely%3Faddress@e...", :headers => ["blat=foop"]} + # mailto:john@e...?Subject=Ruby&Cc=jack@e... + ok << ["mailto:john@e...?Subject=Ruby&Cc=jack@e..."] + ok[-1] << ['john@e...', [['Subject', 'Ruby'], ['Cc', 'jack@e...']]] + ok[-1] << {:to=>"john@e...", :headers=>[["Subject", "Ruby"], ["Cc", "jack@e..."]]} + + # mailto:listman@e...?subject=subscribe + ok << ["mailto:listman@e...?subject=subscribe"] + ok[-1] << {:to => 'listman@e...', :headers => [['subject', 'subscribe']]} + ok[-1] << {:to => 'listman@e...', :headers => [['subject', 'subscribe']]} + ok_all = ok.flatten.join("\0") # mailto:joe@e...?cc=bob@e...?body=hello ; WRONG! -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/