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

ruby-changes:23090

From: shugo <ko1@a...>
Date: Mon, 26 Mar 2012 23:39:33 +0900 (JST)
Subject: [ruby-changes:23090] shugo:r35140 (trunk): * lib/net/ftp.rb (parse227, parse228, parse229): don't use local

shugo	2012-03-26 23:39:21 +0900 (Mon, 26 Mar 2012)

  New Revision: 35140

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

  Log:
    * lib/net/ftp.rb (parse227, parse228, parse229): don't use local
      variables defined by named capture for other Ruby implementations
      such as Rubinius.

  Modified files:
    trunk/ChangeLog
    trunk/lib/net/ftp.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 35139)
+++ ChangeLog	(revision 35140)
@@ -1,3 +1,9 @@
+Mon Mar 26 23:34:40 2012  Shugo Maeda  <shugo@r...>
+
+	* lib/net/ftp.rb (parse227, parse228, parse229): don't use local
+	  variables defined by named capture for other Ruby implementations
+	  such as Rubinius.
+
 Mon Mar 26 23:19:03 2012  Shugo Maeda  <shugo@r...>
 
 	* lib/net/ftp.rb (parse_pasv_port): refactored.
Index: lib/net/ftp.rb
===================================================================
--- lib/net/ftp.rb	(revision 35139)
+++ lib/net/ftp.rb	(revision 35140)
@@ -924,7 +924,7 @@
         raise FTPReplyError, resp
       end
       if /\((?<host>\d+(,\d+){3}),(?<port>\d+,\d+)\)/ =~ resp
-        return parse_pasv_ipv4_host(host), parse_pasv_port(port)
+        return parse_pasv_ipv4_host($~["host"]), parse_pasv_port($~["port"])
       else
         raise FTPProtoError, resp
       end
@@ -940,9 +940,9 @@
         raise FTPReplyError, resp
       end
       if /\(4,4,(?<host>\d+(,\d+){3}),2,(?<port>\d+,\d+)\)/ =~ resp
-        return parse_pasv_ipv4_host(host), parse_pasv_port(port)
+        return parse_pasv_ipv4_host($~["host"]), parse_pasv_port($~["port"])
       elsif /\(6,16,(?<host>\d+(,(\d+)){15}),2,(?<port>\d+,\d+)\)/ =~ resp
-        return parse_pasv_ipv6_host(host), parse_pasv_port(port)
+        return parse_pasv_ipv6_host($~["host"]), parse_pasv_port($~["port"])
       else
         raise FTPProtoError, resp
       end
@@ -978,7 +978,7 @@
         raise FTPReplyError, resp
       end
       if /\((?<d>[!-~])\k<d>\k<d>(?<port>\d+)\k<d>\)/ =~ resp
-        return @sock.peeraddr[3], port.to_i
+        return @sock.peeraddr[3], $~["port"].to_i
       else
         raise FTPProtoError, resp
       end

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

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