From 68b69178f4b58abfb85495e93f7e05df247d7a1f Mon Sep 17 00:00:00 2001 From: hsbt Date: Tue, 15 Dec 2015 02:56:38 +0000 Subject: * lib/uri/common.rb: make code block for rdoc. [ci skip][fix GH-1152] Patch by @Tonkpils git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ lib/uri/common.rb | 12 ++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 07565f4496..38b9eedd31 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Dec 15 11:56:24 2015 SHIBATA Hiroshi + + * lib/uri/common.rb: make code block for rdoc. + [ci skip][fix GH-1152] Patch by @Tonkpils + Tue Dec 15 11:55:08 2015 SHIBATA Hiroshi * ext/zlib/zlib.c: fix a typo. diff --git a/lib/uri/common.rb b/lib/uri/common.rb index 1444ae84b0..28b5c99789 100644 --- a/lib/uri/common.rb +++ b/lib/uri/common.rb @@ -438,12 +438,12 @@ module URI # This refers http://url.spec.whatwg.org/#concept-urlencoded-parser , # so this supports only &-separator, don't support ;-separator. # - # ary = URI.decode_www_form("a=1&a=2&b=3") - # p ary #=> [['a', '1'], ['a', '2'], ['b', '3']] - # p ary.assoc('a').last #=> '1' - # p ary.assoc('b').last #=> '3' - # p ary.rassoc('a').last #=> '2' - # p Hash[ary] # => {"a"=>"2", "b"=>"3"} + # ary = URI.decode_www_form("a=1&a=2&b=3") + # p ary #=> [['a', '1'], ['a', '2'], ['b', '3']] + # p ary.assoc('a').last #=> '1' + # p ary.assoc('b').last #=> '3' + # p ary.rassoc('a').last #=> '2' + # p Hash[ary] # => {"a"=>"2", "b"=>"3"} # # See URI.decode_www_form_component, URI.encode_www_form def self.decode_www_form(str, enc=Encoding::UTF_8, separator: '&', use__charset_: false, isindex: false) -- cgit v1.2.3