mysql_isolated_server 0.3.3 → 0.4.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 863d2316779205d27fe664054028571cb1f2ed9a
4
- data.tar.gz: 76b68adfd94069a2bed8f6c87847db7cf8ab0264
3
+ metadata.gz: 40822abde8d3de427280276886533575dbeb17a6
4
+ data.tar.gz: 511e9f144e09d7f9bce84e80f1ecb12717537b46
5
5
  SHA512:
6
- metadata.gz: 095538f3c91dc94b0c1979896fa3b8eb5c37702f38e63a50508746cae4d3a15d92ab699ed0fee48f60e7e92a5f01f514fd46c75d5dfcb945f59b9ccd6d844fbe
7
- data.tar.gz: 1f56358d3b3ec4e0afee945ada82f31b40f1d7baddd8b7f8a044c839036890724fc2943ab9782f0a10ad70b9c54f03409dce840e91d91437aeb76cdd28d2ed5e
6
+ metadata.gz: 36da7b3e55bf118d0cb146daf3cb38888462b6b71d4e75d2776c40eafc6daff285fbdb7367af8f254223b77da1d86c2bc84023940a2d84ffa03f7d1d05aa8f8d
7
+ data.tar.gz: bd421791201d11a1e620a236a7e82e6621ee00863aa6858d55948935bf54ff05633754e64a16754e29a71f5ca889f50fad467d7dfcaf9a7c1d1f83d37849dea9
@@ -1,3 +1,3 @@
1
1
  class MysqlIsolatedServer
2
- VERSION = "0.3.3"
2
+ VERSION = "0.4.0"
3
3
  end
@@ -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 | mysql -h127.0.0.1 --database=mysql --port=#{@port} -u root mysql ")
139
- connection.query("SET GLOBAL time_zone='UTC'")
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) rescue nil
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 -KILL #{@pid}")
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.3.3
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-06-26 00:00:00.000000000 Z
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.