bridge_api 0.1.54 → 0.1.63

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.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +7 -13
  3. data/README.md +17 -0
  4. data/bridge_api.gemspec +0 -1
  5. data/lib/bridge_api.rb +7 -5
  6. data/lib/bridge_api/api_array.rb +4 -2
  7. data/lib/bridge_api/client.rb +124 -56
  8. data/lib/bridge_api/client/account.rb +2 -1
  9. data/lib/bridge_api/client/affiliation.rb +13 -11
  10. data/lib/bridge_api/client/clone_object.rb +3 -3
  11. data/lib/bridge_api/client/course_template.rb +2 -0
  12. data/lib/bridge_api/client/custom_field.rb +2 -0
  13. data/lib/bridge_api/client/data_dump.rb +2 -0
  14. data/lib/bridge_api/client/enrollment.rb +2 -0
  15. data/lib/bridge_api/client/group.rb +2 -0
  16. data/lib/bridge_api/client/learner_item.rb +2 -0
  17. data/lib/bridge_api/client/live_course.rb +2 -0
  18. data/lib/bridge_api/client/live_course_enrollment.rb +2 -0
  19. data/lib/bridge_api/client/live_course_session.rb +3 -2
  20. data/lib/bridge_api/client/manager.rb +2 -0
  21. data/lib/bridge_api/client/program.rb +3 -1
  22. data/lib/bridge_api/client/program_enrollment.rb +6 -0
  23. data/lib/bridge_api/client/role.rb +2 -0
  24. data/lib/bridge_api/client/sub_account.rb +7 -1
  25. data/lib/bridge_api/client/user.rb +6 -5
  26. data/lib/bridge_api/version.rb +3 -1
  27. data/spec/bridge_api/client/account_spec.rb +6 -6
  28. data/spec/bridge_api/client/affiliations_spec.rb +3 -2
  29. data/spec/bridge_api/client/clone_object_spec.rb +8 -9
  30. data/spec/bridge_api/client/course_template_spec.rb +2 -0
  31. data/spec/bridge_api/client/custom_field_spec.rb +2 -0
  32. data/spec/bridge_api/client/data_dump_spec.rb +2 -0
  33. data/spec/bridge_api/client/enrollment_spec.rb +2 -0
  34. data/spec/bridge_api/client/group_spec.rb +2 -0
  35. data/spec/bridge_api/client/learner_items_spec.rb +2 -0
  36. data/spec/bridge_api/client/live_course_enrollments_spec.rb +2 -0
  37. data/spec/bridge_api/client/live_course_session_spec.rb +5 -3
  38. data/spec/bridge_api/client/live_course_spec.rb +2 -0
  39. data/spec/bridge_api/client/manager_spec.rb +2 -0
  40. data/spec/bridge_api/client/program_enrollment_spec.rb +7 -0
  41. data/spec/bridge_api/client/role_spec.rb +2 -0
  42. data/spec/bridge_api/client/sub_account_spec.rb +6 -4
  43. data/spec/bridge_api/client/user_spec.rb +2 -1
  44. data/spec/bridge_api/client_spec.rb +99 -5
  45. data/spec/support/fake_bridge.rb +8 -2
  46. data/spec/test_helper.rb +3 -1
  47. metadata +53 -68
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'sinatra/base'
2
4
  require 'tilt'
3
5
 
@@ -50,6 +52,10 @@ class FakeBridge < Sinatra::Base
50
52
  get_json_data 200, 'program_enrollments.json'
51
53
  end
52
54
 
55
+ put %r{/api/author/programs/\d+/learners/\d+} do
56
+ get_json_data 200, 'program_enrollments.json'
57
+ end
58
+
53
59
  post %r{/api/author/programs/\d+/learners} do
54
60
  get_json_data 204, nil
55
61
  end
@@ -257,7 +263,7 @@ class FakeBridge < Sinatra::Base
257
263
  get_json_data 200, 'accounts.json'
258
264
  end
259
265
 
260
- #Roles
266
+ # Roles
261
267
  get %r{/api/author/roles} do
