News for hackers. Stuff that matters.
Re:Introducing RCapture - Method Hooks in Ruby by erikwiffin on Thursday January 07, 2010 @11:34AM (#1037330)
I like it, and see a lot of uses for RCapture during the debugging stage. However, I can't think of a situation off the top of my head where it would be preferable to add a hook to a method rather than change the method itself. As the creator, I'm assuming you had some use cases in mind?
Re:Introducing RCapture - Method Hooks in Ruby by cheind on Thursday January 07, 2010 @12:26PM (#1037458)
Well, yes: decoupling concerns and common aspects of methods. Adding logging to third party libraries for instance. Another one was custom profiling and statistics. You might find your very own use cases by having a look at the examples.

Christoph

Re:Introducing RCapture - Method Hooks in Ruby by jcnnghm on Thursday January 07, 2010 @08:38AM (#1036997)
This looks like it could be pretty useful. As with all meta-programming though, if you're going to use this it's probably a good idea to make it clear in your comments and log files. It can be very difficult to debug.
Re:Introducing RCapture - Method Hooks in Ruby by cheind on Thursday January 07, 2010 @10:11AM (#1037157)
I agree, documenting usage of meta-programming is a must. Thanks for your feedback.
Re:Introducing RCapture - Method Hooks in Ruby by jcnnghm on Thursday January 07, 2010 @12:23PM (#1037444)
Are you the creator? If you are, have you considered incorporating some of the hacks that will show meta programming line numbers in stack traces?
Re:Introducing RCapture - Method Hooks in Ruby by cheind on Friday January 08, 2010 @01:53AM (#1039048)
Hi, yes I'm, and no I haven't :) Can you point me to some links?