# Rcov::HTMLCoverage how-to?

**URL:** <https://www.ruby-forum.com/t/rcov-htmlcoverage-how-to/180484>\
**Category:** Ruby\
**Created:** [December 19, 2009, 9:52pm UTC](https://www.ruby-forum.com/t/rcov-htmlcoverage-how-to/180484 "2009-12-19T21:52:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tcsnide](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/eb8c5e/32.png) [@tcsnide](https://www.ruby-forum.com/u/tcsnide)\
**Post date:** [December 19, 2009, 9:52pm UTC](https://www.ruby-forum.com/t/rcov-htmlcoverage-how-to/180484/1 "2009-12-19T21:52:04Z")

</div>

Putting Rcov to work in program, the FAQ gives the following as the  
basic procedure:

require ‘rcov’  
rcov\_analyzer = Rcov::CodeCoverageAnalyzer.new  
at\_exit do  
rcov\_analyzer.remove\_hook  
rcov\_analyzer.dump\_coverage\_info([Rcov::TextReport.new])  
# use Rcov::HTMLCoverage above to generate HTML reports; the  
formatters admit  
# a number of options, listed in rcov’s RDoc documentation.  
end  
rcov\_analyzer.install\_hook

That does the job for the analysis, but how do I generate the HTML  
reports now? How do I use Rcov::HTMLCoverage as the embedded comment  
suggests? I tried

```
  Rcov::HTMLCoverage.new.execute

```

But that did nothing (which doesn’t surprise me since it has no  
reference to rcov\_analyzer).
