Deprecation Spam
jeffgran opened this issue · 3 comments
I'm using RubyTree for very large trees (file system trees), and I have subclassed the node to represent my file system nodes (and it's working beautifully!). As I recurse through the tree and call my class's methods, my console/log is spammed with tons and tons of this:
The camelCased methods are deprecated. Please use preexisting_fingerprint_timestamp instead of preexisting_fingerprint_timestamp (DeprecatedMethodWarning)
I noticed the warning has been removed in the latest code... any chance you could release a new version of the gem?
Thank you for the feedback. I am planning to release a version in the next
10 days and this should be addressed.
In the interim period, you can add the following line to your code to
suppress the error message:
require 'structured_warnings'
DeprecatedMethodWarning.disable # Globally disable warnings about
deprecated methods!
RubyTree uses the 'structured_warnings' gem to selectively enable/disable
logging of such warning messages (see
https://github.com/schmidt/structured_warnings).
I am a little curious about the warning though. The message should only be
logged if the invoked method does not actually exist (it uses the
method_missinghttp://www.ruby-doc.org/docs/ProgrammingRuby/html/ref_c_object.html#Object.method_missingmechanism).
Can you let me know the Gem version that you are using?
Best Regards,
Anupam
Anupam
http://slashusr.wordpress.com
My Profile: http://www.google.com/profiles/anupamsg
On Sun, Dec 2, 2012 at 3:02 PM, jeffgran notifications@github.com wrote:
I'm using RubyTree for very large trees (file system trees), and I have
subclassed the node to represent my file system nodes (and it's working
beautifully!). As I recurse through the tree and call my class's methods,
my console/log is spammed with tons and tons of this:The camelCased methods are deprecated. Please use preexisting_fingerprint_timestamp instead of preexisting_fingerprint_timestamp (DeprecatedMethodWarning)
I noticed the warning has been removed in the latest code... any chance
you could release a new version of the gem?—
Reply to this email directly or view it on GitHubhttps://github.com//issues/14.
Thanks, I will try using structured_warnings to turn them off.
To be honest, I'm not sure why I'm getting these either. It's strange, because it's just on the one method, and that method is defined on the class it's being called on, so you're right, it shouldn't hit the method_missing. I wonder if it has to do with the fact that I'm in jruby?
I'm on the latest version, 0.8.3
Jeff
Jeff,
I am not sure whether it is a JRuby issue, but it is definitely strange, as the method_missing
should not get invoked at all.
I have added a few test cases in the master branch specifically for this scenario.