views:

20

answers:

1

How can I know that I'm seeing all deprecation warnings?

Will they all print out at boot time? So firing up the console and viewing the output should be sufficient?

(if so, I don't have any. w00t!)

Thanks, John

+1  A: 

Will they all print out at boot time? So firing up the console and viewing the output should be sufficient?

No; you wouldn't see some kinds of deprecation warnings until runtime. For instance, if you try to use find_all instead of find(:all), Ruby doesn't know you're using find_all until you actually hit that line.

Ruby is a dynamic language, so it would be very hard to prove that all deprecated code is actually gone; bindings to the "bad" code can be deferred and thus there's no way to guarantee that it's called in the first place. Your best bet is a static-analysis tool that reads your code in the abstract and errs on the side of false positives.

John Feminella
"Your best bet is a static-analysis tool that reads your code in the abstract and errs on the side of false positives." -- Is there such a tool? :) also, maybe the quick and dirty answer is to grep my log for "depreca" ?
John
Yes, take a look at `metric_fu` and `Reek`. They look at other things besides deprecated code, though, and they target code smells in general, but they're configurable.
John Feminella