Class: Preek::SmellReporter

Inherits:
Thor::Shell::Color
  • Object
show all
Defined in:
lib/preek/smell_reporter.rb

Overview

Here we report the smells in a nice fashion

Instance Method Summary collapse

Constructor Details

#initialize(smelly_files) ⇒ SmellReporter

Returns a new instance of SmellReporter.



5
6
7
8
# File 'lib/preek/smell_reporter.rb', line 5

def initialize smelly_files
  @smelly_files = smelly_files.delete_if {|smell_file| smell_file.klasses.empty? }
  @padding = 0
end

Instance Method Details



10
11
12
13
14
15
16
17
# File 'lib/preek/smell_reporter.rb', line 10

def print_smells
  return say_status 'success!', 'No smells detected.' if @smelly_files.empty?
  print_line
  @smelly_files.each do |smelly|
    say_status 'file', format_path(smelly.filename), :blue
    print_klasses smelly.klasses
  end
end