Class: Reek::Report::ProgressFormatter::Dots

Inherits:
Base
  • Object
show all
Defined in:
lib/reek/report/progress_formatter.rb

Overview

Shows the status of each source as either a dot (.) or an S

Constant Summary collapse

NO_WARNINGS_COLOR =
:green
WARNINGS_COLOR =
:red

Instance Attribute Summary

Attributes inherited from Base

#sources_count

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Reek::Report::ProgressFormatter::Base

Instance Method Details

#display_cleanObject (private)



52
53
54
# File 'lib/reek/report/progress_formatter.rb', line 52

def display_clean
  Rainbow('.').color(NO_WARNINGS_COLOR)
end

#display_smellyObject (private)



56
57
58
# File 'lib/reek/report/progress_formatter.rb', line 56

def display_smelly
  Rainbow('S').color(WARNINGS_COLOR)
end


46
47
48
# File 'lib/reek/report/progress_formatter.rb', line 46

def footer
  "\n\n"
end

#headerObject



38
39
40
# File 'lib/reek/report/progress_formatter.rb', line 38

def header
  "Inspecting #{sources_count} file(s):\n"
end

#progress(examiner) ⇒ Object



42
43
44
# File 'lib/reek/report/progress_formatter.rb', line 42

def progress(examiner)
  examiner.smelly? ? display_smelly : display_clean
end