Class: SimpleCov::Formatter::RcovFormatter::Setup

Inherits:
Object
  • Object
show all
Defined in:
lib/simplecov-rcov-setup.rb,
lib/simplecov-rcov-setup/version.rb

Constant Summary collapse

VERSION =
'0.0.7'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.filtered=(value) ⇒ Object (writeonly)

Sets the attribute filtered

Parameters:

  • value

    the value to set the attribute filtered to.



16
17
18
# File 'lib/simplecov-rcov-setup.rb', line 16

def filtered=(value)
  @filtered = value
end

.formatters=(value) ⇒ Object (writeonly)

Sets the attribute formatters

Parameters:

  • value

    the value to set the attribute formatters to.



16
17
18
# File 'lib/simplecov-rcov-setup.rb', line 16

def formatters=(value)
  @formatters = value
end

.profile=(value) ⇒ Object (writeonly)

Sets the attribute profile

Parameters:

  • value

    the value to set the attribute profile to.



16
17
18
# File 'lib/simplecov-rcov-setup.rb', line 16

def profile=(value)
  @profile = value
end

Class Method Details

.conditionally(&block) ⇒ Object



26
27
28
# File 'lib/simplecov-rcov-setup.rb', line 26

def conditionally(&block)
  unconditionally(&block) if ENV['COVERAGE'] == 'on'
end

.unconditionally(&block) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/simplecov-rcov-setup.rb', line 18

def unconditionally(&block)
  SimpleCov.formatters = @formatters
  SimpleCov.start(@profile) do
    @filtered.each { |filter| add_filter("/#{filter}") }
    instance_eval(&block) if block
  end
end