URI::Parser

URIe$B%b%8%e!<%k$K<j$r2C$($Fe(B
[email protected]$1$I<B:]$K;H$o$l$F$7$^$C$F$$$ke(BURI
e$B$r<u$1F~$l$i$l$k$h$&$K$7$F$_$^$7$?!#e(B

e$B2a5n$K2?EY$+e(B<>e$B$H$+e(B_e$B$H$+$,F~$C$F$$$k$He(B
e$BNc30$K$J$k$H$$$&Js9p$r<u$1$F$$$F!"e(B
e$B$=$l$KBP1~$7$h$&$H$7$?$b$N$G$9!#e(B

URIe$B%b%8%e!<%k$G$O=>Mh$+$ie(BRegexpe$B$r;H$C$F$$$^$9$,e(B
e$B$=$Ne(BRegexpe$B$N0lIt$r;XDj$7$?%Q%?!<%[email protected]@.$G$-$k$h$&$K$7$?e(B
e$B$H$$$&46$8$NJQ99$G$9!#e(B

e$B$3$s$J46$8$G;H$$$^$9e(B:

p = URI::Parser.new(:ESCAPED=>"(?:%[a-fA-F0-9]{2}|%u[a-fA-F0-9]{4})")
=> #URI::Parser:0xb7872640

u = p.parse(“http://foo.bar.baz/%uABCD”)
=> #<URI::HTTP:0xb78cf4f8 URL:http://foo.bar.baz/%uABCD>

URI.parse(u.to_s)
URI::InvalidURIError: bad URI(is not URI?): http://foo.bar.baz/%uABCD
from /…/lib/uri/common.rb:126:in split' from /.../lib/uri/common.rb:144:inparse’
from /…/lib/uri/common.rb:592:in parse' from (irb):3 from /usr/bin/irb1.9:12:in

s = “http://foo.bar.baz/ABCD
=> “http://foo.bar.baz/ABCD

u1 = p.parse(s)
=> #<URI::HTTP:0xb78c3220 URL:http://foo.bar.baz/ABCD>

u2 = URI.parse(s)
=> #<URI::HTTP:0xb78b6d54 URL:http://foo.bar.baz/ABCD>

u1 == u2
=> true

u1.eql?(u2)
=> false

e$B?7$7$$%3!<%I$re(Bhttp://arika.org/tmp/ruby1.9-new-uri.tar.gze$B$K$*$$$F$$$^$9!#e(B
e$B$[$H$s$I$O%3!<%I$r0\[email protected]$1$G!"=>Mh$N%F%9%H$bDL$k$3$H$r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-$^$7$?e(B:

KURODA Hiraku e$B$5$s$O=q$-$^$7$?e(B:

e$B8=:$Ne(BURIe$B%i%$%V%i%j$Oe(BRFCe$B$KCi<B$G$"$k8N$Ke(B’'e$B$r4^$%[%9%HL>$r4^$e(BURIe$B$r=hM}e(B
e$B$7$h$&$H$9$k$H%(%i!<$K$J$j$^$9!#e(B
open-urie$B$de(Bmechanizee$B$,$3$Ne(BURIe$B%i%$%V%i%j$rMxMQ$7$F$$$k$?$a!“e(BURIe$B$K$OLdBj$,e(B
e$B$”$k$1$I<B:]$KB8:_$7$F$$$k%Z!<%8$r$3$l$i$N%i%$%V%i%j$G=hM}$G$-$^$;$s!#e(B

e$B<j85$G$OD64J0W$Je(Bopen-urie$B$NBeBX%a%=%C%I$d!"e(BMechanizee$B$K$D$$$F$Oe(B lax-uri()
e$B$J$k$b$N$r$G$C$A>e$2$FBP1~$7$F$$$k$H$3$m$G$9$,!"$d$O$jK\2H$NJ}$GBP1~$7$Fe(B
e$B$b$i$($l$P4r$7$$$G$9!#e(B
(
): http://www.hinet.mydns.jp/tdiary/?date=20080906#p01

e$BFC$KH?BP$O$J$5$=$&[email protected]$J$H$$$&$N$He(B1.9.1e$B$K4V$K9g$o$;$?$$$N$H$Ge(B
e$B$A$g$&$I0l:rF|$+$i:rF|$K$+$1$Fe(Bcommite$B$7$h$&$H$7$F$$$?$N$G$9$,e(B
e$B>/$7CY$l$F$5$C$-e(Bcommite$B$7$^$7$?!#e(B

e$B2?$+LdBj$,$"$j$^$7$?$i$*CN$i$;$/[email protected]$5$$!#e(B

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs