summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorakira <akira@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-06-12 09:32:35 +0000
committerakira <akira@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-06-12 09:32:35 +0000
commitb8be8d535a32c9f0ab54482cbf09fdcd9e0abee8 (patch)
treeee784974f824eff9dcc5045196829e58b3a07b43
parent91511afa9ca2b4ebaa751bc1f53e89faab6b3701 (diff)
merged differences between uri-0.9.6 and uri-0.9.7
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2560 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog10
-rw-r--r--lib/uri.rb2
-rw-r--r--lib/uri/common.rb8
-rw-r--r--lib/uri/generic.rb19
4 files changed, 28 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index f701737..d2f8499 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+Wed Jun 12 18:04:44 2002 akira yamada <akira@arika.org>
+
+ * uri/common.rb (REGEXP::PATTERN::X_ABS_URI): 'file:/foo' is valid.
+
+ * uri/generic.rb (Generic#xxx=): should return substituted value.
+ (ruby-dev:16728.)
+
+ * test/generic.rb (test_set_component): added tests for the above
+ change.
+
Wed Jun 12 02:38:00 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
* parse.y (stmt): fix typo.
diff --git a/lib/uri.rb b/lib/uri.rb
index d33f0c8..beb1443 100644
--- a/lib/uri.rb
+++ b/lib/uri.rb
@@ -15,7 +15,7 @@
=end
module URI
- VERSION_CODE = '000906'.freeze
+ VERSION_CODE = '000907'.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 6f2fa81..ea7d3c8 100644
--- a/lib/uri/common.rb
+++ b/lib/uri/common.rb
@@ -145,14 +145,14 @@ module URI
X_ABS_URI = "
(#{PATTERN::SCHEME}): (?# 1: scheme)
(?:
- (?:
+ (?:(?:
//(?:
(?:(?:(#{PATTERN::USERINFO})@)? (?# 2: userinfo)
(?:(#{PATTERN::HOST})(?::(\\d*))?))?(?# 3: host, 4: port)
|
(#{PATTERN::REG_NAME}) (?# 5: registry)
- )
- (#{PATTERN::ABS_PATH})? (?# 6: path)
+ ))?
+ ((?!//)#{PATTERN::ABS_PATH})? (?# 6: path)
)(?:\\?(#{PATTERN::QUERY}))? (?# 7: query)
|
(#{PATTERN::OPAQUE_PART}) (?# 8: opaque)
@@ -231,7 +231,7 @@ module URI
end
else
raise ArgumentError,
- "expected Array of or Hash of compornents of #{klass.to_s} (#{klass.component[1..-1].join(', ')})"
+ "expected Array of or Hash of components of #{klass.to_s} (#{klass.component[1..-1].join(', ')})"
end
tmp[:scheme] = klass.to_s.sub(/\A.*::/, '').downcase
diff --git a/lib/uri/generic.rb b/lib/uri/generic.rb
index e80c6f7..775a001 100644
--- a/lib/uri/generic.rb
+++ b/lib/uri/generic.rb
@@ -121,7 +121,7 @@ Object
end
else
raise ArgumentError,
- "expected Array of or Hash of compornents of #{self.type} (#{self.type.component.join(', ')})"
+ "expected Array of or Hash of components of #{self.type} (#{self.type.component.join(', ')})"
end
tmp << true
@@ -296,9 +296,12 @@ Object
end
private :check_password
- def userinfo=(user, password = nil)
- check_userinfo(user, password)
- set_userinfo(user, password)
+ def userinfo=(userinfo)
+ if userinfo.nil?
+ return nil
+ end
+ check_userinfo(*userinfo)
+ set_userinfo(*userinfo)
end
def user=(user)
@@ -312,21 +315,25 @@ Object
end
def set_userinfo(user, password = nil)
- if !password
+ unless password
user, password = split_userinfo(user)
end
@user = user
- @password = password
+ @password = password if password
+
+ [@user, @password]
end
protected :set_userinfo
def set_user(v)
set_userinfo(v, @password)
+ v
end
protected :set_user
def set_password(v)
set_userinfo(@user, v)
+ v
end
protected :set_password