rubiconmd / injectable

Opinionated and declarative Dependency Injection library for ruby.
https://rubygems.org/gems/injectable
MIT License
34 stars 5 forks source link

Prepare for Ruby 3 #22

Closed julitrows closed 3 years ago

julitrows commented 3 years ago

This library will spit out several warnings when running under Ruby 2.7.1. This PR is an attempt to get those warnings sorted out in the best way so we ensure nothing breaks for Ruby 3.

There's still a couple of dep warnings on the dependency.rb file I'm not sure how to solve. Trying to understand if the problem is in the method definition or on the calls to that method. You can get them by running rspec under Ruby 2.7.1:

Injectable::Dependency instance
  with keyword arguments
injectable/lib/injectable/dependency.rb:27: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
injectable/spec/injectable/dependency_spec.rb:43: warning: The called method `initialize' is defined here

Injectable
  with dependencies that have a with: keyword option
injectable/lib/injectable/dependency.rb:27: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
injectable/spec/injectable_spec.rb:139: warning: The called method `initialize' is defined here
    passes it to the dependency #initialize method

  with block dependencies that take dependencies
injectable/lib/injectable/dependency.rb:29: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
injectable/spec/injectable_spec.rb:453: warning: The called method `call' is defined here

In the meantime:

Reference:

Question

After the warnings are solved, a version bump will be in order. Should it be 2.1 or 2.0.1?

codeclimate[bot] commented 3 years ago

Code Climate has analyzed commit 9fe2f822 and detected 2 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 1
Style 1

View more on Code Climate.