262
268
  get_json_data 200, 'roles.json'
263
269
  end
@@ -274,7 +280,7 @@ class FakeBridge < Sinatra::Base
274
280
  get_json_data 204, 'roles.json'
275
281
  end
276
282
 
277
- #Affiliations
283
+ # Affiliations
278
284
  get %r{/api/author/affiliated_sub_accounts} do
279
285
  get_json_data 204, 'affiliations.json'
280
286
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bridge_api'
2
4
  require 'rspec'
3
5
  require 'webmock/rspec'
@@ -9,7 +11,7 @@ RSpec.configure do |config|
9
11
 
10
12
  config.before(:each) do
11
13
  WebMock.disable_net_connect!
12
- WebMock.stub_request(:any, /api\/.*/).to_rack(FakeBridge)
14
+ WebMock.stub_request(:any, %r{api/.*}).to_rack(FakeBridge)
13
15
  end
14
16
  end
15
17
 
metadata CHANGED
@@ -1,35 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bridge_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.54
4
+ version: 0.1.63
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jay Shaffer
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-23 00:00:00.000000000 Z
11
+ date: 2020-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '1.0'
20
17
  - - ">="
21
18
  - !ruby/object:Gem::Version
22
19
  version: 1.0.0
20
+ - - "~>"
21
+ - !ruby/object:Gem::Version
22
+ version: '1.0'
23
23
  type: :development
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - "~>"
28
- - !ruby/object:Gem::Version
29
- version: '1.0'
30
27
  - - ">="
31
28
  - !ruby/object:Gem::Version
32
29
  version: 1.0.0
30
+ - - "~>"
31
+ - !ruby/object:Gem::Version
32
+ version: '1.0'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: byebug
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -104,22 +104,22 @@ dependencies:
104
104
  name: tilt
105
105
  requirement: !ruby/object:Gem::Requirement
106
106
  requirements:
107
- - - ">="
108
- - !ruby/object:Gem::Version
109
- version: 1.3.4
110
107
  - - "~>"
111
108
  - !ruby/object:Gem::Version
112
109
  version: '1.3'
110
+ - - ">="
111
+ - !ruby/object:Gem::Version
112
+ version: 1.3.4
113
113
  type: :development
114
114
  prerelease: false
115
115
  version_requirements: !ruby/object:Gem::Requirement
116
116
  requirements:
117
- - - ">="
118
- - !ruby/object:Gem::Version
119
- version: 1.3.4
120
117
  - - "~>"
121
118
  - !ruby/object:Gem::Version
122
119
  version: '1.3'
120
+ - - ">="
121
+ - !ruby/object:Gem::Version
122
+ version: 1.3.4
123
123
  - !ruby/object:Gem::Dependency
124
124
  name: webmock
125
125
  requirement: !ruby/object:Gem::Requirement
@@ -176,20 +176,6 @@ dependencies:
176
176
  - - ">="
177
177
  - !ruby/object:Gem::Version
178
178
  version: 0.5.1
179
- - !ruby/object:Gem::Dependency
180
- name: logging
181
- requirement: !ruby/object:Gem::Requirement
182
- requirements:
183
- - - ">="
184
- - !ruby/object:Gem::Version
185
- version: 2.2.2
186
- type: :runtime
187
- prerelease: false
188
- version_requirements: !ruby/object:Gem::Requirement
189
- requirements:
190
- - - ">="
191
- - !ruby/object:Gem::Version
192
- version: 2.2.2
193
179
  - !ruby/object:Gem::Dependency
194
180
  name: paul_walker
195
181
  requirement: !ruby/object:Gem::Requirement
@@ -296,7 +282,7 @@ homepage: https://getbridge.com
296
282
  licenses:
297
283
  - MIT
298
284
  metadata: {}
299
- post_install_message:
285
+ post_install_message:
300
286
  rdoc_options: []
301
287
  require_paths:
302
288
  - lib
