Sha256: 272844728fe404d1c38b95b05635c26f2bdd5d6fee71c01879b1a3a7c648efc8
Contents?: true
Size: 798 Bytes
Versions: 7
Compression:
Stored size: 798 Bytes
Contents
module Imap::Backup class CLI::Backup < Thor include Thor::Actions include CLI::Helpers attr_reader :options def initialize(options) super([]) @options = options end no_commands do def run config = load_config(**options) each_connection(config, emails) do |connection| connection.run_backup(refresh: refresh) rescue StandardError => e message = "Backup for account '#{connection.account.username}' " \ "failed with error #{e}" Logger.logger.warn message next end end def emails (options[:accounts] || "").split(",") end def refresh options.key?(:refresh) ? !!options[:refresh] : false end end end end
Version data entries
7 entries across 7 versions & 1 rubygems