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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a572e8a0be0c0e08e88144dcb2e34196a19730b8cfe420853661c77a84ec21ea
4
- data.tar.gz: b0433358360ec8237c68207431aa1d5b268cb11f707c3f64ea2e3067967c8281
3
+ metadata.gz: 98adfee41773a5d279e290d2a14008a10bb5cb6027f18057e7c33a2d67de42ed
4
+ data.tar.gz: 3a3abba018676e340119a0ad2c973d38f3e580de26b97a9580604a024656432a
5
5
  SHA512:
6
- metadata.gz: e37d8c50672547e32348f305ae229f5ac19f8d9c8a576e589fb635ce47fd5315886a0e71bafbfd0978ea3afe50813c53e25d03265ded5b02f3d184e6a535d3e1
7
- data.tar.gz: f6aefbbc962d95bc8770125b3d42be221af98b6a4d598c39f154eefc52d97ea97d245543c54057de0ca61916ea2465ad577a957543ef5ec47b589a1d089e554c
6
+ metadata.gz: 349914e8cee0d596cb27d05be332d1ccd13eb644019e5f69511c5daae99b3007d8e87001f8bbe6a40bab26d27083da692a1f5b0ab961af1338cee93bd06c4312
7
+ data.tar.gz: 94c1e1dc0072eb9d2b642b6d362b10bc17d78fac82cbbfd59b54d7c5155dd6686e8fe42b7a92d3a60c964a2d2b50d8a65f9a3f6859e30a4a5970e9a8e4efed3b
@@ -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
- ApiArray.new(response, api_client)
11
+ self.new(response, api_client)
12
12
  elsif key = array_key(response)
13
- ApiArray.new(response, api_client, key)
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(headers[:link])
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
- private
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
- ApiArray.process_response(response, @api_client)
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(headers[:link])
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(headers[:link])
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
- ApiArray.make_indifferent(response.body)
206
+ self.class.make_indifferent(response.body)
207
207
  elsif response.body.is_a?(Hash) && @array_key
208
- ApiArray.make_indifferent(response.body[@array_key])
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
@@ -1,3 +1,3 @@
1
1
  module Bearcat
2
- VERSION = '1.5.10' unless defined?(Bearcat::VERSION)
2
+ VERSION = '1.5.12' unless defined?(Bearcat::VERSION)
3
3
  end
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.10
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-09-26 00:00:00.000000000 Z
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: