panda_pal 5.4.0.beta3 → 5.4.0.beta8

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: 605e2398dbff30e4042f696f24e556d5a996c5492f3b3614192a532874b35b3d
4
- data.tar.gz: 630edb6f4af6ca6e7d526b5012ec3171fb3480c0215aab1ec24d2de3d0900d47
3
+ metadata.gz: 81c9272664817b0ae4db2101c6f1452c3745dae5df95b0d3af61608957d190d8
4
+ data.tar.gz: fa2e658b36a2b04ea717f248595f7c512dbcfc9e4992afd4c5bd7897aeeb211b
5
5
  SHA512:
6
- metadata.gz: d25bb33c80372c310a988fa8ecbdb46608e739ebd7aadb8615798129fc0aa9602d0e369f399d9dda950cdd3318c62efa9fe1a94d05aaa39b99d8d2339b0c6c0c
7
- data.tar.gz: 289a25622e81a3ad2df94619821579037141153514288569eb26b4ba660f175fa3c085370a653de66027f1d7468b5cb9b9b60f3eb1b937658e004568494b3c26
6
+ metadata.gz: fc207504f0e723f53ee0b8b3b7ed4d5c1fc83152e4d314642aa619c95f46a57852621de2aa513cbe46bcc3a4cddd9913e6bce946aa54f85d059d3245072681fc
7
+ data.tar.gz: 1e91981cf664f4b1a2d9dbd2a471eb63a1db0ddac62f7f18d7104aae58d8663143c42e1dd591696213e4cf30fe7188af151490d76c85c0cda5c4c3180420ca3e
@@ -1,3 +1,3 @@
1
- //= link_tree ../images
1
+ // link_tree ../images/panda_pal
2
2
  //= link_directory ../javascripts/panda_pal .js
3
3
  //= link_directory ../stylesheets/panda_pal .css
@@ -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
@@ -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
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.to_s.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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module PandaPal
2
- VERSION = "5.4.0.beta3"
2
+ VERSION = "5.4.0.beta8"
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.beta3
4
+ version: 5.4.0.beta8
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-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails