radiator 0.3.2 → 0.3.3

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: 3cb52c16134c84db4c129bc572f45f67ac952bbe
4
- data.tar.gz: 16b6c0642c4f55212b454de1cdba522d8b4fc682
3
+ metadata.gz: 719db03a25998b79ae184e497705f69ee9be274a
4
+ data.tar.gz: d7a1623d3a0759b9c774f66c302678d7bd3013d0
5
5
  SHA512:
6
- metadata.gz: 9e1c75f94f7a6e18fa7015856c3edb24b2886706167db7845ca0384b359ff1717d8de71493e533bc1f3c06bc08f83461141bca46fdc7c925ebfaf4df157e0a66
7
- data.tar.gz: 8f3b4b4b290e149bc91c3c8809f136d518dbd0a7e1ad56d1453fa1ff1053cc4a88845f5a67585ed3b2d593ac513c03ec75a2ba407efcab43a98b68c52d0573bd
6
+ metadata.gz: 82d96f1ce4df03798e7df32af7b9c9ff42ef7bbf4480d196e895541fb4b3420455fed42b9f807177096c8fb2724a1894a04388b16bf7b9a6dfdf6cb5bd93cf30
7
+ data.tar.gz: 8abbb469adcc0c46f637553273867800e62b399feaca4f272c915fae8bb68d49ceed6b9d9f450f2335f7264c43d7d318048a1ef5270283a0b10d379ce079e860
data/Gemfile.lock CHANGED
@@ -1,14 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- radiator (0.3.2)
4
+ radiator (0.3.3)
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)
8
8
  hashie (~> 3.5, >= 3.5.5)
9
9
  json (~> 2.0, >= 2.0.2)
10
10
  logging (~> 2.2, >= 2.2.0)
11
- net-http-persistent (~> 3.0, >= 3.0.0)
11
+ net-http-persistent (>= 2.5.2)
12
12
 
13
13
  GEM
14
14
  remote: https://rubygems.org/
data/lib/radiator/api.rb CHANGED
@@ -508,22 +508,30 @@ module Radiator
508
508
  end
509
509
 
510
510
  def http
511
- @http ||= Net::HTTP::Persistent.new(name: http_id).tap do |http|
512
- idempotent = api_name != :network_broadcast_api
513
- http.keep_alive = 30
514
- http.read_timeout = 10
515
- http.open_timeout = 10
516
- http.idle_timeout = idempotent ? 10 : nil
517
- http.max_requests = @max_requests
518
- http.retry_change_requests = idempotent
511
+ idempotent = api_name != :network_broadcast_api
519
512
 
520
- if flappy?
521
- http.reuse_ssl_sessions = false
522
- http.ssl_version = @ssl_version
523
- else
524
- http.reuse_ssl_sessions = true
525
- end
513
+ @http ||= if defined? Net::HTTP::Persistent::DEFAULT_POOL_SIZE
514
+ Net::HTTP::Persistent.new(name: http_id)
515
+ else
516
+ # net-http-persistent < 3.0
517
+ Net::HTTP::Persistent.new(http_id)
526
518
  end
519
+
520
+ @http.keep_alive = 30
521
+ @http.read_timeout = 10
522
+ @http.open_timeout = 10
523
+ @http.idle_timeout = idempotent ? 10 : nil
524
+ @http.max_requests = @max_requests
525
+ @http.retry_change_requests = idempotent
526
+
527
+ if flappy?
528
+ @http.reuse_ssl_sessions = false
529
+ @http.ssl_version = @ssl_version
530
+ else
531
+ @http.reuse_ssl_sessions = true
532
+ end
533
+
534
+ @http
527
535
  end
528
536
 
529
537
  def post_request
@@ -1,3 +1,3 @@
1
1
  module Radiator
2
- VERSION = '0.3.2'
2
+ VERSION = '0.3.3'
3
3
  end
data/radiator.gemspec CHANGED
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
27
27
  spec.add_development_dependency 'yard', '~> 0.9.9'
28
28
  spec.add_development_dependency 'pry', '~> 0.11.1'
29
29
 
30
- spec.add_dependency('net-http-persistent', '~> 3.0', '>= 3.0.0')
30
+ spec.add_dependency('net-http-persistent', '>= 2.5.2')
31
31
  spec.add_dependency('json', '~> 2.0', '>= 2.0.2')
32
32
  spec.add_dependency('logging', '~> 2.2', '>= 2.2.0')
33
33
  spec.add_dependency('hashie', '~> 3.5', '>= 3.5.5')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: radiator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anthony Martin
@@ -170,22 +170,16 @@ dependencies:
170
170
  name: net-http-persistent
171
171
  requirement: !ruby/object:Gem::Requirement
172
172
  requirements:
173
- - - "~>"
174
- - !ruby/object:Gem::Version
175
- version: '3.0'
176
173
  - - ">="
177
174
  - !ruby/object:Gem::Version
178
- version: 3.0.0
175
+ version: 2.5.2
179
176
  type: :runtime
180
177
  prerelease: false
181
178
  version_requirements: !ruby/object:Gem::Requirement
182
179
  requirements:
183
- - - "~>"
184
- - !ruby/object:Gem::Version
185
- version: '3.0'
186
180
  - - ">="
187
181
  - !ruby/object:Gem::Version
188
- version: 3.0.0
182
+ version: 2.5.2
189
183
  - !ruby/object:Gem::Dependency
190
184
  name: json
191
185
  requirement: !ruby/object:Gem::Requirement