On Tue, 03 Feb 2004 09:14:01 +0900, Hal Fulton wrote:
> Simon Strandgaard wrote:
>> Does there exists a tool for Ruby which records which parts
>> of code (preferable the nodes in the AST) there has been reached?
>> 
>> Eventually with some statistics on how many times each part
>> has been executed?
> 
> There is coverage.rb in RAA. It's very basic, but it works fine
> "out of the box" and has been useful to me.
> 
> It doesn't measure stats, but it does show what code has been
> hit and what has not, and dumps it in ANSI.

Wew, this is really a short piece of code.. amazing that it can be done in
only 45 lines of ruby code!

If I do "cat report.txt" then my terminal just scrolls for 10 seconds,
which is much larger than what my terminal history can remember.
If I pipe it into "less" then the coloring disappears. How do you view
ANSI files?  

I think I will improve it (because I need it in conjunction with unittest)
*  Add counters to each line.
*  Fancy HTML output.
 
Has this been done before?
Other ideas?
Eventually make a rubyforge project out of it?

--
Simon Strandgaard