Class: RubyCritic::Analyser::Coverage

Inherits:
Object
  • Object
show all
Includes:
Colorize
Defined in:
lib/rubycritic/analysers/coverage.rb

Constant Summary collapse

RESULTSET_FILENAME =
'.resultset.json'

Instance Method Summary collapse

Methods included from Colorize

#colorize, #green, #red

Constructor Details

#initialize(analysed_modules) ⇒ Coverage

Returns a new instance of Coverage.


14
15
16
17
# File 'lib/rubycritic/analysers/coverage.rb', line 14

def initialize(analysed_modules)
  @analysed_modules = analysed_modules
  @result = results.first
end

Instance Method Details

#runObject


19
20
21
22
23
24
25
# File 'lib/rubycritic/analysers/coverage.rb', line 19

def run
  @analysed_modules.each do |analysed_module|
    analysed_module.coverage = find_coverage_percentage(analysed_module)
    print green '.'
  end
  puts ''
end

#to_sObject


27
28
29
# File 'lib/rubycritic/analysers/coverage.rb', line 27

def to_s
  'simple_cov'
end