From: Mauricio Fernandez Date: 2006-09-06T02:01:49+09:00 Subject: Re: using rcov in already running program On Tue, Sep 05, 2006 at 09:39:10AM +0900, Suraj N. Kurapati wrote: > Mauricio Fernandez wrote: > > On Tue, Sep 05, 2006 at 03:00:07AM +0900, Suraj N. Kurapati wrote: > >> RCOV_ARGV = ['--html', '--no-color', '--save', 'coverage.html'] > >> require 'rcov/runner' > > > > What about something like this? > > > > require 'rcov/runner' > > # if nothing else is done, it generates a plain text report, no HTML > > > > # Rcov::Runner.generate formatter [, options] is used to specify which > > # reports are to be generated. The possible options will be explained in the > > # RDoc documentation. > > Rcov::Runner.generate Rcov::HTMLCoverage, :color => false > > Rcov::Runner.generate Rcov::TextCoverageDiff, :coverage_diff_mode => :record, > > :coverage_diff_file => "coverage.data" > > This is good. Please proceed with this approach. Alright then, I'll document the available report generators ("formatters") and their options in the RDoc. ## hmmm, which one is better? lib/cov/runner.rb: require 'rcov/runner' ruby -rcov/runner myscript.rb or lib/cov.rb -> ruby -rcov myscript.rb Naming your lib r.* can be handy at times... -- Mauricio Fernandez - http://eigenclass.org - singular Ruby