Module: Imap::Backup::CLI::Helpers

Included in:
Imap::Backup::CLI, Backup, Folders, Local, Restore, Status
Defined in:
lib/imap/backup/cli/helpers.rb

Instance Method Summary collapse

Instance Method Details

#each_connection(names) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/imap/backup/cli/helpers.rb', line 8

def each_connection(names)
  begin
    connections = Imap::Backup::Configuration::List.new(names)
  rescue Imap::Backup::ConfigurationNotFound
    raise "imap-backup is not configured. Run `imap-backup setup`"
    return
  end

  connections.each_connection do |connection|
    yield connection
  end
end

#symbolized(options) ⇒ Object



4
5
6
# File 'lib/imap/backup/cli/helpers.rb', line 4

def symbolized(options)
  options.each.with_object({}) { |(k, v), acc| acc[k.intern] = v }
end