Sha256: 28a9bb2ce51daeb4e4a771e6efbbf4fd4859f40fda7fe629e426f30a40447f7b

Contents?: true

Size: 596 Bytes

Versions: 13

Compression:

Stored size: 596 Bytes

Contents

# frozen_string_literal: true

require 'open3'
require 'tempfile'

require 'pg_export/lib/pg_export/entities/dump'
require 'pg_export/import'

class PgExport
  module Factories
    class DumpFactory
      def plain(database:, file:)
        Entities::Dump.new(
          name: [database, timestamp].join('_'),
          database: database,
          file: file,
          type: :plain
        )
      end

      private

      TIMESTAMP_FORMAT = '%Y%m%d_%H%M%S'
      private_constant :TIMESTAMP_FORMAT

      def timestamp
        Time.now.strftime(TIMESTAMP_FORMAT)
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
pg_export-1.0.0.rc5 lib/pg_export/lib/pg_export/factories/dump_factory.rb
pg_export-1.0.0.rc4 lib/pg_export/lib/pg_export/factories/dump_factory.rb
pg_export-1.0.0.rc3 lib/pg_export/lib/pg_export/factories/dump_factory.rb
pg_export-1.0.0.rc2 lib/pg_export/lib/pg_export/factories/dump_factory.rb
pg_export-1.0.0.rc1 lib/pg_export/lib/pg_export/factories/dump_factory.rb
pg_export-0.7.7 lib/pg_export/lib/pg_export/factories/dump_factory.rb
pg_export-0.7.6 lib/pg_export/lib/pg_export/factories/dump_factory.rb
pg_export-0.7.5 lib/pg_export/lib/pg_export/factories/dump_factory.rb
pg_export-0.7.4 lib/pg_export/lib/pg_export/factories/dump_factory.rb
pg_export-0.7.3 lib/pg_export/lib/pg_export/factories/dump_factory.rb
pg_export-0.7.2 lib/pg_export/lib/pg_export/factories/dump_factory.rb
pg_export-0.7.1 lib/pg_export/lib/pg_export/factories/dump_factory.rb
pg_export-0.7.0 lib/pg_export/lib/pg_export/factories/dump_factory.rb