Class: Imap::Backup::CLI::Remote

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

Instance Method Summary collapse

Methods included from Helpers

#account, #load_config, #options, #requested_accounts

Instance Method Details

#capabilities(email) ⇒ Object



39
40
41
42
43
44
45
# File 'lib/imap/backup/cli/remote.rb', line 39

def capabilities(email)
  Imap::Backup::Logger.setup_logging options
  config = load_config(**options)
   = (config, email)
  capabilities = .capabilities
  Kernel.puts capabilities.join(", ")
end

#folders(email) ⇒ Object



20
21
22
23
24
25
26
27
28
29
# File 'lib/imap/backup/cli/remote.rb', line 20

def folders(email)
  Imap::Backup::Logger.setup_logging options
  folder_names = folder_names(email)
  case options[:format]
  when "json"
    json_format_names folder_names
  else
    list_names folder_names
  end
end

#namespaces(email) ⇒ Object



58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/imap/backup/cli/remote.rb', line 58

def namespaces(email)
  Imap::Backup::Logger.setup_logging options
  config = load_config(**options)
   = (config, email)
  namespaces = .namespaces
  case options[:format]
  when "json"
    json_format_namespaces namespaces
  else
    list_namespaces namespaces
  end
end