insxsync 0.0.13 → 0.0.14
Sign up to get free protection for your applications and to get access to all the features.
- data/features/step_definitions/synchronization_steps.rb +2 -2
- data/lib/config_file.rb +3 -3
- data/lib/insxsync/version.rb +1 -1
- data/lib/sync_point_restore.rb +10 -10
- metadata +2 -2
@@ -80,7 +80,7 @@ And(/^The config files should be updated$/) do
|
|
80
80
|
path = file.scan(/.*(subdomain.*)/).flatten[0]
|
81
81
|
next if path == 'subdomain/config.ini'
|
82
82
|
text = File.read(file)
|
83
|
-
db_name, db_suffix = text.scan(/
|
83
|
+
db_name, db_suffix = text.scan(/params.database\s*=\s*('|")([^'"]*?)(db|3[01][^'"]*|[0-2]\d[^'"]*)?('|")/).flatten
|
84
84
|
if db_suffix == 'db'
|
85
85
|
puts file
|
86
86
|
puts db_name
|
@@ -96,7 +96,7 @@ And(/^The config files should be unchanged/) do
|
|
96
96
|
path = file.scan(/.*(subdomain.*)/).flatten[0]
|
97
97
|
next if path == 'subdomain/config.ini'
|
98
98
|
text = File.read(file).gsub("\"","'")
|
99
|
-
db_name, db_suffix = text.scan(/
|
99
|
+
db_name, db_suffix = text.scan(/params.database\s*=\s*'([^']*?)(db|3[01][^']*|[0-2]\d[^']*)?'/).flatten
|
100
100
|
unless db_suffix == 'db'
|
101
101
|
puts file
|
102
102
|
puts db_name
|
data/lib/config_file.rb
CHANGED
@@ -17,9 +17,9 @@ class ConfigFile < ErrorHandlingIface
|
|
17
17
|
def scrub
|
18
18
|
@scrubbed = @contents
|
19
19
|
@scrubbed.gsub!("\"", "'")
|
20
|
-
@scrubbed.gsub!(/
|
21
|
-
@scrubbed.gsub!(/
|
22
|
-
@scrubbed.gsub!(/
|
20
|
+
@scrubbed.gsub!(/params.hostname(\s*)=(\s*)'[^']*'/m, "params.hostname\\1=\\2''")
|
21
|
+
@scrubbed.gsub!(/params.username(\s*)=(\s*)'[^']*'/m, "params.username\\1=\\2''")
|
22
|
+
@scrubbed.gsub!(/params.password(\s*)=(\s*)'[^']*'/m, "params.password\\1=\\2''")
|
23
23
|
@scrubbed.gsub!(/BucketName(\s*)=(\s*)'[^']*'/m, "BucketName\\1=\\2''")
|
24
24
|
|
25
25
|
@scrubbed.gsub!(/\s*useAnalytics\s*=\s*\d*/m, '')
|
data/lib/insxsync/version.rb
CHANGED
data/lib/sync_point_restore.rb
CHANGED
@@ -57,17 +57,17 @@ class SyncPointRestore < ErrorHandlingIface
|
|
57
57
|
|
58
58
|
text = File.read(file).gsub("\"", "'")
|
59
59
|
|
60
|
-
text.gsub!(/
|
61
|
-
text.gsub!(/
|
62
|
-
text.gsub!(/
|
60
|
+
text.gsub!(/params.hostname(\s*)=(\s*)'[^']*'/m, "params.hostname\\1=\\2'85.204.164.82'")
|
61
|
+
text.gsub!(/params.username(\s*)=(\s*)'[^']*'/m, "params.username\\1=\\2'root'")
|
62
|
+
text.gsub!(/params.password(\s*)=(\s*)'[^']*'/m, "params.password\\1=\\2'3dba6b67837565f146698075d5cd077fc805668c42defbf4e9b13db2eb2163ffWQXcbdGa5kLk4Kte70T66SAR7n7A13WuDsTV8VZuxwE='")
|
63
63
|
text.gsub!(/BucketName(\s*)=(\s*)'[^']*'/m, "BucketName\\1=\\2'my1outsourcing2-bucket'")
|
64
64
|
|
65
|
-
db_name, db_suffix = text.scan(/
|
65
|
+
db_name, db_suffix = text.scan(/params.database\s*=\s*'([^']*?)(db|3[01][^']*|[0-2]\d[^']*)?'/).flatten
|
66
66
|
|
67
67
|
if dbs.has_key?(db_name)
|
68
68
|
latest_month = reverse_abbrvs[dbs[db_name].keys.max]
|
69
69
|
latest_day = dbs[db_name][dbs[db_name].keys.max].max
|
70
|
-
text.gsub!(/
|
70
|
+
text.gsub!(/params.database(\s*)=(\s*)'[^']*'/m, "params.database\\1=\\2'#{db_name}#{latest_day}#{latest_month}'")
|
71
71
|
else
|
72
72
|
puts "Error updating subdomain config file: #{file}"
|
73
73
|
puts "Subdomain config file uses the database '#{db_name}#{db_suffix}' but no equivalent database exists on MySQL host."
|
@@ -145,17 +145,17 @@ class SyncPointRestore < ErrorHandlingIface
|
|
145
145
|
|
146
146
|
text = File.read(file).gsub("\"", "'")
|
147
147
|
|
148
|
-
text.gsub!(/
|
149
|
-
text.gsub!(/
|
150
|
-
text.gsub!(/
|
148
|
+
text.gsub!(/params.hostname(\s*)=(\s*)''/m, "params.hostname\\1=\\2'85.204.164.82'")
|
149
|
+
text.gsub!(/params.username(\s*)=(\s*)''/m, "params.username\\1=\\2'root'")
|
150
|
+
text.gsub!(/params.password(\s*)=(\s*)''/m, "params.password\\1=\\2'3dba6b67837565f146698075d5cd077fc805668c42defbf4e9b13db2eb2163ffWQXcbdGa5kLk4Kte70T66SAR7n7A13WuDsTV8VZuxwE='")
|
151
151
|
text.gsub!(/BucketName(\s*)=(\s*)''/m, "BucketName\\1=\\2'my1outsourcing2-bucket'")
|
152
152
|
|
153
|
-
db_name, db_suffix = text.scan(/
|
153
|
+
db_name, db_suffix = text.scan(/params.database\s*=\s*'([^']*?)(db)?'/).flatten
|
154
154
|
|
155
155
|
if dbs.has_key?(db_name)
|
156
156
|
latest_month = reverse_abbrvs[dbs[db_name].keys.max]
|
157
157
|
latest_day = dbs[db_name][dbs[db_name].keys.max].max
|
158
|
-
text.gsub!(/
|
158
|
+
text.gsub!(/params.database(\s*)=(\s*)'[^']*'/m, "params.database\\1=\\2'#{db_name}#{latest_day}#{latest_month}'")
|
159
159
|
else
|
160
160
|
puts "Error Synchronizing subdomain config file: #{file}"
|
161
161
|
puts "Subdomain config file uses the database '#{db_name}#{db_suffix}' but no equivalent database exists on MySQL host."
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: insxsync
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.14
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-04-
|
12
|
+
date: 2014-04-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: aws-sdk
|