Shopify / deprecation_toolkit

⚒Eliminate deprecations from your codebase ⚒
MIT License
460 stars 40 forks source link

Prepend module to Warning to patch Warning.warn #34

Closed dylanahsmith closed 5 years ago

dylanahsmith commented 5 years ago

Fixes #33 using the suggestion from https://github.com/rubygems/rubygems/issues/2588#issuecomment-452401326

We should prepend a module to patch Warning.warn because overriding the method directly assumes that no other code is patching Warning.warn as well as avoiding the assumption that Warning.warn is equivalent to Kernel.warn.

Edouard-chin commented 5 years ago

Thanks Dylan. The immediate fix make sense to me but I still believe that Ruby gems needs to be fixed