panda_pal 5.4.0.beta4 → 5.4.0.beta9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b8d0d99b021c108beb8e7cf38b2cebe73b3b2d4915fa1e7158e4c1d84e293f0c
4
- data.tar.gz: 55c5f9455f18612d31edd7a73fdb90fa76bbbb352ca9ae4c435f0113660557d6
3
+ metadata.gz: 83ce940ea822b2d77eaeb63a8d6ba7e5ef213151c881a1b1fa872527adac42fd
4
+ data.tar.gz: cc4439a2431281e657deb7c61eaedc9dd0b647593657c8c9e112774cd4b9897f
5
5
  SHA512:
6
- metadata.gz: f1f901c1e650fda7bb0716b4edcb7f67e86be1f85f1f695ce02ba93c2d8b2fb4d4ed4fb62b9ed957521ff8ab62838588bc3fb409fb2d6c75746f884c0b1dd875
7
- data.tar.gz: 8428a86de43f8465fb837efb6306c2e69ccdf3fa5478aab56d740b7476b4938c0fac70a92e7537575c987cefd05e03bb5ba24ffa0b75e0de50483a1182b88a85
6
+ metadata.gz: 0ae381028c6bbac74c6084dc3aa914e50da57c6126bf394f7150e5e98744c8ec5d025abe3111e18a97f076e31fd2b63f1dec5d2496d1cc3032b6e0a8351d1f6a
7
+ data.tar.gz: cda153e9bedb6253d5ab5375657989567ae4cf5e542838d16516a64b1c20cfc2058895504aad10e0e56dfb6a7330c43a467a71be78f192f0c4a221d16ab26f9c
@@ -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
@@ -1,4 +1,17 @@
1
- return unless defined?(Sidekiq.schedule)
1
+ unless defined?(Sidekiq.schedule)
2
+ module PandaPal
3
+ module OrganizationConcerns
4
+ module TaskScheduling
5
+ extend ActiveSupport::Concern
6
+
7
+ included do
8
+ raise "The PandaPal TaskScheduling requires Sidekiq-scheduler to be installed"
9
+ end
10
+ end
11
+ end
12
+ end
13
+ return
14
+ end
2
15
 
3
16
  require_relative 'settings_validation'
4
17
 
data/lib/panda_pal.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  require "panda_pal/engine"
2
2
  require 'panda_pal/plugins'
3
3
  require 'panda_pal/helpers'
4
+ require 'panda_pal/jobs'
4
5
  require 'oauth/request_proxy/rack_request'
5
6
  require 'oauth/request_proxy/action_dispatch_request'
6
7
 
@@ -13,6 +14,7 @@ module PandaPal
13
14
  @@lti_properties = {}
14
15
  @@lti_environments = {}
15
16
  @@lti_custom_params = {}
17
+ @@extensions = {}
16
18
  @@lti_private_key = nil
17
19
 
18
20
  def self.lti_options= lti_options
@@ -70,8 +72,30 @@ module PandaPal
70
72
  @@lti_private_key = k
71
73
  end
72
74
 
75
+ def self.register_extension(type, modul)
76
+ type = normalize_ext_type(type)
77
+ @@extensions[type] ||= []
78
+ @@extensions[type] << modul.to_s
79
+ end
80
+
81
+ def self.extensions_for(type)
82
+ (@@extensions[normalize_ext_type(type)] || []).uniq
83
+ end
84
+
85
+ def self.resolved_extensions_for(type)
86
+ extensions_for(type).map do |ext|
87
+ ext.safe_constantize
88
+ end.compact
89
+ end
90
+
73
91
  private
74
92
 
93
+ def self.normalize_ext_type(type)
94
+ type = type.to_s
95
+ type = "#{self.to_s}::#{type}" unless type.starts_with?('::') || type.starts_with?(self.to_s)
96
+ type
97
+ end
98
+
75
99
  def self.validate_pandapal_config!
76
100
  errors = []
77
101
  validate_lti_navigation(errors)
@@ -89,3 +113,5 @@ module PandaPal
89
113
  errors
90
114
  end
91
115
  end
116
+
117
+ 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
@@ -13,9 +13,13 @@ module PandaPal::Helpers
13
13
  end
14
14
 
15
15
  class_methods do
16
- def link_nonce_type(value = :not_given)
16
+ def link_nonce_type(value = :not_given, use_non_app: false)
17
17
  if value == :not_given
18
- @link_nonce_type || superclass.try(:link_nonce_type) || :nonce
18
+ if use_non_app || !defined?(::ApplicationController) || self <= ::ApplicationController
19
+ @link_nonce_type || superclass.try(:link_nonce_type, use_non_app: true) || :nonce
20
+ else
21
+ ::ApplicationController.link_nonce_type(value, use_non_app: true)
22
+ end
19
23
  else
20
24
  @link_nonce_type = value
21
25
  end
@@ -0,0 +1,3 @@
1
+ module PandaPal::Jobs
2
+ require_relative 'jobs/grade_passback_job'
3
+ end
@@ -1,3 +1,3 @@
1
1
  module PandaPal
2
- VERSION = "5.4.0.beta4"
2
+ VERSION = "5.4.0.beta9"
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.beta4
4
+ version: 5.4.0.beta9
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-08 00:00:00.000000000 Z
11
+ date: 2021-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -244,13 +244,14 @@ files:
244
244
  - db/migrate/20171205183457_encrypt_organization_settings.rb
245
245
  - db/migrate/20171205194657_remove_old_organization_settings.rb
246
246
  - lib/panda_pal.rb
247
- - lib/panda_pal/ability_mixin.rb
248
247
  - lib/panda_pal/engine.rb
249
248
  - lib/panda_pal/helpers.rb
249
+ - lib/panda_pal/helpers/ability_mixin.rb
250
250
  - lib/panda_pal/helpers/controller_helper.rb
251
251
  - lib/panda_pal/helpers/route_helper.rb
252
252
  - lib/panda_pal/helpers/secure_headers.rb
253
253
  - lib/panda_pal/helpers/session_replacement.rb
254
+ - lib/panda_pal/jobs.rb
254
255
  - lib/panda_pal/jobs/grade_passback_job.rb
255
256
  - lib/panda_pal/plugins.rb
256
257
  - lib/panda_pal/version.rb