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.



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

def initialize smelly_files
  @smelly_files = smelly_files
  @padding = 0
end

Instance Method Details



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

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