bearcat 1.5.10 → 1.5.12
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/client/sis_imports.rb +14 -0
- data/lib/bearcat/version.rb +1 -1
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 98adfee41773a5d279e290d2a14008a10bb5cb6027f18057e7c33a2d67de42ed
|
4
|
+
data.tar.gz: 3a3abba018676e340119a0ad2c973d38f3e580de26b97a9580604a024656432a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 349914e8cee0d596cb27d05be332d1ccd13eb644019e5f69511c5daae99b3007d8e87001f8bbe6a40bab26d27083da692a1f5b0ab961af1338cee93bd06c4312
|
7
|
+
data.tar.gz: 94c1e1dc0072eb9d2b642b6d362b10bc17d78fac82cbbfd59b54d7c5155dd6686e8fe42b7a92d3a60c964a2d2b50d8a65f9a3f6859e30a4a5970e9a8e4efed3b
|
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
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Bearcat
|
2
|
+
class Client < Footrest::Client
|
3
|
+
module SisImports
|
4
|
+
def import_sis_data(account, file, options = {}, content_type: nil)
|
5
|
+
options['attachment'] = Faraday::UploadIO.new(file, content_type || "application/zip")
|
6
|
+
post("/api/v1/accounts/#{account}/sis_imports", options)
|
7
|
+
end
|
8
|
+
|
9
|
+
def sis_import_status(account, sis_id, options = {})
|
10
|
+
get("/api/v1/accounts/#{account}/sis_imports/#{sis_id}", options)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
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.12
|
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-11-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -199,6 +199,7 @@ files:
|
|
199
199
|
- lib/bearcat/client/rubric_association.rb
|
200
200
|
- lib/bearcat/client/search.rb
|
201
201
|
- lib/bearcat/client/sections.rb
|
202
|
+
- lib/bearcat/client/sis_imports.rb
|
202
203
|
- lib/bearcat/client/submissions.rb
|
203
204
|
- lib/bearcat/client/tabs.rb
|
204
205
|
- lib/bearcat/client/users.rb
|
@@ -411,10 +412,10 @@ files:
|
|
411
412
|
- spec/fixtures/user_page_views.json
|
412
413
|
- spec/fixtures/user_profile.json
|
413
414
|
- spec/helper.rb
|
414
|
-
homepage:
|
415
|
+
homepage:
|
415
416
|
licenses: []
|
416
417
|
metadata: {}
|
417
|
-
post_install_message:
|
418
|
+
post_install_message:
|
418
419
|
rdoc_options: []
|
419
420
|
require_paths:
|
420
421
|
- lib
|
@@ -430,7 +431,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
430
431
|
version: '0'
|
431
432
|
requirements: []
|
432
433
|
rubygems_version: 3.1.6
|
433
|
-
signing_key:
|
434
|
+
signing_key:
|
434
435
|
specification_version: 4
|
435
436
|
summary: Canvas API
|
436
437
|
test_files:
|