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
This commit is contained in:
parent
91511afa9c
commit
b8be8d535a
10
ChangeLog
10
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>
|
Wed Jun 12 02:38:00 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
||||||
|
|
||||||
* parse.y (stmt): fix typo.
|
* parse.y (stmt): fix typo.
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
=end
|
=end
|
||||||
|
|
||||||
module URI
|
module URI
|
||||||
VERSION_CODE = '000906'.freeze
|
VERSION_CODE = '000907'.freeze
|
||||||
VERSION = VERSION_CODE.scan(/../).collect{|n| n.to_i}.join('.').freeze
|
VERSION = VERSION_CODE.scan(/../).collect{|n| n.to_i}.join('.').freeze
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -145,14 +145,14 @@ module URI
|
|||||||
X_ABS_URI = "
|
X_ABS_URI = "
|
||||||
(#{PATTERN::SCHEME}): (?# 1: scheme)
|
(#{PATTERN::SCHEME}): (?# 1: scheme)
|
||||||
(?:
|
(?:
|
||||||
(?:
|
(?:(?:
|
||||||
//(?:
|
//(?:
|
||||||
(?:(?:(#{PATTERN::USERINFO})@)? (?# 2: userinfo)
|
(?:(?:(#{PATTERN::USERINFO})@)? (?# 2: userinfo)
|
||||||
(?:(#{PATTERN::HOST})(?::(\\d*))?))?(?# 3: host, 4: port)
|
(?:(#{PATTERN::HOST})(?::(\\d*))?))?(?# 3: host, 4: port)
|
||||||
|
|
|
|
||||||
(#{PATTERN::REG_NAME}) (?# 5: registry)
|
(#{PATTERN::REG_NAME}) (?# 5: registry)
|
||||||
)
|
))?
|
||||||
(#{PATTERN::ABS_PATH})? (?# 6: path)
|
((?!//)#{PATTERN::ABS_PATH})? (?# 6: path)
|
||||||
)(?:\\?(#{PATTERN::QUERY}))? (?# 7: query)
|
)(?:\\?(#{PATTERN::QUERY}))? (?# 7: query)
|
||||||
|
|
|
|
||||||
(#{PATTERN::OPAQUE_PART}) (?# 8: opaque)
|
(#{PATTERN::OPAQUE_PART}) (?# 8: opaque)
|
||||||
@ -231,7 +231,7 @@ module URI
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
raise ArgumentError,
|
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
|
end
|
||||||
tmp[:scheme] = klass.to_s.sub(/\A.*::/, '').downcase
|
tmp[:scheme] = klass.to_s.sub(/\A.*::/, '').downcase
|
||||||
|
|
||||||
|
@ -121,7 +121,7 @@ Object
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
raise ArgumentError,
|
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
|
end
|
||||||
|
|
||||||
tmp << true
|
tmp << true
|
||||||
@ -296,9 +296,12 @@ Object
|
|||||||
end
|
end
|
||||||
private :check_password
|
private :check_password
|
||||||
|
|
||||||
def userinfo=(user, password = nil)
|
def userinfo=(userinfo)
|
||||||
check_userinfo(user, password)
|
if userinfo.nil?
|
||||||
set_userinfo(user, password)
|
return nil
|
||||||
|
end
|
||||||
|
check_userinfo(*userinfo)
|
||||||
|
set_userinfo(*userinfo)
|
||||||
end
|
end
|
||||||
|
|
||||||
def user=(user)
|
def user=(user)
|
||||||
@ -312,21 +315,25 @@ Object
|
|||||||
end
|
end
|
||||||
|
|
||||||
def set_userinfo(user, password = nil)
|
def set_userinfo(user, password = nil)
|
||||||
if !password
|
unless password
|
||||||
user, password = split_userinfo(user)
|
user, password = split_userinfo(user)
|
||||||
end
|
end
|
||||||
@user = user
|
@user = user
|
||||||
@password = password
|
@password = password if password
|
||||||
|
|
||||||
|
[@user, @password]
|
||||||
end
|
end
|
||||||
protected :set_userinfo
|
protected :set_userinfo
|
||||||
|
|
||||||
def set_user(v)
|
def set_user(v)
|
||||||
set_userinfo(v, @password)
|
set_userinfo(v, @password)
|
||||||
|
v
|
||||||
end
|
end
|
||||||
protected :set_user
|
protected :set_user
|
||||||
|
|
||||||
def set_password(v)
|
def set_password(v)
|
||||||
set_userinfo(@user, v)
|
set_userinfo(@user, v)
|
||||||
|
v
|
||||||
end
|
end
|
||||||
protected :set_password
|
protected :set_password
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user