Class: Postgresql
- Inherits:
-
Source
show all
- Defined in:
- lib/blanket/plugins/sources/postgresql.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from Utils
included, #method_missing, #noop
Constructor Details
#initialize(reader) ⇒ Postgresql
Returns a new instance of Postgresql.
4
5
6
|
# File 'lib/blanket/plugins/sources/postgresql.rb', line 4
def initialize(reader)
@reader = reader
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class Utils
Class Method Details
.attribute_symbols ⇒ Object
8
9
10
11
|
# File 'lib/blanket/plugins/sources/postgresql.rb', line 8
def self.attribute_symbols
[:source_type, :host, :user, :password, :db_user, :db_host,
:database, :dump_options, :remote_path, :local_path]
end
|
.default_database ⇒ Object
37
38
39
|
# File 'lib/blanket/plugins/sources/postgresql.rb', line 37
def self.default_database
"test"
end
|
.default_db_host ⇒ Object
33
34
35
|
# File 'lib/blanket/plugins/sources/postgresql.rb', line 33
def self.default_db_host
"127.0.0.1"
end
|
.default_db_user ⇒ Object
25
26
27
|
# File 'lib/blanket/plugins/sources/postgresql.rb', line 25
def self.default_db_user
"username"
end
|
.default_dump_options ⇒ Object
49
50
51
|
# File 'lib/blanket/plugins/sources/postgresql.rb', line 49
def self.default_dump_options
"--format=custom"
end
|
.default_host ⇒ Object
17
18
19
|
# File 'lib/blanket/plugins/sources/postgresql.rb', line 17
def self.default_host
"yourhost.com"
end
|
.default_local_path ⇒ Object
45
46
47
|
# File 'lib/blanket/plugins/sources/postgresql.rb', line 45
def self.default_local_path
"/path/to/local/sql-file"
end
|
.default_password ⇒ Object
29
30
31
|
# File 'lib/blanket/plugins/sources/postgresql.rb', line 29
def self.default_password
"password"
end
|
.default_remote_path ⇒ Object
41
42
43
|
# File 'lib/blanket/plugins/sources/postgresql.rb', line 41
def self.default_remote_path
"/path/to/remote/sql-file"
end
|
.default_source_type ⇒ Object
13
14
15
|
# File 'lib/blanket/plugins/sources/postgresql.rb', line 13
def self.default_source_type
"Postgresql"
end
|
.default_user ⇒ Object
21
22
23
|
# File 'lib/blanket/plugins/sources/postgresql.rb', line 21
def self.default_user
"username"
end
|
Instance Method Details
#cleanup_command ⇒ Object
65
66
67
|
# File 'lib/blanket/plugins/sources/postgresql.rb', line 65
def cleanup_command
noop
end
|
#local_backup_path ⇒ Object
57
58
59
|
# File 'lib/blanket/plugins/sources/postgresql.rb', line 57
def local_backup_path
local_path
end
|
#prep_command ⇒ Object
61
62
63
|
# File 'lib/blanket/plugins/sources/postgresql.rb', line 61
def prep_command
"pg_dump #{dump_options} -U #{db_user} -h #{db_host} #{database} > #{remote_backup_path}"
end
|
#remote_backup_path ⇒ Object
53
54
55
|
# File 'lib/blanket/plugins/sources/postgresql.rb', line 53
def remote_backup_path
remote_path
end
|