radiator 0.3.14 → 0.3.15

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: 0db00c90a07862e3bb92b0ce2e6add02ab0e0b0c
4
- data.tar.gz: de07643e3376f9f5e05c80d74f9a0b6bdc433689
3
+ metadata.gz: a2d13a99e9a18133d52e256663cd27bb52e77d15
4
+ data.tar.gz: 5e986442c8577f297c1636f41fcd849f199ade9c
5
5
  SHA512:
6
- metadata.gz: 1592bc3aedc5eff5276f347907f6d741e82ae8b37539ac6d668fe8d68c165501505612cc4ccc375b1d9ded797f318cb7ca6b9fbb8fbb148ae3eff5016be567ea
7
- data.tar.gz: 3f4596f76c97708d78bc4520313fd73dd65466350cb14241b6549ea3b05e1342bca62d740c4e8b2c60d47fbbb78dc9cd148de8084f506e4424f5ccb9884bbfcc
6
+ metadata.gz: 73fd7dc83bcf3426ff096ab659ecbfb7f7108b8db2572fa238d82bbf9d8cb88ec65bacd166adb772404370110030400dad8f9493cf2fba09efc962cdf947f972
7
+ data.tar.gz: f81a73d0a4e8cf45163b43b12126fa89e1d2ad6a094ad0a2b111b826bb6183300c08a045b2f1b2331a8a7aee99fccf66f9df30e7a1223bf1ba06a6eef7e8358a
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- radiator (0.3.14)
4
+ radiator (0.3.15)
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,6 +250,8 @@ 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(@logger, @hashie_logger))
253
255
  end
254
256
 
255
257
  # Get a specific block or range of blocks.
@@ -801,5 +803,17 @@ module Radiator
801
803
  @backoff_sleep = nil
802
804
  end
803
805
  end
806
+
807
+ def self.finalize(logger, hashie_logger)
808
+ proc {
809
+ if !!logger && defined?(logger.close) && !logger.closed?
810
+ logger.close
811
+ end
812
+
813
+ if !!hashie_logger && defined?(hashie_logger.close) && !hashie_logger.closed?
814
+ hashie_logger.close
815
+ end
816
+ }
817
+ end
804
818
  end
805
819
  end
@@ -58,7 +58,7 @@ module Radiator
58
58
  @api = Api.new(options)
59
59
  @network_broadcast_api = NetworkBroadcastApi.new(options)
60
60
 
61
- ObjectSpace.define_finalizer(self, self.class.finalize(@api, @network_broadcast_api))
61
+ ObjectSpace.define_finalizer(self, self.class.finalize(@api, @network_broadcast_api, @logger))
62
62
  end
63
63
 
64
64
  def chain_id(chain_id = nil)
@@ -242,7 +242,7 @@ module Radiator
242
242
  )
243
243
  end
244
244
 
245
- def self.finalize(api, network_broadcast_api)
245
+ def self.finalize(api, network_broadcast_api, logger)
246
246
  proc {
247
247
  if !!api && !api.stopped?
248
248
  puts "DESTROY: #{api.inspect}" if ENV['LOG'] == 'TRACE'
@@ -255,6 +255,10 @@ module Radiator
255
255
  network_broadcast_api.shutdown
256
256
  network_broadcast_api = nil
257
257
  end
258
+
259
+ if !!logger && defined?(logger.close) && !logger.closed?
260
+ logger.close
261
+ end
258
262
  }
259
263
  end
260
264
  end
@@ -1,4 +1,4 @@
1
1
  module Radiator
2
- VERSION = '0.3.14'
2
+ VERSION = '0.3.15'
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.14
4
+ version: 0.3.15
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-27 00:00:00.000000000 Z
11
+ date: 2017-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler