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

Ruby 2.7 Warning: Using the last argument as keyword parameters is deprecated #314

Closed
harmdewit opened this issue Feb 3, 2020 · 2 comments

Comments

@harmdewit
Copy link

In Ruby 2.7.0 I'm getting warnings for keyword/positional arguments separation. For example something like this:

require 'new_relic/agent/method_tracer'
class An
  def self.process(a: , b:)
  end
  class << self
    include NewRelic::Agent::MethodTracer
    add_method_tracer :process
  end
end

An.process(a: 1, c: 2)
# => .gem/ruby/2.7.0/gems/newrelic_rpm-6.8.0.360/lib/new_relic/agent/method_tracer.rb:329: 
# warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call

This is because the traced methods have (*args, &block) as argument definitions instead of (*args, **kwargs, &block). Alternatively you could check for Ruby 2.7 and use the new ... syntax like in the Rails delegate rails/rails#38023.

@rachelleahklein
Copy link

Hi @harmdewit! I'm happy to inform you that full Ruby 2.7.0 support will be released with our next agent, which will eliminate the warnings you are seeing.

Thanks for reaching out!

@tannalynn
Copy link
Contributor

Hello! This has been fixed in agent version 6.9.0.

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

3 participants