snfoil-context 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/snfoil/context/version.rb +1 -1
- data/lib/snfoil/context.rb +10 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c8dbabb2362b9f056aa022c30b3b272a66f77c9316e65693f3b1a62312b7f70
|
4
|
+
data.tar.gz: 6bbb3416847d30ffc991751760076cbe709b127a203c2172bbe13d600ae55c00
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa99ee8c5289136c65ab060112b33e664d92fc866d43cc131f6c783159c2c81e9213d25789955360e41758835ee4b3068b17546131598474a63513d35a8ffc66
|
7
|
+
data.tar.gz: 779f732fe717014a137e8450465e0cde4be9bd4e13080674af794aefcb2f5a2eeb162f4e0f66568d24199b2a0b89d5c975b37a0643d7b67ac25e86bfc18818a8
|
data/lib/snfoil/context.rb
CHANGED
@@ -74,12 +74,20 @@ module SnFoil
|
|
74
74
|
def define_action_primary(name, method, block) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
|
75
75
|
define_method(name) do |*_args, **options| # rubocop:disable Metrics/MethodLength
|
76
76
|
options[:action] ||= name.to_sym
|
77
|
+
options[:authorized] = false
|
77
78
|
|
78
79
|
options = run_interval(format('setup_%s', name), **options)
|
79
|
-
|
80
|
+
|
81
|
+
if respond_to?(:authorize)
|
82
|
+
authorize(name, **options)
|
83
|
+
options[:authorized] = :setup
|
84
|
+
end
|
80
85
|
|
81
86
|
options = run_interval(format('before_%s', name), **options)
|
82
|
-
|
87
|
+
if respond_to?(:authorize)
|
88
|
+
authorize(name, **options)
|
89
|
+
options[:authorized] = :before
|
90
|
+
end
|
83
91
|
|
84
92
|
options = if run_action_primary(method, block, **options)
|
85
93
|
run_interval(format('after_%s_success', name), **options)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: snfoil-context
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew Howes
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2022-
|
12
|
+
date: 2022-12-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|