[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Is there a tool to document method invocations?

Larry Fast

3/29/2007 9:23:00 PM

I'm looking for something that will create a cross-reference document
showing where all my methods are being used. An ideal world would
include forward and reverse links within an editor. Are there any
editors, environments or tools that provide this functionality for Ruby?

Thanks,
Larry Fast

--
Posted via http://www.ruby-....

7 Answers

Joel VanderWerf

3/29/2007 9:35:00 PM

0

Larry Fast wrote:
> I'm looking for something that will create a cross-reference document
> showing where all my methods are being used. An ideal world would
> include forward and reverse links within an editor. Are there any
> editors, environments or tools that provide this functionality for Ruby?
>
> Thanks,
> Larry Fast
>

You can use the excellent ruby-prof in this way.

gem install ruby-prof

If you request the HTML output, you get a page with links from each
method to callers and callees, plus timing information.

It's a really nice tool.

--
vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407

Larry Fast

3/29/2007 9:52:00 PM

0

Joel VanderWerf wrote:
> gem install ruby-prof
> It's a really nice tool.

OK, but doesn't it just produce runtime reports? I'm looking for a
static report on WHERE in my code various objects and methods are used.
Is this capability buried in ruby-prof somewhere? The docs just talk
about runtime.




--
Posted via http://www.ruby-....

Gary Wright

3/29/2007 10:38:00 PM

0


On Mar 29, 2007, at 5:51 PM, Larry Fast wrote:

> Joel VanderWerf wrote:
>> gem install ruby-prof
>> It's a really nice tool.
>
> OK, but doesn't it just produce runtime reports? I'm looking for a
> static report on WHERE in my code various objects and methods are
> used.
> Is this capability buried in ruby-prof somewhere? The docs just talk
> about runtime.

I'd be surprised if it were even possible to generate a call graph
based on the static text. Ruby is simply too dynamic of a language.

The main problem is that it is really difficult (impossible?) to
intuit the class of the object returned by a method call by simply
looking at the text. Add in the possibility that methods are
created at run time and it becomes a really *hard* problem.



Gary Wright




Larry Fast

3/29/2007 10:43:00 PM

0

Gary Wright wrote:
> The main problem is that it is really difficult (impossible?) to
> intuit the class of the object returned by a method call by simply
> looking at the text. Add in the possibility that methods are
> created at run time and it becomes a really *hard* problem.

... so hard that nobody has even bothered to produce the basics? Don't
other development languages have this? How do you live without it?

--
Posted via http://www.ruby-....

Lugovoi Nikolai

3/29/2007 11:06:00 PM

0

Perhaps, rcov: http://eigenclass.org/hi...
Though, you'll need really good test suite to see info for usage of
*all* methods :)

2007/3/30, Larry Fast <lfast@mdsi.ca>:
> I'm looking for something that will create a cross-reference document
> showing where all my methods are being used. An ideal world would
> include forward and reverse links within an editor. Are there any
> editors, environments or tools that provide this functionality for Ruby?
>
> Thanks,
> Larry Fast
>
> --
> Posted via http://www.ruby-....
>
>

Gary Wright

3/29/2007 11:12:00 PM

0


On Mar 29, 2007, at 6:42 PM, Larry Fast wrote:
> Gary Wright wrote:
>> The main problem is that it is really difficult (impossible?) to
>> intuit the class of the object returned by a method call by simply
>> looking at the text. Add in the possibility that methods are
>> created at run time and it becomes a really *hard* problem.
>
> ... so hard that nobody has even bothered to produce the basics?
> Don't
> other development languages have this? How do you live without it?

grep

But I have looked at call graphs generated when I run my test suites.
You might find the rcov tool useful for this.

http://eigenclass.org/hi...



Gary Wright




Larry Fast

3/29/2007 11:56:00 PM

0

Gary Wright wrote:
> grep
> Gary Wright

Yep. That's what I'm doin' 'til I build up enough test cases to exercise
most of my code. rcov sounds like an important piece of this puzzle.

--
Posted via http://www.ruby-....