Class: ImproveYourCode::Report::TextReport

Inherits:
Object
  • Object
show all
Defined in:
lib/improve_your_code/report/text_report.rb

Constant Summary collapse

NO_WARNINGS_COLOR =
:green
WARNINGS_COLOR =
:red

Instance Method Summary collapse

Constructor Details

#initializeTextReport

Returns a new instance of TextReport.



15
16
17
18
19
20
21
# File 'lib/improve_your_code/report/text_report.rb', line 15

def initialize
  @examiners           = []
  @total_smell_count   = 0
  @heading_formatter   = Formatter::QuietHeadingFormatter.new(Formatter)
  @progress_formatter  = Report::Formatter::ProgressFormatter::Dots.new
  @warning_formatter   = Report::Formatter::SimpleWarningFormatter.new
end

Instance Method Details

#add_examiner(examiner) ⇒ Object



23
24
25
26
27
28
29
# File 'lib/improve_your_code/report/text_report.rb', line 23

def add_examiner(examiner)
  print progress_formatter.progress examiner
  
  self.total_smell_count += examiner.smells_count

  examiners << examiner
end

#showObject



31
32
33
34
35
36
37
# File 'lib/improve_your_code/report/text_report.rb', line 31

def show
  print "\n\n"

  display_summary

  print total_smell_count_message
end