Closed iMacTia closed 2 years ago
@iMacTia
We would like to add Faraday#DeprecatedClass
to Faraday ver1.xx
like https://github.com/lostisland/faraday/commit/6e746fceefe0d1f75535b40a62d846a6a95bf85f , How about?
@hyuraku yep that would work!
@iMacTia
I could not solve the warning by adding Faraday#DeprecatedClass
because the class could not hide custom warning message.
I suggest adding the module in lib/faraday/warning.rb
below to hide the warning message; how about?
module CustomWarningFilter
def warn(message)
deprecate = ENV['FARADAY_DEPRECATE'].to_s.downcase
if !(deprecate == '1' || deprecate == 'warn')
super
end
end
end
Warning.extend CustomWarningFilter
Oh right, Faraday#DeprecatedClass
deprecates an entire class, but I thought you wanted to use Faraday::Deprecate#deprecate
from that PR. That should allow you do deprecate individual methods with a similar configurable behaviour.
I'd rather not extend or mess with public standard classes like Warning as that could have unexpected repercussions on projects and affects things outside of Faraday's control.
This was fixed in #1438 🎉 Thank you @hyuraku 🙏
This seems to be an issue again on the jump from v1 to v2. I'm getting a bunch of these:
Did you move away from the
FARADAY_DEPRECATE
idea? To be clear, I don't even directly depend on faraday-- it comes through another dependency.Originally posted by @kyrofa in https://github.com/lostisland/faraday/issues/1089#issuecomment-1086227010