lostisland / faraday_middleware

Various Faraday middlewares for Faraday-based API wrappers
MIT License
556 stars 205 forks source link

Ruby 2.7 warns on Proc.new with no block. #189

Closed hsbt closed 5 years ago

hsbt commented 5 years ago

I got the following warnings with Ruby 2.7.

faraday_middleware-0.13.1/lib/faraday_middleware/response_middleware.rb:14: warning: Capturing the given block using Proc.new
is deprecated; use `&block` instead
iMacTia commented 5 years ago

Sorry for being late, but the new implementation is unfortunately different from the older one. In fact, the previous implementation was raising an error in case the method was called without a block, while the new one will silently fail leaving @parser unset. This however will cause issues later when the code will try to call that block.