class Rudisco::CLI::Presentation::Update

Attributes

outdated[R]

@return [Integer]

Public Class Methods

new(**params) click to toggle source
# File lib/rudisco/cli/presentation/update.rb, line 6
def initialize(**params) # no-doc
  @outdated = params[:outdated]

  self.formatter = 'progress'
end

Public Instance Methods

finished() click to toggle source
# File lib/rudisco/cli/presentation/update.rb, line 29
def finished  # no-doc
  aligned "Update finished! All records updated!", width: 80,
                                                   align: 'center'
end
show() click to toggle source
# File lib/rudisco/cli/presentation/update.rb, line 12
def show # no-doc
  header title: 'Update starting...', width: 80, align: 'center',
         bold: true, timestamp: true

  if outdated.zero?
    aligned "Nothing to do!", width: 80, align: 'center'
  else
    aligned "#{outdated} records going to be added/updated.", width: 80,
             align: 'center'
  end
end
update(**params) click to toggle source
# File lib/rudisco/cli/presentation/update.rb, line 24
def update(**params) # no-doc
  print "Updating...#{params[:updated]}/#{outdated}\r"
  $stdout.flush
end