bridge_api 0.1.51 → 0.1.52
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 +5 -5
- data/README.md +27 -0
- data/build.groovy +11 -0
- data/build.sh +0 -0
- data/lib/bridge_api/client.rb +4 -1
- data/lib/bridge_api/version.rb +1 -1
- metadata +40 -38
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 05b832623d1f8e5efc453150905062690cb9cc8de3408e79ff2f12e7d82a375f
|
4
|
+
data.tar.gz: 0ec417964f3cc021847922edcbe9e2c3b5aaa042fc46382dc48cc36ff54a75c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 06d0df418be4883fe59475f158e228e81486a8ad8c71b663f62fdeb8eafa6e3e9b1133f5cef11fce5fd12283dcc66789dfab66235039b6e730e1f3f29a89b496
|
7
|
+
data.tar.gz: 501849119f3f780f12a2f03c02162a22d36ca77c14ca395479c3808dd6ed568bfd961586c0bf36188f2159ce55b29944cf9521ec8b95583640b2b5ea8b455abf
|
data/README.md
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# Bridge API
|
2
|
+
|
3
|
+
A simple API client for [Bridge LMS](http://getbridge.com/)
|
4
|
+
|
5
|
+
## Usage
|
6
|
+
|
7
|
+
To create a new client:
|
8
|
+
```
|
9
|
+
client = BridgeAPI::Client.new(token: "your bridge api token", prefix: "https://yourdomain.bridgeapp.com")
|
10
|
+
```
|
11
|
+
|
12
|
+
-or-
|
13
|
+
|
14
|
+
```
|
15
|
+
client = BridgeAPI::Client.new(api_key: "your bridge api key", api_secret:
|
16
|
+
"your bridge api secret", prefix: "https://yourdomain.bridgeapp.com")
|
17
|
+
```
|
18
|
+
|
19
|
+
## Additional options
|
20
|
+
|
21
|
+
### Rate Limiting
|
22
|
+
|
23
|
+
If you are using BridgeAPI in a multi-threaded environment where you are
|
24
|
+
instantiating several instances of `client`, you can also supply your client
|
25
|
+
initializer with `master_rate_limit: true`. This will use a redis
|
26
|
+
keystore to track your rate limits across all instances of `client` and
|
27
|
+
properly throttle your application as needed.
|
data/build.groovy
ADDED
data/build.sh
CHANGED
File without changes
|
data/lib/bridge_api/client.rb
CHANGED
@@ -60,8 +60,11 @@ module BridgeAPI
|
|
60
60
|
end
|
61
61
|
|
62
62
|
def enforce_rate_limits
|
63
|
-
return unless BridgeAPI.enforce_rate_limits
|
63
|
+
return unless BridgeAPI.enforce_rate_limits
|
64
|
+
self.current_limit = current_limit
|
65
|
+
return unless current_limit.present?
|
64
66
|
return unless current_limit < BridgeAPI::rate_limit_min
|
67
|
+
|
65
68
|
BridgeAPI.logger.debug("Current LIMIT: #{current_limit}")
|
66
69
|
tts = ((BridgeAPI.rate_limit_min - current_limit) / 5).ceil
|
67
70
|
tts = BridgeAPI.min_sleep_seconds if tts < BridgeAPI.min_sleep_seconds
|
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.52
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jay Shaffer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-01-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -215,8 +215,10 @@ files:
|
|
215
215
|
- Dockerfile
|
216
216
|
- Gemfile
|
217
217
|
- Gemfile.lock
|
218
|
+
- README.md
|
218
219
|
- bin/jenkins
|
219
220
|
- bridge_api.gemspec
|
221
|
+
- build.groovy
|
220
222
|
- build.sh
|
221
223
|
- docker-compose.yml
|
222
224
|
- lib/bridge_api.rb
|
@@ -310,57 +312,57 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
310
312
|
version: '0'
|
311
313
|
requirements: []
|
312
314
|
rubyforge_project:
|
313
|
-
rubygems_version: 2.
|
315
|
+
rubygems_version: 2.7.3
|
314
316
|
signing_key:
|
315
317
|
specification_version: 4
|
316
318
|
summary: Bridge API
|
317
319
|
test_files:
|
318
|
-
- spec/bridge_api/client_spec.rb
|
319
|
-
- spec/bridge_api/client/enrollment_spec.rb
|
320
|
-
- spec/bridge_api/client/custom_field_spec.rb
|
321
320
|
- spec/bridge_api/client/account_spec.rb
|
322
|
-
- spec/bridge_api/client/
|
323
|
-
- spec/bridge_api/client/live_course_spec.rb
|
321
|
+
- spec/bridge_api/client/affiliations_spec.rb
|
324
322
|
- spec/bridge_api/client/clone_object_spec.rb
|
325
323
|
- spec/bridge_api/client/course_template_spec.rb
|
326
|
-
- spec/bridge_api/client/
|
327
|
-
- spec/bridge_api/client/
|
324
|
+
- spec/bridge_api/client/custom_field_spec.rb
|
325
|
+
- spec/bridge_api/client/data_dump_spec.rb
|
326
|
+
- spec/bridge_api/client/enrollment_spec.rb
|
328
327
|
- spec/bridge_api/client/group_spec.rb
|
328
|
+
- spec/bridge_api/client/learner_items_spec.rb
|
329
|
+
- spec/bridge_api/client/live_course_enrollments_spec.rb
|
329
330
|
- spec/bridge_api/client/live_course_session_spec.rb
|
331
|
+
- spec/bridge_api/client/live_course_spec.rb
|
332
|
+
- spec/bridge_api/client/manager_spec.rb
|
330
333
|
- spec/bridge_api/client/program_enrollment_spec.rb
|
331
|
-
- spec/bridge_api/client/user_spec.rb
|
332
334
|
- spec/bridge_api/client/role_spec.rb
|
333
|
-
- spec/bridge_api/client/
|
334
|
-
- spec/bridge_api/client/
|
335
|
-
- spec/bridge_api/
|
336
|
-
- spec/
|
337
|
-
- spec/fixtures/
|
338
|
-
- spec/fixtures/
|
339
|
-
- spec/fixtures/managers.json
|
340
|
-
- spec/fixtures/program_enrollments.json
|
341
|
-
- spec/fixtures/enrollment.json
|
342
|
-
- spec/fixtures/sub_accounts.json
|
343
|
-
- spec/fixtures/user_roles_add.json
|
335
|
+
- spec/bridge_api/client/sub_account_spec.rb
|
336
|
+
- spec/bridge_api/client/user_spec.rb
|
337
|
+
- spec/bridge_api/client_spec.rb
|
338
|
+
- spec/fixtures/accounts.json
|
339
|
+
- spec/fixtures/affiliations.json
|
340
|
+
- spec/fixtures/clone_objects.json
|
344
341
|
- spec/fixtures/course.json
|
345
|
-
- spec/fixtures/live_course_sessions.json
|
346
|
-
- spec/fixtures/data_dumps.json
|
347
|
-
- spec/fixtures/users.json
|
348
|
-
- spec/fixtures/direct_reports.json
|
349
|
-
- spec/fixtures/sub_account_lti_config.json
|
350
|
-
- spec/fixtures/user.json
|
351
342
|
- spec/fixtures/courses.json
|
352
|
-
- spec/fixtures/
|
343
|
+
- spec/fixtures/custom_fields.json
|
344
|
+
- spec/fixtures/data_dump.json
|
345
|
+
- spec/fixtures/data_dumps.json
|
353
346
|
- spec/fixtures/default_web_conference.json
|
354
|
-
- spec/fixtures/
|
355
|
-
- spec/fixtures/
|
356
|
-
- spec/fixtures/sub_account_new_lti_config.json
|
347
|
+
- spec/fixtures/direct_reports.json
|
348
|
+
- spec/fixtures/enrollment.json
|
357
349
|
- spec/fixtures/enrollments.json
|
358
350
|
- spec/fixtures/group.json
|
359
|
-
- spec/fixtures/
|
360
|
-
- spec/fixtures/
|
361
|
-
- spec/fixtures/live_courses.json
|
362
|
-
- spec/fixtures/clone_objects.json
|
363
|
-
- spec/fixtures/data_dump.json
|
351
|
+
- spec/fixtures/learner_items.json
|
352
|
+
- spec/fixtures/live_course.json
|
364
353
|
- spec/fixtures/live_course_enrollments.json
|
365
|
-
- spec/fixtures/
|
354
|
+
- spec/fixtures/live_course_sessions.json
|
355
|
+
- spec/fixtures/live_courses.json
|
356
|
+
- spec/fixtures/managers.json
|
357
|
+
- spec/fixtures/program_enrollments.json
|
358
|
+
- spec/fixtures/programs.json
|
359
|
+
- spec/fixtures/roles.json
|
360
|
+
- spec/fixtures/sub_account_lti_config.json
|
361
|
+
- spec/fixtures/sub_account_lti_config_update.json
|
362
|
+
- spec/fixtures/sub_account_new_lti_config.json
|
363
|
+
- spec/fixtures/sub_accounts.json
|
364
|
+
- spec/fixtures/user.json
|
365
|
+
- spec/fixtures/user_roles_add.json
|
366
|
+
- spec/fixtures/users.json
|
367
|
+
- spec/support/fake_bridge.rb
|
366
368
|
- spec/test_helper.rb
|