Sha256: ee97e12bdd60747dbb25387105c3e73138682b2085feec4e02bd3cb4836dbee4

Contents?: true

Size: 581 Bytes

Versions: 1

Compression:

Stored size: 581 Bytes

Contents

require "imap/backup/serializer/directory"
require "imap/backup/serializer/folder_maker"

module Imap::Backup
  class Account; end

  class Account::FolderEnsurer
    attr_reader :account

    def initialize(account:)
      @account = account
    end

    def run
      raise "The backup path for #{account.username} is not set" if !account.local_path

      Serializer::FolderMaker.new(
        base: File.dirname(account.local_path),
        path: File.basename(account.local_path),
        permissions: Serializer::Directory::DIRECTORY_PERMISSIONS
      ).run
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
imap-backup-10.0.0 lib/imap/backup/account/folder_ensurer.rb