Class: Imap::Backup::CLI::Remote
- Inherits:
-
Thor
- Object
- Thor
- Imap::Backup::CLI::Remote
- Includes:
- Helpers, Thor::Actions
- Defined in:
- lib/imap/backup/cli/remote.rb
Overview
Implements the CLI functions relating to configured online accounts
Instance Method Summary collapse
-
#capabilities(email) ⇒ void
Prints an account’s IMAP capabilities.
-
#folders(email) ⇒ void
Prints an account’s folders.
-
#namespaces(email) ⇒ void
Prints an account’s IMAP namespaces.
Methods included from Helpers
#account, included, #load_config, #options, #requested_accounts
Instance Method Details
#capabilities(email) ⇒ void
This method returns an undefined value.
Prints an account’s IMAP capabilities
44 45 46 47 48 49 50 |
# File 'lib/imap/backup/cli/remote.rb', line 44 def capabilities(email) Imap::Backup::Logger.setup_logging config = load_config(**) account = account(config, email) capabilities = account.capabilities Kernel.puts capabilities.join(", ") end |
#folders(email) ⇒ void
This method returns an undefined value.
Prints an account’s folders
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/imap/backup/cli/remote.rb', line 23 def folders(email) Imap::Backup::Logger.setup_logging folder_names = folder_names(email) case [:format] when "json" json_format_names folder_names else list_names folder_names end end |
#namespaces(email) ⇒ void
This method returns an undefined value.
Prints an account’s IMAP namespaces
65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/imap/backup/cli/remote.rb', line 65 def namespaces(email) Imap::Backup::Logger.setup_logging config = load_config(**) account = account(config, email) namespaces = account.namespaces case [:format] when "json" json_format_namespaces namespaces else list_namespaces namespaces end end |