panda_pal 5.4.0.beta7 → 5.4.0.beta8
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 +4 -4
- data/app/models/panda_pal/organization.rb +4 -0
- data/lib/panda_pal.rb +25 -0
- data/lib/panda_pal/engine.rb +4 -0
- data/lib/panda_pal/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 81c9272664817b0ae4db2101c6f1452c3745dae5df95b0d3af61608957d190d8
|
4
|
+
data.tar.gz: fa2e658b36a2b04ea717f248595f7c512dbcfc9e4992afd4c5bd7897aeeb211b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc207504f0e723f53ee0b8b3b7ed4d5c1fc83152e4d314642aa619c95f46a57852621de2aa513cbe46bcc3a4cddd9913e6bce946aa54f85d059d3245072681fc
|
7
|
+
data.tar.gz: 1e91981cf664f4b1a2d9dbd2a471eb63a1db0ddac62f7f18d7104aae58d8663143c42e1dd591696213e4cf30fe7188af151490d76c85c0cda5c4c3180420ca3e
|
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'
|
data/lib/panda_pal/engine.rb
CHANGED
@@ -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
|
data/lib/panda_pal/version.rb
CHANGED