bearcat 1.5.10 → 1.5.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bearcat/api_array.rb +9 -9
- data/lib/bearcat/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ed75a573ba7cbabb73f5450ed2e7cf4998327f9663df1baf294b56dd61556f9
|
4
|
+
data.tar.gz: 181f1b84160f1fbb3eabedf327cecf36794986dbf236739c35d22d01466ac8c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 757dc798db47650488d3faef6b57269e190bfca786e20b4ab20809d6bfc3061007cd238b4264495d8eca46891a89c2c1448e56c0ff83dde85f2a8c84fb020ccf
|
7
|
+
data.tar.gz: 89e16ec48c0116812fb423ab407a66142f14fb26896ff2288b2e14a3a5eee6d89e2e78c5746a93db6f3ee30cf8e1fb38ed4b2d4f83dcacfe3e6c1cfc7855ff10
|
data/lib/bearcat/api_array.rb
CHANGED
@@ -8,9 +8,9 @@ module Bearcat
|
|
8
8
|
|
9
9
|
def self.process_response(response, api_client)
|
10
10
|
if response.body.is_a?(Array)
|
11
|
-
|
11
|
+
self.new(response, api_client)
|
12
12
|
elsif key = array_key(response)
|
13
|
-
|
13
|
+
self.new(response, api_client, key)
|
14
14
|
else
|
15
15
|
make_indifferent(response.body)
|
16
16
|
end
|
@@ -35,7 +35,7 @@ module Bearcat
|
|
35
35
|
case response.status
|
36
36
|
when 200..206
|
37
37
|
@members = process_body(response)
|
38
|
-
init_pages
|
38
|
+
init_pages
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
@@ -110,7 +110,7 @@ module Bearcat
|
|
110
110
|
self
|
111
111
|
end
|
112
112
|
|
113
|
-
|
113
|
+
protected
|
114
114
|
|
115
115
|
def init_pages(link_header = headers[:link])
|
116
116
|
@link_hash = {}
|
@@ -145,7 +145,7 @@ module Bearcat
|
|
145
145
|
def load_page(rel)
|
146
146
|
if @link_hash.has_key? rel
|
147
147
|
response = get_page(@link_hash[rel])
|
148
|
-
|
148
|
+
self.class.process_response(response, @api_client)
|
149
149
|
end
|
150
150
|
end
|
151
151
|
|
@@ -156,7 +156,7 @@ module Bearcat
|
|
156
156
|
@page_count = per_page
|
157
157
|
@raw_response = response = get_page(@link_hash['first'])
|
158
158
|
yield response
|
159
|
-
init_pages
|
159
|
+
init_pages
|
160
160
|
else
|
161
161
|
yield @raw_response
|
162
162
|
end
|
@@ -164,7 +164,7 @@ module Bearcat
|
|
164
164
|
while @link_hash['next']
|
165
165
|
@raw_response = response = get_page(@link_hash['next'])
|
166
166
|
yield response
|
167
|
-
init_pages
|
167
|
+
init_pages
|
168
168
|
end
|
169
169
|
end
|
170
170
|
|
@@ -203,9 +203,9 @@ module Bearcat
|
|
203
203
|
|
204
204
|
def process_body(response)
|
205
205
|
if response.body.is_a?(Array)
|
206
|
-
|
206
|
+
self.class.make_indifferent(response.body)
|
207
207
|
elsif response.body.is_a?(Hash) && @array_key
|
208
|
-
|
208
|
+
self.class.make_indifferent(response.body[@array_key])
|
209
209
|
end
|
210
210
|
end
|
211
211
|
end
|
data/lib/bearcat/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bearcat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Instructure CustomDev
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -411,10 +411,10 @@ files:
|
|
411
411
|
- spec/fixtures/user_page_views.json
|
412
412
|
- spec/fixtures/user_profile.json
|
413
413
|
- spec/helper.rb
|
414
|
-
homepage:
|
414
|
+
homepage:
|
415
415
|
licenses: []
|
416
416
|
metadata: {}
|
417
|
-
post_install_message:
|
417
|
+
post_install_message:
|
418
418
|
rdoc_options: []
|
419
419
|
require_paths:
|
420
420
|
- lib
|
@@ -430,7 +430,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
430
430
|
version: '0'
|
431
431
|
requirements: []
|
432
432
|
rubygems_version: 3.1.6
|
433
|
-
signing_key:
|
433
|
+
signing_key:
|
434
434
|
specification_version: 4
|
435
435
|
summary: Canvas API
|
436
436
|
test_files:
|