Class: Astrails::Safe::Pgdump

Inherits:
Source show all
Defined in:
lib/astrails/safe/pgdump.rb

Instance Attribute Summary

Attributes inherited from Source

#id

Attributes inherited from Stream

#backup, #config

Instance Method Summary collapse

Methods inherited from Source

#backup, #filename, #initialize, #kind, #timestamp

Methods inherited from Stream

#expand, #initialize

Constructor Details

This class inherits a constructor from Astrails::Safe::Source

Instance Method Details

#commandObject



5
6
7
8
9
10
11
12
# File 'lib/astrails/safe/pgdump.rb', line 5

def command
  if @config["password"]
    ENV['PGPASSWORD'] = @config["password"]
  else
    ENV['PGPASSWORD'] = nil
  end
  "pg_dump #{postgres_options} #{postgres_username} #{postgres_host} #{postgres_port} #{@id}"
end

#extensionObject



14
# File 'lib/astrails/safe/pgdump.rb', line 14

def extension; '.sql'; end