From c56dab2ceb3cfc53595ae65a3ca164e445191a3b Mon Sep 17 00:00:00 2001 From: naruse Date: Sun, 22 Jun 2014 00:21:57 +0000 Subject: fix that arg_check didn't work * lib/uri/ftp.rb (initialize): arg[-1] was fragment, but it must be arg_check. * lib/uri/ftp.rb (initialize): explicitly specify arguments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46489 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/uri/ftp.rb | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'lib') diff --git a/lib/uri/ftp.rb b/lib/uri/ftp.rb index 0c5b13a1b7..557e1fda33 100644 --- a/lib/uri/ftp.rb +++ b/lib/uri/ftp.rb @@ -129,17 +129,24 @@ module URI # Arguments are +scheme+, +userinfo+, +host+, +port+, +registry+, +path+, # +opaque+, +query+ and +fragment+, in that order. # - def initialize(*arg) - raise InvalidURIError unless arg[5] - arg[5] = arg[5].sub(/^\//,'').sub(/^%2F/,'/') - super(*arg) + def initialize(scheme, + userinfo, host, port, registry, + path, opaque, + query, + fragment, + parser = nil, + arg_check = false) + raise InvalidURIError unless path + path = path.sub(/^\//,'') + path.sub!(/^%2F/,'/') + super(scheme, userinfo, host, port, registry, path, opaque, + query, fragment, parser, arg_check) @typecode = nil - tmp = @path.index(TYPECODE_PREFIX) - if tmp + if tmp = @path.index(TYPECODE_PREFIX) typecode = @path[tmp + TYPECODE_PREFIX.size..-1] @path = @path[0..tmp - 1] - if arg[-1] + if arg_check self.typecode = typecode else self.set_typecode(typecode) -- cgit v1.2.3