[前][次][番号順一覧][スレッド一覧]

ruby-changes:34408

From: naruse <ko1@a...>
Date: Sun, 22 Jun 2014 09:22:05 +0900 (JST)
Subject: [ruby-changes:34408] naruse:r46489 (trunk): fix that arg_check didn't work

naruse	2014-06-22 09:21:57 +0900 (Sun, 22 Jun 2014)

  New Revision: 46489

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=46489

  Log:
    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.

  Modified files:
    trunk/ChangeLog
    trunk/lib/uri/ftp.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 46488)
+++ ChangeLog	(revision 46489)
@@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sun Jun 22 09:01:47 2014  NARUSE, Yui  <naruse@r...>
+
+	* lib/uri/ftp.rb (initialize): argument checking flag is arg_check,
+	  but arg[-1] is fragment.
+
+	* lib/uri/ftp.rb (initialize): explicitly specify arguments.
+
 Sat Jun 21 12:50:32 2014  Nobuyoshi Nakada  <nobu@r...>
 
 	* ext/fiddle/extconf.rb: supply 0 to fill RUBY_LIBFFI_MODVERSION
Index: lib/uri/ftp.rb
===================================================================
--- lib/uri/ftp.rb	(revision 46488)
+++ lib/uri/ftp.rb	(revision 46489)
@@ -129,17 +129,24 @@ module URI https://github.com/ruby/ruby/blob/trunk/lib/uri/ftp.rb#L129
     # 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)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]