Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Only warn once for each instance a deprecated method is called #42
Right now, MultiJson prints a deprecation warning every time an outdated method is called. Unfortunately, in some cases this results in a flood of output. The preferred solution is obviously to patch the offending gem (I've submitted a pull request for Resque), but it looks like activesupport-3.1.4 itself uses decode, resulting in a flood of warnings whenever we run our test suite.
This pull request adds a deprecate method, which prints out a warning message once for each message/caller pair (e.g. decode called four times from in two places in the code will generate two messages). This should keep logs clean and manageable, but also get the point across.
I've also updated the readme to reflect the new sytax, no point in telling users to do something that'll generate warnings.
All specs pass; I've run the tests for our application against this fork as well, which pass and show the expected less noisy behavior.
Thanks for the great gem!