Class: PgExport

Inherits:
Object
  • Object
show all
Includes:
Logging
Defined in:
lib/pg_export.rb,
lib/pg_export/dump.rb,
lib/pg_export/errors.rb,
lib/pg_export/logging.rb,
lib/pg_export/version.rb,
lib/pg_export/ftp_service.rb,
lib/pg_export/configuration.rb,
lib/pg_export/actions/create_dump.rb,
lib/pg_export/actions/compress_dump.rb,
lib/pg_export/ftp_service/connection.rb,
lib/pg_export/actions/remove_old_dumps.rb,
lib/pg_export/actions/send_dump_to_ftp.rb,
lib/pg_export/actions/remove_old_dumps_from_ftp.rb

Defined Under Namespace

Modules: Logging Classes: CompressDump, Configuration, CreateDump, DatabaseDoesNotExistError, DependencyRequiredError, Dump, DumpFileDoesNotExistError, FtpService, InvalidConfigurationError, RemoveOldDumps, RemoveOldDumpsFromFtp, SendDumpToFtp

Constant Summary collapse

VERSION =
'0.2.0'.freeze

Instance Method Summary collapse

Methods included from Logging

#logger, logger

Constructor Details

#initialize {|config| ... } ⇒ PgExport

Returns a new instance of PgExport.

Yields:

  • (config)


21
22
23
24
25
# File 'lib/pg_export.rb', line 21

def initialize
  @config = Configuration.new
  yield config if block_given?
  config.validate
end

Instance Method Details

#callObject



27
28
29
30
31
32
33
34
35
# File 'lib/pg_export.rb', line 27

def call
  initialize_dump
  concurrently do |job|
    job << Thread.new { perform_local_job }
    job << Thread.new { initialize_ftp_service }
  end
  perform_ftp_job
  self
end