class Troo::CLI::Main

Public Instance Methods

cleanup() click to toggle source
# File lib/troo/cli/main.rb, line 33
def cleanup
  if yes?('This will remove all local data, are you sure?')
    Ohm.redis.flushdb
    say "\n" + 'All local data has been removed.'
  else
    say "\n" + 'No local data has been removed.'
  end
end
config() click to toggle source
# File lib/troo/cli/main.rb, line 25
def config
  say heading('Current configuration:')
  say Troo.configuration.view
end
move(card_id, list_id, board_id = nil) click to toggle source
# File lib/troo/cli/main.rb, line 76
def move(card_id, list_id, board_id = nil)
  say Commands::Move::Card.dispatch(card_id, list_id, board_id)
end
status() click to toggle source
# File lib/troo/cli/main.rb, line 7
def status
  say heading('Status:')
  say Commands::Status.dispatch(Troo::Board)
  say Commands::Status.dispatch(Troo::List)
  say Commands::Status.dispatch(Troo::Card)

  say "\n" + heading('Last refreshed:')

  if Troo::Refresh.last_performed_at?
    say Troo::Refresh.last_performed_at
  else
    say 'Unknown. Run `troo refresh all`.'
  end
end
version() click to toggle source
# File lib/troo/cli/main.rb, line 45
def version
  say "troo #{Troo::VERSION}"
end

Private Instance Methods

heading(text = '') click to toggle source
# File lib/troo/cli/main.rb, line 82
def heading(text = '')
  [Esc.yellow, Esc.underline, text, Esc.reset].join
end