Class: EagerEye::Reporters::Console

Inherits:
Base
  • Object
show all
Defined in:
lib/eager_eye/reporters/console.rb

Constant Summary collapse

COLORS =
{
  red: "\e[31m",
  yellow: "\e[33m",
  green: "\e[32m",
  cyan: "\e[36m",
  reset: "\e[0m",
  bold: "\e[1m"
}.freeze

Instance Attribute Summary

Attributes inherited from Base

#issues

Instance Method Summary collapse

Constructor Details

#initialize(issues, colorize: true) ⇒ Console

Returns a new instance of Console.



15
16
17
18
# File 'lib/eager_eye/reporters/console.rb', line 15

def initialize(issues, colorize: true)
  super(issues)
  @colorize = colorize
end

Instance Method Details

#reportObject



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/eager_eye/reporters/console.rb', line 20

def report
  return no_issues_message if issues.empty?

  output = []
  output << header
  output << ""

  issues_by_file.each do |file_path, file_issues|
    output << file_section(file_path, file_issues)
  end

  output << separator
  output << summary
  output.join("\n")
end