From: Ahmed Eldawy Date: 2009-11-22T18:45:28+09:00 Subject: Re: Detective - a new ruby gem Actually it works correctly with dynamically defined methods; I mean methods defined using 'define_method'. For example, here's a method defined dynamically in another gem called QuickMagick. /usr/local/lib/ruby/gems/1.8/gems/quick_magick-0.7.1/lib/quick_magick/image.rb, line 184 184: define_method((method).to_sym) do |*args| 185: append_to_operators(method, QuickMagick::geometry(*args) ) 186: end I tried Detective with it and here's the result print Detective.view_source('QuickMagick::Image#resize', :rdoc) /usr/local/lib/ruby/gems/1.8/gems/quick_magick-0.7.1/lib/quick_magick/image.rb, line 185 185: append_to_operators(method, QuickMagick::geometry(*args) ) It showed me just the body of the method not the header. But I think this is enough. Actually this is what ruby executes, so there's nothing more to tell you. For methods working using method_missing, you are correct. Detective will not show it to you. I'll consider this in the next gem release. Marnen Laibow-Koser wrote: > 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/.