Class: Teems::Commands::Sync

Inherits:
Base
  • Object
show all
Includes:
SyncAuth, SyncChatHandler, SyncDisplay
Defined in:
lib/teems/commands/sync.rb

Overview

Sync chat history locally as Markdown + JSON files

Constant Summary collapse

DEFAULT_SINCE_DAYS =
180
SKIP_PREFIXES =
%w[48:].freeze

Constants included from SyncChatHandler

Teems::Commands::SyncChatHandler::RETRY_DELAY_SECONDS

Instance Attribute Summary

Attributes inherited from Base

#options, #positional_args, #runner

Instance Method Summary collapse

Constructor Details

#initialize(args, runner:) ⇒ Sync

Returns a new instance of Sync.



296
297
298
299
300
301
302
# File 'lib/teems/commands/sync.rb', line 296

def initialize(args, runner:)
  @options = {}
  @sync_store = nil
  @state = nil
  @stats = nil
  super
end

Instance Method Details

#executeObject



304
305
306
307
308
309
# File 'lib/teems/commands/sync.rb', line 304

def execute
  result = validate_and_authenticate
  return result if result

  run_sync
end

#validate_and_authenticateObject



311
312
313
# File 'lib/teems/commands/sync.rb', line 311

def validate_and_authenticate
  validate_options ||  || require_auth
end