mysql_backup 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.2.0
@@ -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
- print reader.gets
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
- require 'lib/mysql_backup/backup'
8
- require 'lib/mysql_backup/options'
9
- require 'lib/mysql_backup/pty'
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mysql_backup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christian Hellsten