Project

General

Profile

Actions

Bug #5840

closed

URI::MailTo.build - 2 of 3 examples fail on 1.9.2/1.93

Added by primerano (Tony Primerano) almost 13 years ago. Updated almost 13 years ago.

Status:
Closed
Assignee:
-
Target version:
ruby -v:
ruby 1.9.3dev (2011-07-31 revision 32789) [x86_64-darwin11.1.0]
Backport:
[ruby-core:<unknown>]

Description

The array examples of URI::MailTo.build in the documentation fail on 1.9
http://www.ruby-doc.org/stdlib-1.9.3/libdoc/uri/rdoc/URI/MailTo.html

ex

ruby-1.9.3-preview1 :003 > m2 = URI::MailTo.build(['', [['Subject', 'Ruby'], ['Cc', '']]])
URI::InvalidComponentError: bad component(expected opaque component): ?Subject=["Ruby"]&Cc=[""]
from /Users/primerano/Developer/.rvm/rubies/ruby-1.9.3-preview1/lib/ruby/1.9.1/uri/generic.rb:957:in check_opaque' from /Users/primerano/Developer/.rvm/rubies/ruby-1.9.3-preview1/lib/ruby/1.9.1/uri/generic.rb:988:in opaque='
from /Users/primerano/Developer/.rvm/rubies/ruby-1.9.3-preview1/lib/ruby/1.9.1/uri/generic.rb:198:in initialize' from /Users/primerano/Developer/.rvm/rubies/ruby-1.9.3-preview1/lib/ruby/1.9.1/uri/mailto.rb:135:in initialize'
from /Users/primerano/Developer/.rvm/rubies/ruby-1.9.3-preview1/lib/ruby/1.9.1/uri/generic.rb:140:in new' from /Users/primerano/Developer/.rvm/rubies/ruby-1.9.3-preview1/lib/ruby/1.9.1/uri/generic.rb:140:in build'
from /Users/primerano/Developer/.rvm/rubies/ruby-1.9.3-preview1/lib/ruby/1.9.1/uri/mailto.rb:122:in build' from (irb):3 from /Users/primerano/Developer/.rvm/rubies/ruby-1.9.3-preview1/bin/irb:16:in '

ruby-1.9.3-preview1 :004 > m3 = URI::MailTo.build({:to => '', :headers => [['subject', 'subscribe']]})
URI::InvalidComponentError: bad component(expected opaque component): ?subject=["subscribe"]
from /Users/primerano/Developer/.rvm/rubies/ruby-1.9.3-preview1/lib/ruby/1.9.1/uri/generic.rb:957:in check_opaque' from /Users/primerano/Developer/.rvm/rubies/ruby-1.9.3-preview1/lib/ruby/1.9.1/uri/generic.rb:988:in opaque='
from /Users/primerano/Developer/.rvm/rubies/ruby-1.9.3-preview1/lib/ruby/1.9.1/uri/generic.rb:198:in initialize' from /Users/primerano/Developer/.rvm/rubies/ruby-1.9.3-preview1/lib/ruby/1.9.1/uri/mailto.rb:135:in initialize'
from /Users/primerano/Developer/.rvm/rubies/ruby-1.9.3-preview1/lib/ruby/1.9.1/uri/generic.rb:140:in new' from /Users/primerano/Developer/.rvm/rubies/ruby-1.9.3-preview1/lib/ruby/1.9.1/uri/generic.rb:140:in build'
from /Users/primerano/Developer/.rvm/rubies/ruby-1.9.3-preview1/lib/ruby/1.9.1/uri/mailto.rb:122:in build' from (irb):4 from /Users/primerano/Developer/.rvm/rubies/ruby-1.9.3-preview1/bin/irb:16:in '

1st example works fine.
ruby-1.9.3-preview1 :005 > m1 = URI::MailTo.build(['', 'subject=Ruby'])
=> #<URI::MailTo:0x007fb75a025918 URL:?subject=Ruby>

Actions

Also available in: Atom PDF

Like0
Like0Like0