--- !ruby/object:RI::ClassDescription 
attributes: []

class_methods: 
- !ruby/object:RI::MethodSummary 
  name: new
comment: 
- !ruby/struct:SM::Flow::P 
  body: A CodeCoverageAnalyzer is responsible for tracing code execution and returning code coverage and execution count information.
- !ruby/struct:SM::Flow::P 
  body: "Note that you must <tt>require 'rcov'</tt> before the code you want to analyze is parsed (i.e. before it gets loaded or required). You can do that by either invoking ruby with the <tt>-rrcov</tt> command-line option or just:"
- !ruby/struct:SM::Flow::VERB 
  body: " require 'rcov'\n require 'mycode'\n # ....\n"
- !ruby/struct:SM::Flow::H 
  level: 2
  text: Example
- !ruby/struct:SM::Flow::VERB 
  body: " analyzer = Rcov::CodeCoverageAnalyzer.new\n analyzer.run_hooked do\n   do_foo\n   # all the code executed as a result of this method call is traced\n end\n # ....\n\n analyzer.run_hooked do\n   do_bar\n   # the code coverage information generated in this run is aggregated\n   # to the previously recorded one\n end\n\n analyzer.analyzed_files   # =&gt; [&quot;foo.rb&quot;, &quot;bar.rb&quot;, ... ]\n lines, marked_info, count_info = analyzer.data(&quot;foo.rb&quot;)\n"
- !ruby/struct:SM::Flow::P 
  body: In this example, two pieces of code are monitored, and the data generated in both runs are aggregated. <tt>lines</tt> is an array of strings representing the source code of <tt>foo.rb</tt>. <tt>marked_info</tt> is an array holding false, true values indicating whether the corresponding lines of code were reported as executed by Ruby. <tt>count_info</tt> is an array of integers representing how many times each line of code has been executed (more precisely, how many events where reported by Ruby --- a single line might correspond to several events, e.g. many method calls).
- !ruby/struct:SM::Flow::P 
  body: "You can have several CodeCoverageAnalyzer objects at a time, and it is possible to nest the #run_hooked / #install_hook/#remove_hook blocks: each analyzer will manage its data separately. Note however that no special provision is taken to ignore code executed &quot;inside&quot; the CodeCoverageAnalyzer class. At any rate this will not pose a problem since it's easy to ignore it manually: just don't do"
- !ruby/struct:SM::Flow::VERB 
  body: "  lines, coverage, counts = analyzer.data(&quot;/path/to/lib/rcov.rb&quot;)\n"
- !ruby/struct:SM::Flow::P 
  body: if you're not interested in that information.
constants: []

full_name: Rcov::CodeCoverageAnalyzer
includes: []

instance_methods: 
- !ruby/object:RI::MethodSummary 
  name: analyzed_files
- !ruby/object:RI::MethodSummary 
  name: data
- !ruby/object:RI::MethodSummary 
  name: data_matching
- !ruby/object:RI::MethodSummary 
  name: install_hook
- !ruby/object:RI::MethodSummary 
  name: remove_hook
- !ruby/object:RI::MethodSummary 
  name: reset
- !ruby/object:RI::MethodSummary 
  name: run_hooked
name: CodeCoverageAnalyzer
superclass: DifferentialAnalyzer
