Sha256: c351dbf04c3c373868c7d6efa68ac57e7bce67b5960372161ebaf68d96a9a526

Contents?: true

Size: 587 Bytes

Versions: 2

Compression:

Stored size: 587 Bytes

Contents

class PgExport
  module Services
    class CreateAndExportDump
      def initialize(bash_factory:, encryptor:, ftp_repository:)
        @bash_factory, @encryptor, @ftp_repository = bash_factory, encryptor, ftp_repository
      end

      def call(database_name, keep_dumps)
        dump = bash_factory.build_dump(database_name)
        encrypted_dump = encryptor.call(dump)
        ftp_repository.persist(encrypted_dump)
        ftp_repository.remove_old(database_name, keep_dumps)
      end

      private

      attr_reader :bash_factory, :encryptor, :ftp_repository
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pg_export-0.6.1 lib/pg_export/services/create_and_export_dump.rb
pg_export-0.6.0 lib/pg_export/services/create_and_export_dump.rb