Class: LibyearBundler::Reports::Console

Inherits:
Base
  • Object
show all
Defined in:
lib/libyear_bundler/reports/console.rb

Overview

Responsible presenting data from the ‘::LibyearBundler::Models`. Should only be concerned with presentation, nothing else.

Constant Summary collapse

FMT_LIBYEARS_COLUMN =
"%10.1f".freeze
FMT_RELEASES_COLUMN =
"%10d".freeze
FMT_VERSIONS_COLUMN =
"%15s".freeze
FMT_SUMMARY_COLUMNS =
"%30s%15s%15s%15s%15s".freeze

Instance Method Summary collapse

Methods inherited from Base

#initialize, #to_h

Constructor Details

This class inherits a constructor from LibyearBundler::Reports::Base

Instance Method Details

#writeObject



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/libyear_bundler/reports/console.rb', line 13

def write
  to_h[:gems].each { |gem| put_line_summary(gem) }

  begin
    put_line_summary(@ruby) if @ruby.outdated?
  rescue StandardError => e
    warn "Unable to calculate libyears for ruby itself: #{e} (line summary)"
  end

  put_summary(to_h)
end