mysql_backup 0.1.0 → 0.2.0
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/lib/mysql_backup/pty.rb +3 -2
- data/lib/mysql_backup.rb +9 -4
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.2.0
|
data/lib/mysql_backup/pty.rb
CHANGED
@@ -6,7 +6,7 @@ module MysqlBackup
|
|
6
6
|
class Pty
|
7
7
|
class << self
|
8
8
|
def exec_pty(cmd, password)
|
9
|
-
$expect_verbose = true
|
9
|
+
# $expect_verbose = true # NOTE uncomment to print output
|
10
10
|
password = '' if password.nil?
|
11
11
|
|
12
12
|
PTY.spawn(cmd) do |reader, writer, pid|
|
@@ -15,7 +15,8 @@ module MysqlBackup
|
|
15
15
|
writer.puts password
|
16
16
|
end
|
17
17
|
rescue
|
18
|
-
|
18
|
+
puts "WARN: #{$!}" # TODO this can fail with unknown consequences
|
19
|
+
puts reader.gets
|
19
20
|
end
|
20
21
|
|
21
22
|
begin
|
data/lib/mysql_backup.rb
CHANGED
@@ -1,13 +1,15 @@
|
|
1
|
+
$:.unshift File.dirname(__FILE__)
|
2
|
+
|
1
3
|
#
|
2
4
|
# TODO Cleanup code
|
3
5
|
#
|
4
6
|
require 'sequel'
|
5
7
|
require 'pty'
|
8
|
+
require 'expect'
|
6
9
|
|
7
|
-
|
8
|
-
require
|
9
|
-
|
10
|
-
require 'lib/mysql_backup/install'
|
10
|
+
['install', 'pty', 'options', 'backup'].each do |file|
|
11
|
+
require File.dirname(__FILE__) + "/mysql_backup/#{file}"
|
12
|
+
end
|
11
13
|
|
12
14
|
module MysqlBackup
|
13
15
|
def self.version
|
@@ -28,3 +30,6 @@ module MysqlBackup
|
|
28
30
|
end
|
29
31
|
end
|
30
32
|
|
33
|
+
if __FILE__ == $0
|
34
|
+
MysqlBackup.run
|
35
|
+
end
|