unixcharles / acme-client

A Ruby client for the letsencrypt's ACME protocol.
MIT License
495 stars 116 forks source link

Update code to avoid Ruby 2.7.0 warnings #183

Closed dgholz closed 4 years ago

dgholz commented 4 years ago

When running acme-client with Ruby 2.7.0, I see a few warnings like:

/Users/danielholz/.gem/ruby/2.7.0/gems/acme-client-2.0.6/lib/acme/client/resources/account.rb:8: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/danielholz/.gem/ruby/2.7.0/gems/acme-client-2.0.6/lib/acme/client/resources/account.rb:43: warning: The called method `assign_attributes' is defined here
/Users/danielholz/.gem/ruby/2.7.0/gems/acme-client-2.0.6/lib/acme/client/resources/order.rb:8: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/danielholz/.gem/ruby/2.7.0/gems/acme-client-2.0.6/lib/acme/client/resources/order.rb:49: warning: The called method `assign_attributes' is defined here
/Users/danielholz/.gem/ruby/2.7.0/gems/acme-client-2.0.6/lib/acme/client/resources/authorization.rb:8: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/danielholz/.gem/ruby/2.7.0/gems/acme-client-2.0.6/lib/acme/client/resources/authorization.rb:65: warning: The called method `assign_attributes' is defined here
/Users/danielholz/.gem/ruby/2.7.0/gems/acme-client-2.0.6/lib/acme/client/resources/challenges/base.rb:8: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/danielholz/.gem/ruby/2.7.0/gems/acme-client-2.0.6/lib/acme/client/resources/challenges/base.rb:43: warning: The called method `assign_attributes' is defined here

This PR updates the calls to assign_attributes to explicitly splat the argument.

I also removed the redefinition of OpenSSL::SSL::VERIFY_PEER in the spec helper, since it also printed a warning and didn't seem to affect tests.

There is one warning remaining related to the Faraday middleware; I've opened https://github.com/lostisland/faraday/pull/1153 to address that.

dgholz commented 4 years ago

I also noticed that Acme::Client::CertificateRequest assigns the public key fails when I run the test suite locally (#174)