wpcap 0.2.2 → 0.2.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/wpcap/recipes/mysql.rb +11 -2
- data/lib/wpcap/utility.rb +5 -1
- data/lib/wpcap/version.rb +1 -1
- metadata +1 -1
data/lib/wpcap/recipes/mysql.rb
CHANGED
@@ -77,11 +77,20 @@ configuration.load do
|
|
77
77
|
backups.each_with_index do |backup, count|
|
78
78
|
printf "%-5s %-20s %-10s %s\n", count + 1 , backup.type , backup.size , backup.at
|
79
79
|
end
|
80
|
-
|
80
|
+
Wpcap::Utility.question "Select a Backup you wish to restore (1-#{backups.size})"
|
81
81
|
restore_index = $stdin.gets.chomp
|
82
82
|
if restore_index
|
83
83
|
backup_to_restore = backups[restore_index.to_i - 1 ]
|
84
|
-
|
84
|
+
full_backup_to_restore_path = "#{backups_path}/#{backup_to_restore.name}"
|
85
|
+
Wpcap::Utility.question "Are you sure you want to restore #{full_backup_to_restore_path} (Y/n)"
|
86
|
+
user_confirm = $stdin.gets.chomp
|
87
|
+
if user_confirm == "Y" or user_confirm == "y"
|
88
|
+
restore_dump(full_backup_to_restore_path)
|
89
|
+
Wpcap::Utility.success "Database reverted to #{backup_to_restore.at}"
|
90
|
+
else
|
91
|
+
Wpcap::Utility.error "Canceling Restore"
|
92
|
+
end
|
93
|
+
|
85
94
|
end
|
86
95
|
end
|
87
96
|
|
data/lib/wpcap/utility.rb
CHANGED
@@ -8,8 +8,12 @@ class Wpcap::Utility
|
|
8
8
|
puts blue("****#{text}****")
|
9
9
|
end
|
10
10
|
|
11
|
+
def self.success(text)
|
12
|
+
puts green("****#{text}****")
|
13
|
+
end
|
14
|
+
|
11
15
|
def self.colorize(text, color_code)
|
12
|
-
"\e[#{color_code}m#{text}\e[0m"
|
16
|
+
"\033[1m\e[#{color_code}m#{text}\e[0m\033[22m"
|
13
17
|
end
|
14
18
|
|
15
19
|
def self.red(text); self.colorize(text, 31); end
|
data/lib/wpcap/version.rb
CHANGED