intridea/multi_json — pull request #42 by arsduo (2012-04-16 13:49:40+00:00)
Title: Only warn once for each instance a deprecated method is called

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](https://github.com/defunkt/resque/pull/570)), 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!