aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorakira <akira@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-02-07 04:51:11 +0000
committerakira <akira@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-02-07 04:51:11 +0000
commit91a3db0afc159e855312c4cd5c79fe925c65fd10 (patch)
treeded8203e542682aa90764b183c16fd7401e17be7 /lib
parent90991d9889a7b95d85c13bdea3eb246d27e466ac (diff)
downloadruby-91a3db0afc159e855312c4cd5c79fe925c65fd10.tar.gz
uri-0.9.5
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/uri.rb2
-rw-r--r--lib/uri/common.rb13
-rw-r--r--lib/uri/generic.rb6
3 files changed, 17 insertions, 4 deletions
diff --git a/lib/uri.rb b/lib/uri.rb
index aa750aa8d9..1832fb8d5d 100644
--- a/lib/uri.rb
+++ b/lib/uri.rb
@@ -15,7 +15,7 @@
=end
module URI
- VERSION_CODE = '000904'.freeze
+ VERSION_CODE = '000905'.freeze
VERSION = VERSION_CODE.scan(/../).collect{|n| n.to_i}.join('.').freeze
end
diff --git a/lib/uri/common.rb b/lib/uri/common.rb
index ed2f6a7a5b..6f2fa81ad2 100644
--- a/lib/uri/common.rb
+++ b/lib/uri/common.rb
@@ -378,6 +378,19 @@ module URI
=begin
+--- URI::join(str[, str, ...])
+
+=end
+ def self.join(*str)
+ u = self.parse(str[0])
+ str[1 .. -1].each do |x|
+ u = u.merge(x)
+ end
+ u
+ end
+
+=begin
+
--- URI::extract(str[, schemes])
=end
diff --git a/lib/uri/generic.rb b/lib/uri/generic.rb
index 4d3ab67b7e..1510e53eeb 100644
--- a/lib/uri/generic.rb
+++ b/lib/uri/generic.rb
@@ -494,7 +494,7 @@ Object
else
if v && v != '' && ABS_PATH !~ v && REL_PATH !~ v
raise InvalidComponentError,
- "bad component(expected relative path component): #{@path}"
+ "bad component(expected relative path component): #{v}"
end
end
@@ -688,7 +688,7 @@ Object
end
# RFC2396, Section 5.2, 6), a)
- base_path.pop if !base_path.last.empty?
+ base_path.pop unless base_path.size == 1
# RFC2396, Section 5.2, 6), c)
# RFC2396, Section 5.2, 6), d)
@@ -719,7 +719,7 @@ Object
# valid absolute path
# end
base_path << x
- base_path += tmp
+ tmp.each {|t| base_path << t}
add_trailer_slash = false
break
end