auxilium 3.0.24 → 3.0.30

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: eb92dcedcc80162b42e9144c2337b19b0c78d568b9e13fc2e0a3b9a8e50ae4e2
4
- data.tar.gz: c392c88f1c090d409a43821b19ad50f272dad09f0704616f8e05f0a0f2e81e70
3
+ metadata.gz: b89d012f40a935b2cabb55fa5b7b42be362b22df1a671d44da81f2930b5826a4
4
+ data.tar.gz: 801a1b9b7ed8287ae037820949ca46b9c98ed1e1c2762051cd5dff49d3caeb3d
5
5
  SHA512:
6
- metadata.gz: f060a273e1d6ab0e406931a8d7a57bfdb7cc773c2bfb95f150b66158386e745fef3f09a9f560e4b7461a0f9e4150dd5a8d90574b19517ac1b342658673cff896
7
- data.tar.gz: 002030ab34ca8105b98dd653c6fbb3c2f1fe4a77abf82c2aac2366a14c88c87bdb1a3d352858fc1cd6a5845dfde5ac3fa80216bce28d9c73817f7197b2dc6f25
6
+ metadata.gz: e637f59e510c8271d6192731f813064e39466f0501ae41aa112a76975fc5d8bf21eb8bfa7b8e390827eee9b26a3c8cfbb628ac7f849a81e440c0be8386f83454
7
+ data.tar.gz: d732a9eb80da40fcbd726838f998ef40aecc520e5c3be1aae72963d86876207ef40f7c11f31cc545a973ab88d5e0e27c3e799aa1a0cb3a340316129c6a2fa217
@@ -0,0 +1,11 @@
1
+ name: Rubygem Push
2
+ on:
3
+ push:
4
+ tags:
5
+ - '*'
6
+ jobs:
7
+ build:
8
+ uses: entdec/_workflows/.github/workflows/gem-push.yml@main
9
+ with:
10
+ public: true
11
+ secrets: inherit
data/Gemfile.lock CHANGED
@@ -10,7 +10,7 @@ GIT
10
10
  PATH
11
11
  remote: .
12
12
  specs:
13
- auxilium (3.0.24)
13
+ auxilium (3.0.27)
14
14
  actionpack (> 5.1)
15
15
  activemodel (> 5.1)
16
16
  activesupport (> 5.1)
@@ -74,7 +74,7 @@ GEM
74
74
  pry (0.14.1)
75
75
  coderay (~> 1.1)
76
76
  method_source (~> 1.0)
77
- pundit (2.2.0)
77
+ pundit (2.3.1)
78
78
  activesupport (>= 3.0.0)
79
79
  racc (1.6.0)
80
80
  rack (2.2.4)
@@ -98,7 +98,7 @@ GEM
98
98
  reverse_markdown (2.1.1)
99
99
  nokogiri
100
100
  rexml (3.2.5)
101
- rolify (6.0.0)
101
+ rolify (6.0.1)
102
102
  rubocop (1.37.1)
103
103
  json (~> 2.3)
104
104
  parallel (~> 1.10)
@@ -28,6 +28,10 @@ module Auxilium
28
28
  YAML.dump(attributes['metadata'])
29
29
  end
30
30
  end
31
+
32
+ def metadata
33
+ attributes['metadata'].present? && HashWithIndifferentAccess.new(attributes['metadata'])
34
+ end
31
35
  end
32
36
  end
33
37
  end
@@ -0,0 +1,63 @@
1
+ require "active_support/callbacks"
2
+
3
+ # Following approach used by ActiveJob
4
+ # https://github.com/rails/rails/blob/93c9534c9871d4adad4bc33b5edc355672b59c61/activejob/lib/active_job/callbacks.rb
5
+ module Auxilium
6
+ module Concerns
7
+ module SidekiqCallbacks
8
+ extend ActiveSupport::Concern
9
+
10
+ def self.prepended(base)
11
+ base.include(ActiveSupport::Callbacks)
12
+
13
+ # Check to see if we already have any callbacks for :perform
14
+ # Prevents overwriting callbacks if we already included this module (and defined callbacks)
15
+ base.define_callbacks :perform unless base.respond_to?(:_perform_callbacks) && base._perform_callbacks.present?
16
+ base.define_callbacks :enqueue unless base.respond_to?(:_enqueue_callbacks) && base._enqueue_callbacks.present?
17
+
18
+ class << base
19
+ prepend ClassMethods
20
+ end
21
+ end
22
+
23
+ def perform(*args)
24
+ if respond_to?(:run_callbacks)
25
+ run_callbacks :perform do
26
+ super(*args)
27
+ end
28
+ else
29
+ super(*args)
30
+ end
31
+ end
32
+
33
+ def enqueue(*args)
34
+ if respond_to?(:run_callbacks)
35
+ run_callbacks :enqueue do
36
+ super(*args)
37
+ end
38
+ else
39
+ super(*args)
40
+ end
41
+ end
42
+
43
+ module ClassMethods
44
+ def around_perform(*filters, &blk)
45
+ set_callback(:perform, :around, *filters, &blk)
46
+ end
47
+
48
+ def before_enqueue(*filters, &blk)
49
+ set_callback(:enqueue, :before, *filters, &blk)
50
+ end
51
+
52
+ def around_enqueue(*filters, &blk)
53
+ set_callback(:enqueue, :around, *filters, &blk)
54
+ end
55
+
56
+ def before_perform(*filters, &blk)
57
+ set_callback(:perform, :before, *filters, &blk)
58
+ end
59
+ end
60
+ end
61
+
62
+ end
63
+ end
@@ -1,7 +1,7 @@
1
1
  module Auxilium
