class BundleOutdatedFormatter::TerminalFormatter

Formatter for Terminal

Public Instance Methods

convert() click to toggle source
# File lib/bundle_outdated_formatter/formatter/terminal_formatter.rb, line 7
def convert
  table.render(@style.to_sym, padding: [0, 1]).chomp
end

Private Instance Methods

table() click to toggle source
# File lib/bundle_outdated_formatter/formatter/terminal_formatter.rb, line 13
def table
  return TTY::Table.new([@columns]) if @outdated_gems.empty?

  TTY::Table.new(header: @columns) do |t|
    @outdated_gems.each do |gem|
      t << gem.values
    end
  end
end