canvas_sync 0.17.41 → 0.17.42

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: cfa9a724751a0d163496133f4c928f1ccfca544413d668ef045bb30178dd37fc
4
- data.tar.gz: c6107cc707e8474dc23e429760b276d0f91f5e482860cd870b4069279bcc9120
3
+ metadata.gz: 6637b97dd9b51f6d3babe9b022904d9e77b1c886e62707fb857db5caba909fc3
4
+ data.tar.gz: 1bfa80e171b9b92b12ebad2fdc732b558e59fe9271175ce7d1dd2680a81e2b0c
5
5
  SHA512:
6
- metadata.gz: 6750a83429e8004c6c1a46079e349c63b5b14abd6ccc35f33117f74d791030708acd9918fe45f2a78f7da9bb0f07a5f3d2a1cd8990eabceb46541d430ae13719
7
- data.tar.gz: 104ef9be9f7dab34e823f9705595ed4ee411b2ac1ef9a92fd04e4e42861997ccf7d85705765b65c3bad833bb25fa1409fb32354a2d816cd1034f05a94a0e90d1
6
+ metadata.gz: 0af624f526294b480e6b24814ab9156f3970056160eb59e0aafdd9af2849984ef34668099cce16f978257b6311c5fbfe69e2fe9e0bfd52224034c7e8018afbfc
7
+ data.tar.gz: 2d2d89dc832f3cb4d901641f00c930f929ca410f86b2890689909f43fea3fb29d56584fa72c5871382101d946ff7d50fde3d044375ae03d1b8de230bba13788b
@@ -8,6 +8,7 @@ module CanvasSync
8
8
  initializer "canvas_sync.safe_yaml_classes" do |app|
9
9
  app.config.active_record.yaml_column_permitted_classes ||= []
10
10
  app.config.active_record.yaml_column_permitted_classes |= [Symbol, ActiveSupport::HashWithIndifferentAccess]
11
+ ActiveRecord::Base.yaml_column_permitted_classes |= app.config.active_record.yaml_column_permitted_classes
11
12
  rescue
12
13
  end
13
14
 
@@ -40,12 +41,14 @@ module CanvasSync
40
41
 
41
42
  require 'panda_pal'
42
43
 
43
- def canvas_sync_client(account_id = nil)
44
- Bearcat::Client.new(
45
- prefix: current_organization.canvas_url,
46
- token: current_organization.canvas_api_token,
47
- master_rate_limit: (Rails.env.production? && !!defined?(Redis) && ENV['REDIS_URL'].present?),
48
- )
44
+ class ::Object
45
+ def canvas_sync_client(account_id = nil)
46
+ Bearcat::Client.new(
47
+ prefix: current_organization.canvas_url,
48
+ token: current_organization.canvas_api_token,
49
+ master_rate_limit: (Rails.env.production? && !!defined?(Redis) && ENV['REDIS_URL'].present?),
50
+ )
51
+ end
49
52
  end
50
53
  rescue LoadError
51
54
  end
@@ -6,6 +6,10 @@ module CanvasSync
6
6
  def perform(chain_definition, globals = {})
7
7
  @globals = globals
8
8
 
9
+ if globals[:updated_after] == nil && Rails.env.development?
10
+ globals[:updated_after] = false
11
+ end
12
+
9
13
  if globals[:updated_after] == false
10
14
  globals[:updated_after] = nil
11
15
  elsif !globals[:updated_after].present? || globals[:updated_after] == true
@@ -26,7 +26,7 @@ module CanvasSync
26
26
  def download(report_name, report_url)
27
27
  Dir.mktmpdir do |dir|
28
28
  file_path = "#{dir}/#{report_name}"
29
- IO.copy_stream(open(report_url), file_path)
29
+ IO.copy_stream(URI.open(report_url), file_path)
30
30
  yield file_path
31
31
  end
32
32
  end
@@ -35,7 +35,11 @@ module CanvasSync
35
35
 
36
36
  protected
37
37
 
38
- def merge_report_params(options, params={}, term_scope: true)
38
+ # Ruby 3 changed how kwargs are handled. _kw_placeholder allows for backwards compatibility
39
+ # In Ruby 2, merge_report_params(options, params) would parse as merge_report_params(options, params={}, **params) (wtf?), so
40
+ # merge_report_params(options, params, {}) is used. That doesn't work in Ruby 3.
41
+ # In order to maintain compatibility with 2 and with any apps, this oddness is needed
42
+ def merge_report_params(options, params={}, _kw_placeholder=nil, term_scope: true)
39
43
  term_scope = options[:canvas_term_id] || batch_context[:canvas_term_id] if term_scope == true
40
44
  if term_scope.present?
41
45
  params[:enrollment_term_id] = term_scope
@@ -1,3 +1,3 @@
1
1
  module CanvasSync
2
- VERSION = "0.17.41".freeze
2
+ VERSION = "0.17.42".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: canvas_sync
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.41
4
+ version: 0.17.42
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nate Collings
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-12 00:00:00.000000000 Z
11
+ date: 2023-01-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -276,6 +276,20 @@ dependencies:
276
276
  - - ">="
277
277
  - !ruby/object:Gem::Version
278
278
  version: '0'
279
+ - !ruby/object:Gem::Dependency
280
+ name: open-uri
281
+ requirement: !ruby/object:Gem::Requirement
282
+ requirements:
283
+ - - ">="
284
+ - !ruby/object:Gem::Version
285
+ version: '0'
286
+ type: :runtime
287
+ prerelease: false
288
+ version_requirements: !ruby/object:Gem::Requirement
289
+ requirements:
290
+ - - ">="
291
+ - !ruby/object:Gem::Version
292
+ version: '0'
279
293
  - !ruby/object:Gem::Dependency
280
294
  name: activejob
281
295
  requirement: !ruby/object:Gem::Requirement