myreplicator 1.1.4 → 1.1.5

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.
@@ -22,7 +22,7 @@ module Myreplicator
22
22
  if !ssh_configs(db)["ssh_db_host"].blank?
23
23
  db_host = ssh_configs(db)["ssh_db_host"]
24
24
  elsif !db_configs(db)["host"].blank?
25
- db_host += db_configs(db)["host"]
25
+ db_host = db_configs(db)["host"]
26
26
  end
27
27
 
28
28
  cmd = Myreplicator.mysqldump
@@ -159,15 +159,22 @@ module Myreplicator
159
159
  flags += " --#{flag} "
160
160
  end
161
161
  end
162
-
163
- cmd = Myreplicator.mysql
164
- cmd += "#{flags} -u#{db_configs(db)["username"]} -p#{db_configs(db)["password"]} "
165
- cmd += "-h#{db_host} " if db_configs(db)["host"].blank?
166
- cmd += db_configs(db)["port"].blank? ? "-P3306 " : "-P#{db_configs(db)["port"]} "
167
- cmd += "--execute=\"#{get_outfile_sql(options)}\" "
168
-
169
- puts cmd
170
162
 
163
+ # Database host when ssh'ed into the db server
164
+ db_host = "127.0.0.1"
165
+
166
+ if !ssh_configs(db)["ssh_db_host"].blank?
167
+ db_host = ssh_configs(db)["ssh_db_host"]
168
+ elsif !db_configs(db)["host"].blank?
169
+ db_host = db_configs(db)["host"]
170
+ end
171
+
172
+ cmd = Myreplicator.mysql
173
+ cmd += "#{flags} -u#{db_configs(db)["username"]} -p#{db_configs(db)["password"]} "
174
+ cmd += "-h#{db_host} "
175
+ cmd += " -P#{db_configs(db)["port"]} " if db_configs(db)["port"]
176
+ cmd += "--execute=\"#{get_outfile_sql(options)}\" "
177
+ puts cmd
171
178
  return cmd
172
179
  end
173
180
 
@@ -1,3 +1,3 @@
1
1
  module Myreplicator
2
- VERSION = "1.1.4"
2
+ VERSION = "1.1.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: myreplicator
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.4
4
+ version: 1.1.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -356,7 +356,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
356
356
  version: '0'
357
357
  segments:
358
358
  - 0
359
- hash: 1249043179676867064
359
+ hash: 2579142891872580517
360
360
  required_rubygems_version: !ruby/object:Gem::Requirement
361
361
  none: false
362
362
  requirements:
@@ -365,7 +365,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
365
365
  version: '0'
366
366
  segments:
367
367
  - 0
368
- hash: 1249043179676867064
368
+ hash: 2579142891872580517
369
369
  requirements: []
370
370
  rubyforge_project:
371
371
  rubygems_version: 1.8.24