bridge_api 0.1.52 → 0.1.53

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
  SHA256:
3
- metadata.gz: 05b832623d1f8e5efc453150905062690cb9cc8de3408e79ff2f12e7d82a375f
4
- data.tar.gz: 0ec417964f3cc021847922edcbe9e2c3b5aaa042fc46382dc48cc36ff54a75c4
3
+ metadata.gz: a747c2ace7fb00d9374078f2ea7f15a8024adcadc3fa3b0b1b61b2d9cc431446
4
+ data.tar.gz: 232e795f2ac605de1bcb2b22dbae65e1355e6f35f9895e3544e392d344f9b968
5
5
  SHA512:
6
- metadata.gz: 06d0df418be4883fe59475f158e228e81486a8ad8c71b663f62fdeb8eafa6e3e9b1133f5cef11fce5fd12283dcc66789dfab66235039b6e730e1f3f29a89b496
7
- data.tar.gz: 501849119f3f780f12a2f03c02162a22d36ca77c14ca395479c3808dd6ed568bfd961586c0bf36188f2159ce55b29944cf9521ec8b95583640b2b5ea8b455abf
6
+ metadata.gz: d3bfd2c5c66bd5e3f20ddd2bc221ac4b69c3f14d53d5c4553d6a130795bb23971bf4c162d23b9a4ae7b43f8bee9ca8547973fa2cd4fe6dacc31ab0cd37172390
7
+ data.tar.gz: e11c84963f136ce9613b5bdaa445810aa8aa0eff47e6c5c5037b8ab5536fe2cfc94d6e77b4df7fd8fdaca3c67869caf19bf79f6492186e7f757f1d3d86bc823b
@@ -104,9 +104,12 @@ module BridgeAPI
104
104
  p = CGI.parse(query).merge(params)
105
105
  u = url.gsub("?#{query}", '')
106
106
  p.each { |k, v| p[k] = v.first if v.is_a?(Array) }
107
- @api_client.connection.send(:get) do |r|
107
+ @api_client.enforce_rate_limits
108
+ response = @api_client.connection.send(:get) do |r|
108
109
  r.url(u, p)
109
110
  end
111
+ @api_client.apply_rate_limits(response)
112
+ response
110
113
  end
111
114
 
112
115
  def load_page(url)
@@ -60,9 +60,7 @@ module BridgeAPI
60
60
  end
61
61
 
62
62
  def enforce_rate_limits
63
- return unless BridgeAPI.enforce_rate_limits
64
- self.current_limit = current_limit
65
- return unless current_limit.present?
63
+ return unless BridgeAPI.enforce_rate_limits && current_limit.present?
66
64
  return unless current_limit < BridgeAPI::rate_limit_min
67
65
 
68
66
  BridgeAPI.logger.debug("Current LIMIT: #{current_limit}")
@@ -1,3 +1,3 @@
1
1
  module BridgeAPI
2
- VERSION = '0.1.52'.freeze unless defined?(BridgeAPI::VERSION)
2
+ VERSION = '0.1.53'.freeze unless defined?(BridgeAPI::VERSION)
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bridge_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.52
4
+ version: 0.1.53
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jay Shaffer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-21 00:00:00.000000000 Z
11
+ date: 2019-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler