Lovely RDOC patches from mathew (metaATpoboxDOTcom) on URI/* and getoptlong.rb
But in fact, it includes code, which changed the spec and
even caused the regression actually.
I believe that this is accident. I don't know who mathew
is and how he sent the patch to Ryan. But Ryan, please be
careful to check a patch written by others when you import.
@@ -185,6 +181,11 @@ module URI
return @path.sub(/^//,'').sub(/^%2F/,'/')
end
def set_path(v)
super("/" + v.sub(/^\//, "%2F"))
end
protected :set_path
def to_s
save_path = nil
if @typecode
diff --git a/lib/uri/generic.rb b/lib/uri/generic.rb
index 14ca973..4fdfd14 100644
--- a/lib/uri/generic.rb
+++ b/lib/uri/generic.rb
@@ -482,7 +482,9 @@ module URI
"path conflicts with opaque"
end
if @scheme
# If scheme is ftp, path may be relative.
# See RFC 1738 section 3.2.2, and RFC 2396.
if @scheme && @scheme != "ftp"
if v && v != '' && parser.regexp[:ABS_PATH] !~ v
raise InvalidComponentError,
"bad component(expected absolute path component): #{v}"
=begin
This issue was solved with changeset r27350.
Norihisa, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.