Class: Mysql
- Inherits:
-
Source
show all
- Defined in:
- lib/blanket/plugins/sources/mysql.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from Utils
included, #method_missing, #noop
Constructor Details
#initialize(reader) ⇒ Mysql
Returns a new instance of Mysql.
4
5
6
|
# File 'lib/blanket/plugins/sources/mysql.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/mysql.rb', line 8
def self.attribute_symbols
[:source_type, :host, :user, :db_user, :password,
:db_password, :database, :dump_options, :remote_path, :local_path ]
end
|
.default_database ⇒ Object
37
38
39
|
# File 'lib/blanket/plugins/sources/mysql.rb', line 37
def self.default_database
"test"
end
|
.default_db_password ⇒ Object
33
34
35
|
# File 'lib/blanket/plugins/sources/mysql.rb', line 33
def self.default_db_password
"password"
end
|
.default_db_user ⇒ Object
25
26
27
|
# File 'lib/blanket/plugins/sources/mysql.rb', line 25
def self.default_db_user
"username"
end
|
.default_dump_options ⇒ Object
49
50
51
|
# File 'lib/blanket/plugins/sources/mysql.rb', line 49
def self.default_dump_options
""
end
|
.default_host ⇒ Object
17
18
19
|
# File 'lib/blanket/plugins/sources/mysql.rb', line 17
def self.default_host
"yourhost.com"
end
|
.default_local_path ⇒ Object
45
46
47
|
# File 'lib/blanket/plugins/sources/mysql.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/mysql.rb', line 29
def self.default_password
"password"
end
|
.default_remote_path ⇒ Object
41
42
43
|
# File 'lib/blanket/plugins/sources/mysql.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/mysql.rb', line 13
def self.default_source_type
"Mysql"
end
|
.default_user ⇒ Object
21
22
23
|
# File 'lib/blanket/plugins/sources/mysql.rb', line 21
def self.default_user
"username"
end
|
Instance Method Details
#cleanup_command ⇒ Object
65
66
67
|
# File 'lib/blanket/plugins/sources/mysql.rb', line 65
def cleanup_command
noop
end
|
#local_backup_path ⇒ Object
57
58
59
|
# File 'lib/blanket/plugins/sources/mysql.rb', line 57
def local_backup_path
local_path
end
|
#prep_command ⇒ Object
61
62
63
|
# File 'lib/blanket/plugins/sources/mysql.rb', line 61
def prep_command
"mysqldump #{dump_options} -u #{db_user} --password=#{db_password} #{database} > #{remote_backup_path}"
end
|
#remote_backup_path ⇒ Object
53
54
55
|
# File 'lib/blanket/plugins/sources/mysql.rb', line 53
def remote_backup_path
remote_path
end
|