mysql_isolated_server 0.3.3 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mysql_isolated_server/version.rb +1 -1
- data/lib/mysql_isolated_server.rb +10 -7
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 40822abde8d3de427280276886533575dbeb17a6
|
4
|
+
data.tar.gz: 511e9f144e09d7f9bce84e80f1ecb12717537b46
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36da7b3e55bf118d0cb146daf3cb38888462b6b71d4e75d2776c40eafc6daff285fbdb7367af8f254223b77da1d86c2bc84023940a2d84ffa03f7d1d05aa8f8d
|
7
|
+
data.tar.gz: bd421791201d11a1e620a236a7e82e6621ee00863aa6858d55948935bf54ff05633754e64a16754e29a71f5ca889f50fad467d7dfcaf9a7c1d1f83d37849dea9
|
@@ -135,8 +135,14 @@ class MysqlIsolatedServer
|
|
135
135
|
|
136
136
|
tzinfo_to_sql = locate_executable("mysql_tzinfo_to_sql5", "mysql_tzinfo_to_sql")
|
137
137
|
raise "could not find mysql_tzinfo_to_sql" unless tzinfo_to_sql
|
138
|
-
system("#{tzinfo_to_sql} /usr/share/zoneinfo 2>/dev/null
|
139
|
-
|
138
|
+
system("#{tzinfo_to_sql} /usr/share/zoneinfo 2>/dev/null| mysql -h127.0.0.1 --database=mysql --port=#{@port} -u root mysql ")
|
139
|
+
|
140
|
+
begin
|
141
|
+
connection.query("SET GLOBAL time_zone='UTC'")
|
142
|
+
rescue Mysql2::Error
|
143
|
+
connection.query("SET GLOBAL time_zone='UTC'")
|
144
|
+
end
|
145
|
+
|
140
146
|
connection.query("SET GLOBAL server_id=#{@server_id}")
|
141
147
|
end
|
142
148
|
|
@@ -188,21 +194,18 @@ class MysqlIsolatedServer
|
|
188
194
|
end
|
189
195
|
end
|
190
196
|
|
191
|
-
|
192
197
|
while true
|
193
198
|
begin
|
194
199
|
Process.kill(0, parent_pid)
|
195
200
|
Process.kill(0, mysql_pid)
|
196
201
|
rescue Exception => e
|
197
|
-
Process.kill("KILL", mysql_pid)
|
202
|
+
Process.kill("KILL", mysql_pid)
|
198
203
|
cleanup!
|
199
204
|
exit!
|
200
205
|
end
|
201
206
|
|
202
207
|
sleep 1
|
203
208
|
end
|
204
|
-
|
205
|
-
at
|
206
209
|
end
|
207
210
|
|
208
211
|
@pid = middle_pid
|
@@ -217,6 +220,6 @@ class MysqlIsolatedServer
|
|
217
220
|
|
218
221
|
def kill!
|
219
222
|
return unless @pid
|
220
|
-
system("kill -
|
223
|
+
system("kill -TERM #{@pid}")
|
221
224
|
end
|
222
225
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mysql_isolated_server
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Osheroff
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A small library that allows you to easily spin up new local mysql servers
|
14
14
|
for testing purposes.
|