From: Robert Klemme Date: 2008-01-25T19:44:33+09:00 Subject: Re: Determine where a method is being called from? 2008/1/25, Paolo Nusco Perrotta : > On Jan 23, 2:08 pm, Robert Klemme wrote: > > I do not see how using #caller is a hack. > > This is probably in the eye of the beholder. To me, having the call > stack as a single long string ??? $ ruby -e 'p caller.class' Array > and parsing it to fish out the caller > looks a bit hack-ish. It feels like #caller is supposed to be read by > a human, not by code. That's true. But then again, this is not for code execution but rather analysis. > >I was under the impression that Ben rather wanted a static analysis, > >i.e. determine code coverage. This is next to impossible with a > >dynamic language such as Ruby. > > Agreed. I am still waiting for Ben to chime in again. Cheers robert -- use.inject do |as, often| as.you_can - without end