From e62ea0cfcd802294da16fe44fe45f23cac2ecaf0 Mon Sep 17 00:00:00 2001 From: Lucas Kanashiro Date: Tue, 24 Mar 2020 17:51:56 -0300 Subject: [PATCH] lib/net/ldap/connections.rb: use ** to pass a keyword parameter In Socket.tcp call is passed a keyword parameter as is and while I've been testing a library that relies on it I got the following warning: net/ldap/connection.rb:709: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call In ruby 2.7 is preferred to use ** to pass keyword arguments in method's call. --- lib/net/ldap/connection.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/net/ldap/connection.rb b/lib/net/ldap/connection.rb index b01984f4..9c19f622 100644 --- a/lib/net/ldap/connection.rb +++ b/lib/net/ldap/connection.rb @@ -710,7 +710,7 @@ def socket # Wrap around Socket.tcp to normalize with other Socket initializers class DefaultSocket def self.new(host, port, socket_opts = {}) - Socket.tcp(host, port, socket_opts) + Socket.tcp(host, port, **socket_opts) end end end # class Connection