public
Description: CoverUp is a dynamic code coverage tool for Ruby code.
Homepage: http://ejdraper.com/blog/2009/01/14/cover-up
Clone URL: git://github.com/edraper/cover-up.git
commit  b28e91d7570cfac57d92ff86b896914a4ed00a6e
tree    1c9ad5c621daa646482dcaa9ce4daad4c6cf64cd
parent  5aca7259de6f8d1a413154af363fba5d6cf9cbae
name age message
file .gitignore Loading commit data...
file LICENSE
file README
file Rakefile
directory lib/
directory tests/
README
cover-up: a dynamic coverage tool for Ruby code

Usage:

  gem "cover-up"
  require "cover-up"
  
  results = coverage(:include => "app/*/**.rb") do
    run_tests
  end
  
  results # this now contains coverage results based on the input pattern filter, and the Ruby code being executed
  
You can also optionally run your own logger inside the code coverage execution, for example:

  logger = Proc.new do |event, file, line, id, binding, klass|
    puts "#{file} (#{line}): #{event}"
    end

    results = coverage(:include => "app/*/**.rb", :logger => logger) do
    run_tests
    end

This will print out trace logging information from the code coverage run to the console, similar to the following:

/path/cover-up/tests/../lib/cover-up.rb (89): line
/path/cover-up/tests/coverage_tests.rb (127): line
/path/cover-up/tests/coverage_tests.rb (144): call
/path/cover-up/tests/coverage_tests.rb (145): line
/path/cover-up/tests/coverage_tests.rb (146): return

You can of course log the information in any way you'd like, by writing a custom logger handler and passing that into 
the code coverage options.