From: Marnen Laibow-Koser Date: 2009-11-22T03:08:00+09:00 Subject: Re: Detective - a new ruby gem Ahmed Eldawy wrote: > Emmm ... > Actually that's how it should work. It's not a bug. > What the gem actually does is opening the files where you have defined a > method and extract the lines of method definition. > When you define a method in irb it's not saved in any files. This means > we have now way to extract its code. > The same problem occurs when you define a method using eval method. The > method is defined in a string variable (memory) not in a file. > Provided that the above cases rarely happen in a real application, we > can say that this is not a problem with Detective. I like the idea behind Detective, but if it can't cope with dynamically defined methods, then it won't be terribly useful in practice. method_missing trickery and dynamic metaprogramming are fairly common in Ruby. Best, -- Marnen Laibow-Koser http://www.marnen.org marnen@marnen.org -- Posted via http://www.ruby-forum.com/.