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, #connection, #each_connection, included, #load_config, #options

Instance Method Details

#folders(email) ⇒ Object


13
14
15
16
17
18
19
20
21
22
# File 'lib/imap/backup/cli/remote.rb', line 13

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

#namespaces(email) ⇒ Object


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

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