libuv 3.0.1 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +6 -5
- data/lib/libuv.rb +0 -6
- data/lib/libuv/coroutines.rb +6 -0
- data/lib/libuv/q.rb +3 -0
- data/lib/libuv/reactor.rb +7 -3
- data/lib/libuv/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: f4c95c239b58b3429b67cfc328e7a2adefe488b0
|
4
|
+
data.tar.gz: 236dcd09f67bf2a3363417c20faea0975a2663ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 446d248cfd4fc340a4ef1f16da7c1bf46f3f5100af439108cc35813ce0e4e16ae39deda00106a3d7d47b05c8ec239f41a98ce390096c972b29ce894b44fb37a7
|
7
|
+
data.tar.gz: 744f091cf46e94c5213150e3ec6e4d51465a6760be368ec26b86a80071d8fb7f18f8a289a69f2569044991b46ad826b6d745666c8b776879c082e2b4f499ece9
|
data/.travis.yml
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
language: ruby
|
2
2
|
rvm:
|
3
|
-
-
|
4
|
-
-
|
3
|
+
- ruby-2.2.5
|
4
|
+
- ruby-2.3.1
|
5
5
|
- ruby-head
|
6
|
-
-
|
7
|
-
-
|
6
|
+
- rubinius-3.62
|
7
|
+
- jruby-9.1.5.0
|
8
8
|
- jruby-head
|
9
9
|
branches:
|
10
10
|
only:
|
@@ -19,4 +19,5 @@ matrix:
|
|
19
19
|
allow_failures:
|
20
20
|
- rvm: jruby-head
|
21
21
|
- rvm: ruby-head
|
22
|
-
|
22
|
+
sudo: required
|
23
|
+
dist: trusty
|
data/lib/libuv.rb
CHANGED
data/lib/libuv/coroutines.rb
CHANGED
@@ -56,6 +56,12 @@ class Object
|
|
56
56
|
# Either return the result or raise an error
|
57
57
|
if wasError
|
58
58
|
if result.is_a?(Exception)
|
59
|
+
backtrace = caller
|
60
|
+
if result.respond_to?(:backtrace) && result.backtrace
|
61
|
+
backtrace << '---- continuation ----'
|
62
|
+
backtrace.concat(result.backtrace)
|
63
|
+
end
|
64
|
+
result.set_backtrace(backtrace)
|
59
65
|
raise result
|
60
66
|
else
|
61
67
|
e = case result
|
data/lib/libuv/q.rb
CHANGED
@@ -371,6 +371,7 @@ module Libuv
|
|
371
371
|
# same rejection.
|
372
372
|
def all(reactor, *promises)
|
373
373
|
deferred = Q.defer(reactor)
|
374
|
+
promises = promises.flatten
|
374
375
|
counter = promises.length
|
375
376
|
results = []
|
376
377
|
|
@@ -406,6 +407,7 @@ module Libuv
|
|
406
407
|
# @return [Promise] Returns a single promise
|
407
408
|
def any(reactor, *promises)
|
408
409
|
deferred = Q.defer(reactor)
|
410
|
+
promises = promises.flatten
|
409
411
|
if promises.length > 0
|
410
412
|
promises.each_index do |index|
|
411
413
|
ref(reactor, promises[index]).then(proc {|result|
|
@@ -431,6 +433,7 @@ module Libuv
|
|
431
433
|
# each [result, wasResolved] value pair corresponding to a at the same index in the `promises` array.
|
432
434
|
def self.finally(reactor, *promises)
|
433
435
|
deferred = Q.defer(reactor)
|
436
|
+
promises = promises.flatten
|
434
437
|
counter = promises.length
|
435
438
|
results = []
|
436
439
|
|
data/lib/libuv/reactor.rb
CHANGED
@@ -80,7 +80,7 @@ module Libuv
|
|
80
80
|
|
81
81
|
# LibUV ingnores program interrupt by default.
|
82
82
|
# We provide normal behaviour and allow this to be overriden
|
83
|
-
@on_signal =
|
83
|
+
@on_signal = []
|
84
84
|
sig_callback = method(:signal_cb)
|
85
85
|
self.signal(:INT, sig_callback).unref
|
86
86
|
self.signal(:HUP, sig_callback).unref
|
@@ -109,7 +109,11 @@ module Libuv
|
|
109
109
|
end
|
110
110
|
|
111
111
|
def signal_cb(_)
|
112
|
-
@on_signal.
|
112
|
+
if @on_signal.empty?
|
113
|
+
stop_cb
|
114
|
+
else
|
115
|
+
@on_signal.each(&:call)
|
116
|
+
end
|
113
117
|
end
|
114
118
|
|
115
119
|
def next_tick_cb
|
@@ -392,7 +396,7 @@ module Libuv
|
|
392
396
|
|
393
397
|
# Allows user defined behaviour when sig int is received
|
394
398
|
def on_program_interrupt(callback = nil, &block)
|
395
|
-
@on_signal
|
399
|
+
@on_signal << (callback || block)
|
396
400
|
self
|
397
401
|
end
|
398
402
|
|
data/lib/libuv/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: libuv
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen von Takach
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|