@@ -311,58 +297,57 @@ required_rubygems_version: !ruby/object:Gem::Requirement
311
297
  - !ruby/object:Gem::Version
312
298
  version: '0'
313
299
  requirements: []
314
- rubyforge_project:
315
- rubygems_version: 2.7.3
316
- signing_key:
300
+ rubygems_version: 3.0.3
301
+ signing_key:
317
302
  specification_version: 4
318
303
  summary: Bridge API
319
304
  test_files:
305
+ - spec/bridge_api/client_spec.rb
306
+ - spec/bridge_api/client/enrollment_spec.rb
307
+ - spec/bridge_api/client/custom_field_spec.rb
320
308
  - spec/bridge_api/client/account_spec.rb
321
- - spec/bridge_api/client/affiliations_spec.rb
309
+ - spec/bridge_api/client/data_dump_spec.rb
310
+ - spec/bridge_api/client/live_course_spec.rb
322
311
  - spec/bridge_api/client/clone_object_spec.rb
323
312
  - spec/bridge_api/client/course_template_spec.rb
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
313
+ - spec/bridge_api/client/affiliations_spec.rb
314
+ - spec/bridge_api/client/sub_account_spec.rb
327
315
  - 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
330
316
  - 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
333
317
  - spec/bridge_api/client/program_enrollment_spec.rb
334
- - spec/bridge_api/client/role_spec.rb
335
- - spec/bridge_api/client/sub_account_spec.rb
336
318
  - 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
341
- - spec/fixtures/course.json
342
- - spec/fixtures/courses.json
343
- - spec/fixtures/custom_fields.json
344
- - spec/fixtures/data_dump.json
345
- - spec/fixtures/data_dumps.json
346
- - spec/fixtures/default_web_conference.json
347
- - spec/fixtures/direct_reports.json
348
- - spec/fixtures/enrollment.json
349
- - spec/fixtures/enrollments.json
350
- - spec/fixtures/group.json
351
- - spec/fixtures/learner_items.json
319
+ - spec/bridge_api/client/role_spec.rb
320
+ - spec/bridge_api/client/manager_spec.rb
321
+ - spec/bridge_api/client/live_course_enrollments_spec.rb
322
+ - spec/bridge_api/client/learner_items_spec.rb
323
+ - spec/support/fake_bridge.rb
324
+ - spec/fixtures/roles.json
352
325
  - spec/fixtures/live_course.json
353
- - spec/fixtures/live_course_enrollments.json
354
- - spec/fixtures/live_course_sessions.json
355
- - spec/fixtures/live_courses.json
356
326
  - spec/fixtures/managers.json
357
327
  - 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
328
+ - spec/fixtures/enrollment.json
363
329
  - spec/fixtures/sub_accounts.json
364
- - spec/fixtures/user.json
365
330
  - spec/fixtures/user_roles_add.json
331
+ - spec/fixtures/course.json
332
+ - spec/fixtures/live_course_sessions.json
333
+ - spec/fixtures/data_dumps.json
366
334
  - spec/fixtures/users.json
367
- - spec/support/fake_bridge.rb
335
+ - spec/fixtures/direct_reports.json
336
+ - spec/fixtures/sub_account_lti_config.json
337
+ - spec/fixtures/user.json
338
+ - spec/fixtures/courses.json
339
+ - spec/fixtures/sub_account_lti_config_update.json
340
+ - spec/fixtures/default_web_conference.json
341
+ - spec/fixtures/programs.json
342
+ - spec/fixtures/learner_items.json
343
+ - spec/fixtures/sub_account_new_lti_config.json
344
+ - spec/fixtures/enrollments.json
345
+ - spec/fixtures/group.json
346
+ - spec/fixtures/affiliations.json
347
+ - spec/fixtures/accounts.json
348
+ - spec/fixtures/live_courses.json
349
+ - spec/fixtures/clone_objects.json
350
+ - spec/fixtures/data_dump.json
351
+ - spec/fixtures/live_course_enrollments.json
352
+ - spec/fixtures/custom_fields.json
368
353
  - spec/test_helper.rb