diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-03-06 03:56:38 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-03-06 03:56:38 +0000 |
commit | 287a34ae0dfc23e4158f67cb7783d239f202c368 (patch) | |
tree | 5e35d5b41aae961b37cf6632f60c42f51c7aa775 /lib/uri/mailto.rb | |
parent | 9b52ae2e6491bb5d6c59e1799449f6268baf6f89 (diff) |
* {ext,lib,test}/**/*.rb: removed trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/uri/mailto.rb')
-rw-r--r-- | lib/uri/mailto.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/uri/mailto.rb b/lib/uri/mailto.rb index 38f972e1fb..4fab6e23a5 100644 --- a/lib/uri/mailto.rb +++ b/lib/uri/mailto.rb @@ -68,20 +68,20 @@ module URI # # If a Hash is used, the keys are the component names preceded by colons. # - # The headers can be supplied as a pre-encoded string, such as + # The headers can be supplied as a pre-encoded string, such as # "subject=subscribe&cc=address", or as an Array of Arrays like # [['subject', 'subscribe'], ['cc', 'address']] # # Examples: - # + # # require 'uri' - # + # # m1 = URI::MailTo.build(['joe@example.com', 'subject=Ruby']) # puts m1.to_s -> mailto:joe@example.com?subject=Ruby - # + # # m2 = URI::MailTo.build(['john@example.com', [['Subject', 'Ruby'], ['Cc', 'jack@example.com']]]) # puts m2.to_s -> mailto:john@example.com?Subject=Ruby&Cc=jack@example.com - # + # # m3 = URI::MailTo.build({:to => 'listman@example.com', :headers => [['subject', 'subscribe']]}) # puts m3.to_s -> mailto:listman@example.com?subject=subscribe # @@ -183,7 +183,7 @@ module URI return true unless v return true if v.size == 0 - if @parser.regexp[:OPAQUE] !~ v || + if @parser.regexp[:OPAQUE] !~ v || /\A(#{HEADER_PATTERN}(?:\&#{HEADER_PATTERN})*)\z/o !~ v raise InvalidComponentError, "bad component(expected opaque component): #{v}" @@ -210,12 +210,12 @@ module URI end def to_s - @scheme + ':' + - if @to + @scheme + ':' + + if @to @to else '' - end + + end + if @headers.size > 0 '?' + @headers.collect{|x| x.join('=')}.join('&') else @@ -227,7 +227,7 @@ module URI '' end end - + # Returns the RFC822 e-mail text equivalent of the URL, as a String. # # Example: |