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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b10a0bc452c1191da75b68559a2938ac09284f85
4
- data.tar.gz: 60d8591279de58b4de765a46ecf3e4352f271fd0
3
+ metadata.gz: f4c95c239b58b3429b67cfc328e7a2adefe488b0
4
+ data.tar.gz: 236dcd09f67bf2a3363417c20faea0975a2663ba
5
5
  SHA512:
6
- metadata.gz: 9385371508feaf33ba6a28b3566063746383f540f6959a8466cc05188874b29ba69ecfba96ee9cf038ef23bf814e990d51fe6f4e06f9f7282481fc3595f92ec7
7
- data.tar.gz: 10d0fc2affa3b408ec867d769dea18fcead4c17f49fa73802e58718785cab5cabff58a9d45f88d6e2c4bb6e2414e4dbcf24770435889770cc6cf941a592c1715
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
- - "2.1"
4
- - "2.2"
3
+ - ruby-2.2.5
4
+ - ruby-2.3.1
5
5
  - ruby-head
6
- - rbx-2
7
- - rbx
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
- - rvm: rbx
22
+ sudo: required
23
+ dist: trusty
data/lib/libuv.rb CHANGED
@@ -62,12 +62,6 @@ module Libuv
62
62
 
63
63
  # Include all the accessors at this level
64
64
  extend Accessors
65
-
66
- # Run the default reactor
67
- at_exit do
68
- reactor = Reactor.default
69
- reactor.run if $!.nil? && reactor.run_count == 0
70
- end
71
65
  end
72
66
 
73
67
 
@@ -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 = proc { stop_cb }
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.call
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 = callback || block
399
+ @on_signal << (callback || block)
396
400
  self
397
401
  end
398
402
 
data/lib/libuv/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Libuv
4
- VERSION = '3.0.1'
4
+ VERSION = '3.1.0'
5
5
  end
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.1
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-10-26 00:00:00.000000000 Z
11
+ date: 2016-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi