panda_pal 5.4.0.beta6 → 5.4.0

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: 2ad739feb20cd4db69778441ccc21256211d3a8715b1ea82921a9786ed1d6f44
4
- data.tar.gz: 6d0e6927cd23b2a56336a0a9e3dbfda787cb59415c13d1fc4eb316e1c87c400c
3
+ metadata.gz: 52f9acd1140343a82865441f59754c28df08780876b234cad3f7cbfdaa8a1261
4
+ data.tar.gz: 33c8718d1171d76b38ba8e77793de352bacc03f1f7c6fa2da31e2f69b412e609
5
5
  SHA512:
6
- metadata.gz: 9389b4e09c6fb0c270c7cb1c641bbe4cdc010b9084b51519100dfdf9cd4c103e36a8f0d86819d6619e2dc27f42afa52d214c7936c75c120ce6c994ca30ce1e21
7
- data.tar.gz: 4fe4207ca646e48c6d13dfe7b259d306066b812b3a1502fb866f0501cffcb43dc4e935c8cd3ad198980d16582125441e5eb11c94601d6a3f3cad12e60c900c5e
6
+ metadata.gz: c68e57f0abcd6e2f46a22f15757294c0b9002039a61e7e66cda233edcf2cf0a26eda9247520f163b37ce3b9c56f1be2b09705fe59fa031c2be70d0065db60e49
7
+ data.tar.gz: 87c0bb93619507cd6e90c7b3dd1726a5522e6ceb0eaa7ee898c836953080c7ec941e7ddda489e6482d55388c582a61915018730dba7c4f845bf73b2a572c135d
@@ -4,10 +4,10 @@ module PandaPal::Jobs
4
4
  class GradePassbackFailure < StandardError; end
5
5
 
6
6
  class GradePassbackJob < ActiveJob::Base
7
- sidekiq_options retry: 5
8
-
9
7
  attr_accessor :organization, :opts
10
8
 
9
+ sidekiq_options(retry: 5) if respond_to?(:sidekiq_options)
10
+
11
11
  # Required values for opts: passback_guid, passback_url, score AND/OR total_score.
12
12
  # Possible values for opts: cdata_text, text, url, submitted_at, lti_launch_url.
13
13
  # passback_guid is sent in launch params as 'lis_result_sourcedid'.
@@ -49,6 +49,10 @@ module PandaPal
49
49
  end
50
50
  end
51
51
 
52
+ PandaPal.resolved_extensions_for(self).each do |ext|
53
+ include ext
54
+ end
55
+
52
56
  private
53
57
 
54
58
  def create_schema
data/lib/panda_pal.rb CHANGED
@@ -13,6 +13,7 @@ module PandaPal
13
13
  @@lti_properties = {}
14
14
  @@lti_environments = {}
15
15
  @@lti_custom_params = {}
16
+ @@extensions = {}
16
17
  @@lti_private_key = nil
17
18
 
18
19
  def self.lti_options= lti_options
@@ -70,8 +71,30 @@ module PandaPal
70
71
  @@lti_private_key = k
71
72
  end
72
73
 
74
+ def self.register_extension(type, modul)
75
+ type = normalize_ext_type(type)
76
+ @@extensions[type] ||= []
77
+ @@extensions[type] << modul.to_s
78
+ end
79
+
80
+ def self.extensions_for(type)
81
+ (@@extensions[normalize_ext_type(type)] || []).uniq
82
+ end
83
+
84
+ def self.resolved_extensions_for(type)
85
+ extensions_for(type).map do |ext|
86
+ ext.safe_constantize
87
+ end.compact
88
+ end
89
+
73
90
  private
74
91
 
92
+ def self.normalize_ext_type(type)
93
+ type = type.to_s
94
+ type = "#{self.to_s}::#{type}" unless type.starts_with?('::') || type.starts_with?(self.to_s)
95
+ type
96
+ end
97
+
75
98
  def self.validate_pandapal_config!
76
99
  errors = []
77
100
  validate_lti_navigation(errors)
@@ -89,3 +112,5 @@ module PandaPal
89
112
  errors
90
113
  end
91
114
  end
