Class: EndOfLife::Report

Inherits:
Object
  • Object
show all
Includes:
Helpers::Terminal
Defined in:
lib/end_of_life/report.rb

Instance Method Summary collapse

Instance Method Details

#failure?Boolean

Returns:

  • (Boolean)


22
# File 'lib/end_of_life/report.rb', line 22

def failure? = repositories.any?

#to_sObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/end_of_life/report.rb', line 7

def to_s
  report = StringIO.new
  report.puts

  if repositories.empty?
    report.puts "No repositories using EOL #{product}."
  else
    word = (repositories.size == 1) ? "repository" : "repositories"
    report.puts "Found #{repositories.size} #{word} using EOL #{product} (<= #{product.latest_eol_release(at: max_eol_date)}):"
    report.puts end_of_life_table(repositories)
  end

  report.string
end