backup 1.3.3 → 1.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/backup.gemspec +1 -1
- data/generators/backup_files/templates/config.rake +7 -11
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.3.
|
1
|
+
1.3.4
|
data/backup.gemspec
CHANGED
@@ -1,23 +1,19 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
end
|
7
|
-
yaml_file = YAML.load_file(File.join(RAILS_ROOT, 'config', 'backup', 'tmp.yml'))
|
8
|
-
File.delete(File.join(RAILS_ROOT, 'config', 'backup', 'tmp.yml'))
|
9
|
-
return yaml_file
|
1
|
+
# Opens and Reads the Backup YAML File from the RAILS_ROOT/config/backup path
|
2
|
+
# Replaces all the :rails_root tokens with the actual RAILS_ROOT path
|
3
|
+
# Returns the content of the file in YAML format
|
4
|
+
def read_backup_yaml_file(config_file)
|
5
|
+
YAML.load File.open(File.join(RAILS_ROOT, 'config', 'backup', config_file), 'r').read.gsub(/:rails_root/, RAILS_ROOT)
|
10
6
|
end
|
11
7
|
|
12
8
|
namespace :backup do
|
13
9
|
|
14
10
|
task :s3_config => :environment do
|
15
|
-
@config =
|
11
|
+
@config = read_backup_yaml_file('s3.yml')
|
16
12
|
@adapters = ['mysql', 'sqlite3', 'assets', 'custom']
|
17
13
|
end
|
18
14
|
|
19
15
|
task :ssh_config => :environment do
|
20
|
-
@config
|
16
|
+
@config = read_backup_yaml_file('ssh.yml')
|
21
17
|
@adapters = ['mysql', 'sqlite3', 'assets', 'custom']
|
22
18
|
end
|
23
19
|
|