2
2
  class EasyCrypt
3
3
  # When no digest is given, the default Rails digest is used.
4
- # Digest can be something like OpenSSL::Digest::SHA1 or OpenSSL::Digest::SHA256
4
+ # Digest can be something like OpenSSL::Digest::SHA1 or OpenSSL::Digest::SHA256
5
5
  def initialize(key_base, digest: OpenSSL::Digest::SHA1)
6
6
  @key_base = key_base
7
7
  @digest = digest
@@ -52,5 +52,15 @@ module Auxilium
52
52
  def crypted?(text)
53
53
  text =~ /^EasyCrypt@[0-9a-f]+\$\$[^-]+--[^-]+--[^-]+/
54
54
  end
55
+
56
+ class << self
57
+ def dump(text)
58
+ new(Rails.application.credentials.secret_key_base).encrypt(text)
59
+ end
60
+
61
+ def load(text)
62
+ new(Rails.application.credentials.secret_key_base).decrypt(text)
63
+ end
64
+ end
55
65
  end
56
66
  end
@@ -7,9 +7,9 @@ module Auxilium
7
7
  protected
8
8
 
9
9
  def navigation_location
10
- return options[:location] if options[:location] && (controller.is_a?(Devise::SessionsController) || controller.is_a?(Devise::PasswordsController))
10
+ return options[:location] if options[:location] && (defined?(Devise) && (controller.is_a?(Devise::SessionsController) || controller.is_a?(Devise::PasswordsController)))
11
11
  return options[:location] if controller.params[:commit] == 'continue' && options[:location]
12
- return options[:collection_location].call if %w[save commit].include?(controller.params[:commit]) && options[:collection_location]
12
+ return options[:collection_location].call if %w[save commit delete].include?(controller.params[:commit]) && options[:collection_location]
13
13
  return resource_location if controller.params[:commit] == 'continue'
14
14
 
15
15
  klass = resources.last.class
@@ -54,7 +54,7 @@ module Auxilium
54
54
  return if value.blank?
55
55
 
56
56
  @sent_signum = true
57
- Signum.signal(controller.current_user, text: value, kind: key)
57
+ Signum.send(key, controller.current_user, text: value)
58
58
  end
59
59
 
60
60
  def send_signum? #:nodoc:
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Auxilium
4
- VERSION = "3.0.24"
4
+ VERSION = "3.0.30"
5
5
  end
data/lib/auxilium.rb CHANGED
@@ -19,6 +19,7 @@ require 'auxilium/concerns/authenticated'
19
19
  require 'auxilium/concerns/metadata'
20
20
  require 'auxilium/concerns/metadata_scoped'
21
21
  require 'auxilium/concerns/model_name_shortcuts'
22
+ require 'auxilium/concerns/sidekiq_callbacks'
22
23
  require 'auxilium/responders/continue_responder'
23
24
  require 'auxilium/responders/signum_responder'
24
25
  require 'auxilium/responders/responder'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: auxilium
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.24
4
+ version: 3.0.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andre Meij
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-11-07 00:00:00.000000000 Z
11
+ date: 2024-03-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack
@@ -143,6 +143,7 @@ executables: []
143
143
  extensions: []
144
144
  extra_rdoc_files: []
145
145
  files:
146
+ - ".github/workflows/gem-push.yml"
146
147
  - ".gitignore"
147
148
  - ".travis.yml"
148
149
  - Gemfile
@@ -160,6 +161,7 @@ files:
160
161
  - lib/auxilium/concerns/metadata.rb
161
162
  - lib/auxilium/concerns/metadata_scoped.rb
162
163
  - lib/auxilium/concerns/model_name_shortcuts.rb
164
+ - lib/auxilium/concerns/sidekiq_callbacks.rb
163
165
  - lib/auxilium/easy_crypt.rb
164
166
  - lib/auxilium/grape.rb
165
167
  - lib/auxilium/grape/parameter_filter.rb
@@ -180,7 +182,7 @@ licenses: []
180
182
  metadata:
181
183
  homepage_uri: https://code.entropydecelerator.com/components/auxilium
182
184
  source_code_uri: https://code.entropydecelerator.com/components/auxilium
183
- post_install_message:
185
+ post_install_message:
184
186
  rdoc_options: []
185
187
  require_paths:
186
188
  - lib
@@ -195,8 +197,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
195
197
  - !ruby/object:Gem::Version
196
198
  version: '0'
197
199
  requirements: []
198
- rubygems_version: 3.3.7
199
- signing_key:
200
+ rubygems_version: 3.4.10
201
+ signing_key:
200
202
  specification_version: 4
201
203
  summary: Random utilities.
202
204
  test_files: []