panda_pal 5.4.8 → 5.4.11

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: 54f85983099ebb935266fb0f7a5671dea933b70c02557af3af732dd63b81a603
4
- data.tar.gz: 2566905d0ddd340582f5e2171278c5d2bcde892d374c024cb7deba29b06d711a
3
+ metadata.gz: 405f20d636bb1ef29c5f115bb91679f0a0cb951155bd6d9633c96ec72dcd4a43
4
+ data.tar.gz: 19cb62856f5a5a2184624218fa1a70de353c7a4abc5135133e18089dc99305a7
5
5
  SHA512:
6
- metadata.gz: 9e52048202eda9ba571e496c909dc85cf961d89a45612d5fd5a80c085ee6fd4a83286058df4c0a953c3456ffea31927dfcfc14c77a628468492d6f0ca0bccb20
7
- data.tar.gz: d893fc73823f914ae8590311333660a8100357db27fc2510c1663a36dc8bf905bff4fc0dae1db0091ad8ef9656dec24a46e16e8852d7788cf6cb3b26d27045e8
6
+ metadata.gz: 57524bab33e144b0ba8b8f2a2e792aec57a437234141b65ecb4dcf20c44c7f48989cf1f889802163756824f3cf12af4587f23627931e441f13b3240f68818806
7
+ data.tar.gz: db533926d6f3687bbf233099d904e11b6b507b410ad215e1f8f595450f3bcb1ae486d5cdd04b5bd8beb1f0f7535dc824c98e666c5891e6465cedc5718432e6d7
@@ -1,6 +1,3 @@
1
- require_relative './organization_concerns/settings_validation'
2
- require_relative './organization_concerns/task_scheduling'
3
-
4
1
  module PandaPal
5
2
  module OrganizationConcerns; end
6
3
 
@@ -13,8 +13,6 @@ unless defined?(Sidekiq.schedule)
13
13
  return
14
14
  end
15
15
 
16
- require_relative 'settings_validation'
17
-
18
16
  module PandaPal
19
17
  module OrganizationConcerns
20
18
  module TaskScheduling
@@ -68,6 +66,10 @@ module PandaPal
68
66
  }
69
67
  end
70
68
 
69
+ def task_scheduled?(name_or_method)
70
+ _schedule_descriptors.key?(name_or_method.to_s)
71
+ end
72
+
71
73
  def remove_scheduled_task(name_or_method)
72
74
  dval = _schedule_descriptors.delete(name_or_method.to_s)
73
75
  Rails.logger.warn("No task with key '#{name_or_method}' to delete!") unless dval.present?
@@ -8,6 +8,34 @@ module PandaPal
8
8
  self.session_key ||= SecureRandom.urlsafe_base64(60)
9
9
  end
10
10
 
11
- serialize :data, Hash
11
+ class DataSerializer
12
+ def self.load(str)
13
+ return {} unless str.present?
14
+ begin
15
+ parsed = JSON.parse(str)
16
+ rescue JSON::ParserError
17
+ parsed = yaml_load(str)
18
+ end
19
+ parsed.is_a?(Hash) ? HashWithIndifferentAccess.new(parsed) : parsed
20
+ end
21
+
22
+ def self.dump(obj)
23
+ JSON.dump(obj)
24
+ end
25
+
26
+ private
27
+
28
+ if YAML.respond_to?(:unsafe_load)
29
+ def self.yaml_load(payload)
30
+ YAML.unsafe_load(payload)
31
+ end
32
+ else
33
+ def self.yaml_load(payload)
34
+ YAML.load(payload)
35
+ end
36
+ end
37
+ end
38
+
39
+ serialize :data, DataSerializer
12
40
  end
13
41
  end
@@ -61,7 +61,7 @@ module PandaPal::Helpers
61
61
  end
62
62
 
63
63
  def current_session_data
64
- current_session.data&.with_indifferent_access
64
+ current_session.data
65
65
  end
66
66
 
67
67
  def session_changed?
@@ -1,3 +1,3 @@
1
1
  module PandaPal
2
- VERSION = "5.4.8"
2
+ VERSION = "5.4.11"
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.8
4
+ version: 5.4.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Instructure ProServe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-03 00:00:00.000000000 Z
11
+ date: 2022-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails