rdoc icon indicating copy to clipboard operation
rdoc copied to clipboard

[feature] RDoc::Task should include option to generate coverage report

Open zzak opened this issue 12 years ago • 2 comments

Given a Rakefile with RDoc::Task configured for files, or using .document, it would be nice to generate a coverage report with the project file structure already known.

For example:

# Rakefile
require 'rdoc/task'

RDoc::Task.new do |rdoc|
  rdoc.rdoc_files.include("lib/foo.rb", "lib/foo/bar.rb")
end

We could then do something like:

rake rdoc --coverage

To generate the coverage report, given the known files and other configuration from the task.

This way generating a report for a project is much simpler then adding all project files to the coverage report command (rdoc -C ...)

zzak avatar Nov 30 '13 13:11 zzak

Currently you can do this like this:

RDoc::Task.new 'coverage' do |rdoc|
  rdoc.options << '-C'
end

Allowing --coverage is beyond a rake task's ability.

I think adding a namespaced task to generate coverage would work, though.

drbrain avatar Jan 09 '14 20:01 drbrain

That is an acceptable work around, thanks!

I'm going to leave this open so that I remember to add an example of this to the RDoc::Task documentation

zzak avatar Jan 09 '14 23:01 zzak