Repository is archived
No commit activity in last 3 years
No release in over 3 years
Just a Simplecov Formatter to cheat metric_fu. Generate a rcov.txt file.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

Simplecov Rcov Formatter Text¶ ↑

The target of this formatter is to cheat on metric_fu so it’s possible to use simplecov instead rcov.

Install¶ ↑

gem install simplecov-rcov-text

Usage¶ ↑

Add the gem to the Gemfile preferably in the group test:

gem 'simplecov', :require => false
gem 'simplecov-rcov-text', :require => false

Create a .metrics file in the root of project with the code:

MetricFu::Configuration.run do |config|
  config.rcov[:external] = 'coverage/rcov/rcov.txt'
end

And follow the instructions of Simplecov and metric_fu or metrical.

Simplest way¶ ↑

require 'simplecov'
require 'simplecov-rcov-text'
SimpleCov.formatter = SimpleCov::Formatter::RcovTextFormatter

Using with HTML Format¶ ↑

require 'simplecov'
require 'simplecov-rcov-text'
class SimpleCov::Formatter::MergedFormatter
  def format(result)
     SimpleCov::Formatter::HTMLFormatter.new.format(result)
     SimpleCov::Formatter::RcovTextFormatter.new.format(result)
  end
end
SimpleCov.formatter = SimpleCov::Formatter::MergedFormatter

Running metric_fu/metrical¶ ↑

Be sure that you configured simplecov and simplecov-rcov-text.

Run your test framework, example:

rspec spec

After that you can run the metric_fu/metrical command.

Don’t forget to configure .metrics file!


Example of generated file¶ ↑

metric_fu shift the first line
   class SomeClass
     def method_1
       1+1
     end

     def method_2 ( value )
!!     value * value
     end
   end

Running tests¶ ↑

bundle
rake