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] Stops using &Proc.new for block forwarding. #1083

Merged
merged 1 commit into from
Nov 28, 2019

Conversation

olleolleolle
Copy link
Member

@olleolleolle olleolleolle commented Nov 27, 2019

Description

In order to be Ruby 2.7 warning-free, back-port 5ace0ea

Additional Notes

Faraday::Response::RaiseError
/Users/olle/opensource/faraday/lib/faraday.rb:68: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
/Users/olle/opensource/faraday/lib/faraday/rack_builder.rb:55: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
  raises Faraday::ClientError for 500 responses
/Users/olle/opensource/faraday/lib/faraday.rb:68: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
/Users/olle/opensource/faraday/lib/faraday/rack_builder.rb:55: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
  raises Faraday::ClientError for other 4xx responses
/Users/olle/opensource/faraday/lib/faraday.rb:68: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
/Users/olle/opensource/faraday/lib/faraday/rack_builder.rb:55: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
  raises Faraday::ClientError for 400 responses
/Users/olle/opensource/faraday/lib/faraday.rb:68: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
/Users/olle/opensource/faraday/lib/faraday/rack_builder.rb:55: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
  raises Faraday::ConnectionFailed for 407 responses
/Users/olle/opensource/faraday/lib/faraday.rb:68: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
/Users/olle/opensource/faraday/lib/faraday/rack_builder.rb:55: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
  raises Faraday::ClientError for 401 responses
/Users/olle/opensource/faraday/lib/faraday.rb:68: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
/Users/olle/opensource/faraday/lib/faraday/rack_builder.rb:55: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
  raises Faraday::ClientError for 409 responses
/Users/olle/opensource/faraday/lib/faraday.rb:68: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
/Users/olle/opensource/faraday/lib/faraday/rack_builder.rb:55: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
  raises no exception for 200 responses
/Users/olle/opensource/faraday/lib/faraday.rb:68: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
/Users/olle/opensource/faraday/lib/faraday/rack_builder.rb:55: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
  raises Faraday::ClientError for 403 responses
/Users/olle/opensource/faraday/lib/faraday.rb:68: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
/Users/olle/opensource/faraday/lib/faraday/rack_builder.rb:55: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
  raises Faraday::NilStatusError for nil status in response
/Users/olle/opensource/faraday/lib/faraday.rb:68: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
/Users/olle/opensource/faraday/lib/faraday/rack_builder.rb:55: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
  raises Faraday::ResourceNotFound for 404 responses
/Users/olle/opensource/faraday/lib/faraday.rb:68: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
/Users/olle/opensource/faraday/lib/faraday/rack_builder.rb:55: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
  raises Faraday::ClientError for 422 responses

@olleolleolle
Copy link
Member Author

olleolleolle commented Nov 27, 2019

Update: Found and fixed another:

/Users/olle/opensource/faraday/lib/faraday/options.rb:166: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
/Users/olle/opensource/faraday/lib/faraday/options.rb:166: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
/Users/olle/opensource/faraday/lib/faraday/options.rb:166: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
/Users/olle/opensource/faraday/lib/faraday/options.rb:166: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead
/Users/olle/opensource/faraday/lib/faraday/options.rb:166: warning: Capturing the given block using Proc.new is deprecated; use `&block` instead

Copy link
Member

@technoweenie technoweenie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

/cc #1080

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

Successfully merging this pull request may close these issues.

2 participants