aws/aws-sdk-ruby

"warning: Capturing the given block using Proc.new is deprecated"

sorah opened this issue · 2 comments

sorah commented

Please address the usage of the deprecated behavior in Ruby 2.7.

Issue description

Ruby 2.7 is going to deprecate the magical behavior of calling Proc.new without passing a block.

Looks like there are so many usage of Proc.new w/o block in aws-sdk-ruby, so I'm opening this issue instead of sending PR. Currently, aws-sdk generates lot of warning output due to the heavy usage. Log: https://gist.github.com/sorah/e2b2890233cbb3c865a5364632ed6aea

Ruby core team is preparing 2.7.0 preview release, which includes this change. This has been committed at early this year and is not planned to be reverted, so I'd like to let you know early.

Suggested changes

  • Use block argument &block
    • Also don't try to generate a empty Proc object if a block is not given, if it's not required i.e. callbacks

Gem name

Many aws-sdk-* are affected, including aws-sdk-core

Version of Ruby, OS environment

Ruby 2.7 trunk

Code snippets / steps to reproduce

https://gist.github.com/sorah/e2b2890233cbb3c865a5364632ed6aea

  1. Build a ruby trunk https://github.com/ruby/ruby
  2. install aws-sdk-core
  3. ruby -raws-sdk-core -e Aws::STS::Client.new.get_caller_identity

Thanks so much, yeah we have many usages there, will prioritize and take a look!

Both V2 and V3 PR updates have been merged, will be out in the next release :D