mysql_mirror 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/lib/mysql_mirror.rb +5 -1
  3. metadata +3 -3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.2
data/lib/mysql_mirror.rb CHANGED
@@ -67,6 +67,9 @@ class MysqlMirror
67
67
  end
68
68
  end
69
69
 
70
+ def to_s
71
+ "Mirroring #{self.tables.join(', ')} from #{@source_config[:host]}.#{@source_config[:database]} to #{@target_config[:host]}.#{@target_config[:database]}"
72
+ end
70
73
 
71
74
  private
72
75
  # e.g, connect_to(:source)
@@ -113,7 +116,8 @@ private
113
116
  def remote_mysqldump
114
117
  @tmp_file_name = "mysql_mirror_#{@start_time.to_i}.sql"
115
118
  tables = get_tables.map(&:to_s).join(" ")
116
- where = self.where.blank? ? "" : "--where\"#{@source_config[:where]}\""
119
+ where_statement = self.where.values.first
120
+ where = self.where.blank? ? "" : "--where=\"#{where_statement}\""
117
121
  config = "-u#{@source_config[:username]} -p'#{@source_config[:password]}' -h #{@source_config[:host]} #{@source_config[:database]}"
118
122
 
119
123
  the_cmd = "#{mysqldump_command_prefix} #{where} #{config} #{tables} > #{@tmp_file_name}"
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 1
9
- version: 0.1.1
8
+ - 2
9
+ version: 0.1.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Peter Leonhardt
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-03-26 00:00:00 -05:00
18
+ date: 2010-03-29 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies: []
21
21