metricfu/metric_fu — pull request #156 by bf4 (2013-10-30 21:17:06+00:00)
Title: [Feature] Conditionally enable rcov

RCov will now enable itself if it finds the coverage/rcov/rcov.txt artifact the simplecov rcov text formatter creates.

This is how [metric_fu runs both the html and rcov text formatters at the same time](https://github.com/metricfu/metric_fu/blob/d372d0001db1efb2ecd39368d211c784a8e01b85/spec/spec_helper.rb#L4)

```ruby
require 'rspec/autorun'

if ENV['COVERAGE']
require 'simplecov'
formatters = [SimpleCov::Formatter::HTMLFormatter]
begin
puts '[COVERAGE] Running with SimpleCov HTML Formatter'
require 'simplecov-rcov-text'
formatters << SimpleCov::Formatter::RcovTextFormatter
puts '[COVERAGE] Running with SimpleCov Rcov Formatter'
rescue LoadError
puts '[COVERAGE] SimpleCov Rcov formatter could not be loaded'
end
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[ *formatters ]
SimpleCov.start
end
```