[feature] RDoc::Task should include option to generate coverage report
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 ...)
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.
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