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

Instance Method Details

#capabilities(email) ⇒ Object



34
35
36
37
38
39
40
# File 'lib/imap/backup/cli/remote.rb', line 34

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



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

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



53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/imap/backup/cli/remote.rb', line 53

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