bridge_api 0.1.35 → 0.1.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/bridge_api/client.rb +4 -4
- data/lib/bridge_api/version.rb +1 -1
- metadata +2 -3
- data/.byebug_history +0 -33
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e190d33cc89910b4490e64a7b460019cffc472d8
|
4
|
+
data.tar.gz: a7164182d78d0f3983612230a906dc416d9e58f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d622cfc13a8616da819ce15684194711f326051028ccc0090a2be459070542ca7a487b549bce73b6dca3f564963f30d780efda8adaa9883f12e1e1a430f69b34
|
7
|
+
data.tar.gz: 6db35ec490c5d51d938c82b73a1673d18a53a0d69e97fae8c49ca4629798b1377780caae6dd985b35c9c6b5e493e3c86a30253ca27bda2bc2c0c60e47d85a2da
|
data/lib/bridge_api/client.rb
CHANGED
@@ -11,8 +11,6 @@ module BridgeAPI
|
|
11
11
|
class Client < Footrest::Client
|
12
12
|
require 'bridge_api/api_array'
|
13
13
|
|
14
|
-
attr_accessor :rate_limit_remaining
|
15
|
-
|
16
14
|
DATA_DUMP_DOWNLOAD_PATH = '/data_dumps/download'.freeze
|
17
15
|
DATA_DUMP_PATH = '/data_dumps'.freeze
|
18
16
|
COURSE_TEMPLATE_PATH = '/course_templates'.freeze
|
@@ -52,7 +50,7 @@ module BridgeAPI
|
|
52
50
|
end
|
53
51
|
|
54
52
|
def enforce_rate_limits
|
55
|
-
return unless BridgeAPI.enforce_rate_limits && current_limit
|
53
|
+
return unless BridgeAPI.enforce_rate_limits && !current_limit.nil?
|
56
54
|
return unless current_limit < BridgeAPI::rate_limit_min
|
57
55
|
tts = ((BridgeAPI.rate_limit_min - current_limit) / 5).ceil
|
58
56
|
tts = BridgeAPI.min_sleep_seconds if tts < BridgeAPI.min_sleep_seconds
|
@@ -65,7 +63,9 @@ module BridgeAPI
|
|
65
63
|
end
|
66
64
|
|
67
65
|
def apply_rate_limits(response)
|
68
|
-
|
66
|
+
limit = response.headers['x-rate-limit-remaining']
|
67
|
+
return if limit.nil?
|
68
|
+
self.current_limit = limit.to_i
|
69
69
|
end
|
70
70
|
|
71
71
|
def current_limit
|
data/lib/bridge_api/version.rb
CHANGED
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.
|
4
|
+
version: 0.1.36
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jay Shaffer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-07-
|
11
|
+
date: 2018-07-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -197,7 +197,6 @@ executables: []
|
|
197
197
|
extensions: []
|
198
198
|
extra_rdoc_files: []
|
199
199
|
files:
|
200
|
-
- ".byebug_history"
|
201
200
|
- ".gitignore"
|
202
201
|
- Dockerfile
|
203
202
|
- Gemfile
|
data/.byebug_history
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
step 200000000
|
2
|
-
exit
|
3
|
-
(BridgeAPI.rate_limit_min - current_limit)
|
4
|
-
((BridgeAPI.rate_limit_min - current_limit) / 5)
|
5
|
-
((BridgeAPI.rate_limit_min - current_limit) / 5).ceil
|
6
|
-
step 200000000
|
7
|
-
((BridgeAPI.rate_limit_min - current_limit) / 5).ceil
|
8
|
-
((BridgeAPI.rate_limit_min - current_limit) / 5)
|
9
|
-
step 20000000
|
10
|
-
exit
|
11
|
-
config
|
12
|
-
step 20000000
|
13
|
-
step 20000000\
|
14
|
-
step 20000000
|
15
|
-
exit
|
16
|
-
current_limit
|
17
|
-
step 20000000
|
18
|
-
n
|
19
|
-
step 20000000
|
20
|
-
n
|
21
|
-
exit
|
22
|
-
BridgeAPI.methods
|
23
|
-
self.class.parent
|
24
|
-
self.class.superclass
|
25
|
-
self.class.base
|
26
|
-
self.class.super
|
27
|
-
self.class
|
28
|
-
self.methods
|
29
|
-
self.class::enforce_rate_limits
|
30
|
-
self.class::@enforce_rate_limits
|
31
|
-
self.class::enforce_rate_limits
|
32
|
-
self.class.methods
|
33
|
-
self.class
|