Class: Imap::Backup::CLI

Inherits:
Thor
  • Object
show all
Includes:
Helpers
Defined in:
lib/imap/backup/cli.rb,
lib/imap/backup/cli/accounts.rb

Defined Under Namespace

Modules: Helpers Classes: Accounts, Backup, Folders, Local, Migrate, Remote, Restore, Setup, Stats, Status, Utils

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Helpers

#account, #connection, #each_connection, #symbolized

Class Method Details

.accounts_optionObject


28
29
30
31
32
33
34
35
# File 'lib/imap/backup/cli.rb', line 28

def self.accounts_option
  method_option(
    "accounts",
    type: :string,
    desc: "a comma-separated list of accounts (defaults to all configured accounts)",
    aliases: ["-a"]
  )
end

.exit_on_failure?Boolean

Returns:

  • (Boolean)

24
25
26
# File 'lib/imap/backup/cli.rb', line 24

def self.exit_on_failure?
  true
end

Instance Method Details

#backupObject


46
47
48
# File 'lib/imap/backup/cli.rb', line 46

def backup
  Backup.new(symbolized(options)).run
end

#foldersObject


58
59
60
# File 'lib/imap/backup/cli.rb', line 58

def folders
  Folders.new(symbolized(options)).run
end

#migrate(source_email, destination_email) ⇒ Object


106
107
108
# File 'lib/imap/backup/cli.rb', line 106

def migrate(source_email, destination_email)
  Migrate.new(source_email, destination_email, **symbolized(options)).run
end

#restore(email = nil) ⇒ Object


119
120
121
# File 'lib/imap/backup/cli.rb', line 119

def restore(email = nil)
  Restore.new(email, symbolized(options)).run
end

#setupObject


128
129
130
# File 'lib/imap/backup/cli.rb', line 128

def setup
  Setup.new.run
end

#stats(email) ⇒ Object


144
145
146
# File 'lib/imap/backup/cli.rb', line 144

def stats(email)
  Stats.new(email, symbolized(options)).run
end

#statusObject


154
155
156
# File 'lib/imap/backup/cli.rb', line 154

def status
  Status.new(symbolized(options)).run
end