115
+
116
+ PandaPal.register_extension 'Organization', '::OrganizationExtension'
@@ -43,6 +43,10 @@ module PandaPal
43
43
  ActiveSupport.on_load(:active_record) do
44
44
  if defined?(Sidekiq) && Sidekiq.server? && PandaPal::Organization.respond_to?(:sync_schedules)
45
45
  PandaPal::Organization.sync_schedules
46
+
47
+ ActiveSupport::Reloader.to_prepare do
48
+ PandaPal::Organization.sync_schedules
49
+ end
46
50
  end
47
51
  end
48
52
  end
@@ -2,4 +2,5 @@ module PandaPal::Helpers
2
2
  require_relative 'helpers/controller_helper'
3
3
  require_relative 'helpers/route_helper'
4
4
  require_relative 'helpers/secure_headers'
5
+ require_relative 'helpers/ability_mixin'
5
6
  end
@@ -14,14 +14,14 @@ module PandaPal::Helpers
14
14
 
15
15
  class_methods do
16
16
  def link_nonce_type(value = :not_given, use_non_app: false)
17
- if use_non_app || !defined?(::ApplicationController) || self <= ::ApplicationController
18
- if value == :not_given
19
- @link_nonce_type || superclass.try(:link_nonce_type) || :nonce
17
+ if value == :not_given
18
+ if use_non_app || !defined?(::ApplicationController) || self <= ::ApplicationController
19
+ @link_nonce_type || superclass.try(:link_nonce_type, use_non_app: true) || :nonce
20
20
  else
21
- @link_nonce_type = value
21
+ ::ApplicationController.link_nonce_type(value, use_non_app: true)
22
22
  end
23
23
  else
24
- ::ApplicationController.link_nonce_type(value, use_non_app: true)
24
+ @link_nonce_type = value
25
25
  end
26
26
  end
27
27
  end
@@ -1,3 +1,3 @@
1
1
  module PandaPal
2
- VERSION = "5.4.0.beta6"
2
+ VERSION = "5.4.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: panda_pal
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.4.0.beta6
4
+ version: 5.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Instructure ProServe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-13 00:00:00.000000000 Z
11
+ date: 2021-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -218,6 +218,7 @@ files:
218
218
  - app/controllers/panda_pal/lti_v1_p0_controller.rb
219
219
  - app/controllers/panda_pal/lti_v1_p3_controller.rb
220
220
  - app/helpers/panda_pal/application_helper.rb
221
+ - app/jobs/panda_pal/jobs/grade_passback_job.rb
221
222
  - app/lib/lti_xml/base_platform.rb
222
223
  - app/lib/lti_xml/bridge_platform.rb
223
224
  - app/lib/lti_xml/canvas_platform.rb
@@ -244,14 +245,13 @@ files:
244
245
  - db/migrate/20171205183457_encrypt_organization_settings.rb
245
246
  - db/migrate/20171205194657_remove_old_organization_settings.rb
246
247
  - lib/panda_pal.rb
247
- - lib/panda_pal/ability_mixin.rb
248
248
  - lib/panda_pal/engine.rb
249
249
  - lib/panda_pal/helpers.rb
250
+ - lib/panda_pal/helpers/ability_mixin.rb
250
251
  - lib/panda_pal/helpers/controller_helper.rb
251
252
  - lib/panda_pal/helpers/route_helper.rb
252
253
  - lib/panda_pal/helpers/secure_headers.rb
253
254
  - lib/panda_pal/helpers/session_replacement.rb
254
- - lib/panda_pal/jobs/grade_passback_job.rb
255
255
  - lib/panda_pal/plugins.rb
256
256
  - lib/panda_pal/version.rb
257
257
  - lib/tasks/panda_pal_tasks.rake
@@ -315,9 +315,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
315
315
  version: '0'
316
316
  required_rubygems_version: !ruby/object:Gem::Requirement
317
317
  requirements:
318
- - - ">"
318
+ - - ">="
319
319
  - !ruby/object:Gem::Version
320
- version: 1.3.1
320
+ version: '0'
321
321
  requirements: []
322
322
  rubygems_version: 3.0.3
323
323
  signing_key: