Sha256: 39c6cdd8da521bce9e976b3929174d147e9e333c20fe86a703ce73c1da9f342b
Contents?: true
Size: 814 Bytes
Versions: 1
Compression:
Stored size: 814 Bytes
Contents
class PgExport class Configuration DEFAULTS = { database: nil, dumpfile_dir: ENV['DUMPFILE_DIR'] || 'tmp/dumps', keep_dumps: ENV['KEEP_DUMPS'].to_i || 10, keep_ftp_dumps: ENV['KEEP_FTP_DUMPS'].to_i || 10, ftp_host: ENV['BACKUP_FTP_HOST'], ftp_user: ENV['BACKUP_FTP_USER'], ftp_password: ENV['BACKUP_FTP_PASSWORD'] }.freeze attr_accessor *DEFAULTS.keys def initialize DEFAULTS.each_pair do |key, value| send("#{key}=", value) end end def validate DEFAULTS.keys.each do |field| raise InvalidConfigurationError, "Field #{field} is required" if send(field).nil? end end def ftp_params { host: ftp_host, user: ftp_user, password: ftp_password } end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
pg_export-0.1.2 | lib/pg_export/configuration.rb |