ruby2.7 Using the last argument as keyword parameters is deprecated#2794
ruby2.7 Using the last argument as keyword parameters is deprecated#2794ilkarataev wants to merge 2 commits intomongodb:masterfrom
Conversation
|
Thanks for pointing this out! It looks like this is actually a problem with Ruby 2.7 and its parser; the same warning does not appear in Ruby 3.x. The call as given should be fine, because the empty hash is supposed to map to the Ultimately, the empty hash is redundant because the Mongo::Server::Description.new(address)If we do want to preserve the empty hash as a hint that we're truly producing an empty server description, something like the following would be more accurate: Mongo::Server::Description.new(address, {}, **{})/cc @comandeo -- do you have any opinions here? |
|
I second what @jamis wrote above. I believe we should use just |
…delete second parametr
Hi I faced problem on my script I saw warnings:
/var/lib/gems/2.7.0/gems/mongo-2.19.1/lib/mongo/server.rb:658: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/var/lib/gems/2.7.0/gems/mongo-2.19.1/lib/mongo/server/description.rb:220: warning: The called method `initialize' is defined here
This small changes fix the problem.