Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Ruby 3 style keyword arguments raises warning in Ruby 2.7 #27

Closed
rgraff opened this issue Jun 2, 2020 · 1 comment
Closed

Using Ruby 3 style keyword arguments raises warning in Ruby 2.7 #27

rgraff opened this issue Jun 2, 2020 · 1 comment

Comments

@rgraff
Copy link
Contributor

rgraff commented Jun 2, 2020

class ExampleCommand
  prepend SimpleCommand
  def initialize(foo:)
    @foo = foo
  end
  def call
    @foo
  end
end

irb(main):010:0> ExampleCommand.call(foo: "bar")
/usr/local/bundle/gems/simple_command-0.1.0/lib/simple_command.rb:9: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
(irb):3: warning: The called method `initialize' is defined here
=> #<ExampleCommand:0x0000560f7af7f988 @foo="bar", @called=true, @result="bar">

The issue is describe here: https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/

The warning is in 2.7 and will error in 3.0

@rgraff
Copy link
Contributor Author

rgraff commented Jun 2, 2020

PR here: #28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants