summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-10 14:04:23 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-10 14:04:23 +0000
commit6c0e64dee5cb5273f90b9ee51b49ca035689483d (patch)
treefc09c74a68b7345514286d80e18a44bac4208877
parente7320dbe32788d113fb7c18f4ef91a46a131c4f0 (diff)
* ext/socket/lib/socket.rb: fix argument check in the previous commit.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32908 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--ext/socket/lib/socket.rb4
2 files changed, 5 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 46b4bef..9bd8414 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Wed Aug 10 23:03:55 2011 Tanaka Akira <akr@fsij.org>
+
+ * ext/socket/lib/socket.rb: fix argument check in the previous commit.
+
Wed Aug 10 22:12:28 2011 Tanaka Akira <akr@fsij.org>
* ext/socket/lib/socket.rb (Socket.tcp): add :connect_timeout option.
diff --git a/ext/socket/lib/socket.rb b/ext/socket/lib/socket.rb
index ba1ceb1..34a4379 100644
--- a/ext/socket/lib/socket.rb
+++ b/ext/socket/lib/socket.rb
@@ -102,7 +102,6 @@ class Addrinfo
#
def connect_from(*args, &block)
opts = Hash === args.last ? args.pop : {}
- raise ArgumentError, "wrong number of arguments (#{args.length} for 1)" if 1 < args.length
local_addr_args = args
connect_internal(family_addrinfo(*local_addr_args), opts[:timeout], &block)
end
@@ -151,7 +150,6 @@ class Addrinfo
#
def connect_to(*args, &block)
opts = Hash === args.last ? args.pop : {}
- raise ArgumentError, "wrong number of arguments (#{args.length} for 1)" if 1 < args.length
remote_addr_args = args
remote_addrinfo = family_addrinfo(*remote_addr_args)
remote_addrinfo.send(:connect_internal, self, opts[:timeout], &block)
@@ -299,7 +297,7 @@ class Socket < BasicSocket
#
def self.tcp(host, port, *rest) # :yield: socket
opts = Hash === rest.last ? rest.pop : {}
- raise ArgumentError, "wrong number of arguments (#{args.length} for 2)" if 2 < args.length
+ raise ArgumentError, "wrong number of arguments (#{rest.length} for 2)" if 2 < rest.length
local_host, local_port = rest
last_error = nil
ret = nil