radiator 0.3.10 → 0.3.11

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: c4ff8172c52320522f9a22b4a710a1051837aa9d
4
- data.tar.gz: 827457f802605807383f2c42350f671754fad7c0
3
+ metadata.gz: ad2c2c627c82f4b7a77eba148cb884e274c704a6
4
+ data.tar.gz: '0308a2266cbf4a54ef069d66ce22579aedba05ef'
5
5
  SHA512:
6
- metadata.gz: f79ed7cbb0e5a64a7a21c17e6b25bc254591b9e31b24ab733ffc93872de6949a994339844f4479780c86e34ac56546dbfb91d391875c861fc03ea4818f83c9a1
7
- data.tar.gz: 53c4aa2777f751221c0e0bee02b2dc47abbed64dde1ae92d66db77ae57a4363d5554d552012f1372b480bd928c6f17ea07b0595f59d104397a3562e66de5a09b
6
+ metadata.gz: a6ef349ae2137e72426b98bb2c15528066689250f5b4fa1cd3f2a38da4a2db8c7ec770c2560c6275dfc4d096477d33d4e100c69b2b8a4a290035834f5d45cbc6
7
+ data.tar.gz: d84a08d33554048527c224655f91646c61a9a36ef7151071c77ea4b3e5f11eca858e182b283078d274b309317e109b13aa18d122b50eeb0d4e6021da0ad20b8f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- radiator (0.3.10)
4
+ radiator (0.3.11)
5
5
  awesome_print (~> 1.7, >= 1.7.0)
6
6
  bitcoin-ruby (~> 0.0, >= 0.0.11)
7
7
  ffi (~> 1.9, >= 1.9.18)
data/lib/radiator/api.rb CHANGED
@@ -250,8 +250,6 @@ module Radiator
250
250
  @api = nil
251
251
  @block_api = nil
252
252
  @backoff_at = nil
253
-
254
- ObjectSpace.define_finalizer(self, self.class.finalize(self))
255
253
  end
256
254
 
257
255
  # Get a specific block or range of blocks.
@@ -537,7 +535,7 @@ module Radiator
537
535
  http.read_timeout = 10
538
536
  http.open_timeout = 10
539
537
  http.verify_mode = ssl_verify_mode
540
- http.ssl_timeout = 30
538
+ http.ssl_timeout = 30 if defined? http.ssl_timeout
541
539
  http
542
540
  end
543
541
 
@@ -767,12 +765,5 @@ module Radiator
767
765
  @backoff_sleep = nil
768
766
  end
769
767
  end
770
-
771
- def self.finalize(obj)
772
- proc {
773
- puts "DESTROY OBJECT #{obj.inspect}" if ENV['LOG'] == 'TRACE'
774
- obj.shutdown
775
- }
776
- end
777
768
  end
778
769
  end
@@ -50,6 +50,8 @@ module Radiator
50
50
  options = options.merge(url: @url, chain: @chain)
51
51
  @api = Api.new(options)
52
52
  @network_broadcast_api = NetworkBroadcastApi.new(options)
53
+
54
+ ObjectSpace.define_finalizer(self, self.class.finalize(@api, @network_broadcast_api))
53
55
  end
54
56
 
55
57
  def chain_id(chain_id = nil)
@@ -225,5 +227,21 @@ module Radiator
225
227
  ((sig[33] & 0x80 ) != 0)
226
228
  )
227
229
  end
230
+
231
+ def self.finalize(api, network_broadcast_api)
232
+ proc {
233
+ if !!api
234
+ puts "DESTROY: #{api.inspect}" if ENV['LOG'] == 'TRACE'
235
+ api.shutdown
236
+ api = nil
237
+ end
238
+
239
+ if !!network_broadcast_api
240
+ puts "DESTROY: #{network_broadcast_api.inspect}" if ENV['LOG'] == 'TRACE'
241
+ network_broadcast_api.shutdown
242
+ network_broadcast_api = nil
243
+ end
244
+ }
245
+ end
228
246
  end
229
247
  end
@@ -1,4 +1,4 @@
1
1
  module Radiator
2
- VERSION = '0.3.10'
2
+ VERSION = '0.3.11'
3
3
  AGENT_ID = "radiator/#{VERSION}"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: radiator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.10
4
+ version: 0.3.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anthony Martin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-01 00:00:00.000000000 Z
11
+ date: 2017-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler