mini_racer 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +6 -0
- data/lib/mini_racer.rb +15 -5
- data/lib/mini_racer/version.rb +1 -1
- 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: 26a28b25121d8a935ef202c191063315cc0aa6f2
|
4
|
+
data.tar.gz: be7d2dbfed7abdf88f798fcb8d4faaa5a77bc9b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba51d49df0b522f47df971fd6e28c54fb510ab98cf863a4138dc3be79a4400a5b1b5884d6a025518cbc6359573b51c929c99c8062dd1f4dc7a399d56f4da8742
|
7
|
+
data.tar.gz: 76156c3ee051d4556577d31fc590806825e9c055aedd65468be2e285b204ae24af4fb02b7d507bfa3e62aed2f3380ad05a44a72efafec3e92b24a13135f65ced
|
data/CHANGELOG
CHANGED
data/lib/mini_racer.rb
CHANGED
@@ -216,23 +216,33 @@ module MiniRacer
|
|
216
216
|
def timeout(&blk)
|
217
217
|
return blk.call unless @timeout
|
218
218
|
|
219
|
-
|
219
|
+
mutex = Mutex.new
|
220
|
+
done = false
|
221
|
+
|
222
|
+
rp,wp = IO.pipe
|
220
223
|
|
221
224
|
Thread.new do
|
222
225
|
begin
|
223
|
-
result = IO.select([
|
226
|
+
result = IO.select([rp],[],[],(@timeout/1000.0))
|
224
227
|
if !result
|
225
|
-
|
228
|
+
mutex.synchronize do
|
229
|
+
stop unless done
|
230
|
+
end
|
226
231
|
end
|
227
|
-
rescue
|
232
|
+
rescue => e
|
233
|
+
STDERR.puts e
|
228
234
|
STDERR.puts "FAILED TO TERMINATE DUE TO TIMEOUT"
|
229
235
|
end
|
230
236
|
end
|
231
237
|
|
232
238
|
rval = blk.call
|
233
|
-
|
239
|
+
mutex.synchronize do
|
240
|
+
done = true
|
241
|
+
end
|
234
242
|
|
243
|
+
wp.write("done")
|
235
244
|
rval
|
245
|
+
|
236
246
|
end
|
237
247
|
|
238
248
|
def check_init_options!(options)
|
data/lib/mini_racer/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mini_racer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Saffron
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|