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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7668d6bc2b0b4cb145b6e68854fdcefa1189dcd22705ff653175eb6ca9f17343
4
- data.tar.gz: 422d2f4379b13c67c724169d86bc040e0630fd152ed7cd31527b13303a147839
3
+ metadata.gz: 6c8dbabb2362b9f056aa022c30b3b272a66f77c9316e65693f3b1a62312b7f70
4
+ data.tar.gz: 6bbb3416847d30ffc991751760076cbe709b127a203c2172bbe13d600ae55c00
5
5
  SHA512:
6
- metadata.gz: 94724380046a655bec5ce557847b3930945d6bbadba09f37041f48a2a494698adc851d20cf9166458944782e339adbef586d4dbb397134d0d6f31d8357462d68
7
- data.tar.gz: 8bad4f8f72c130e25cf2c12c3123bbf2cf8b7652a2219cdc5503e422d6329c75ad864a11bbb7cf9aa8aecb3a78c9cc64fcdf8bcea180d6146a79c1494e320bca
6
+ metadata.gz: aa99ee8c5289136c65ab060112b33e664d92fc866d43cc131f6c783159c2c81e9213d25789955360e41758835ee4b3068b17546131598474a63513d35a8ffc66
7
+ data.tar.gz: 779f732fe717014a137e8450465e0cde4be9bd4e13080674af794aefcb2f5a2eeb162f4e0f66568d24199b2a0b89d5c975b37a0643d7b67ac25e86bfc18818a8
@@ -16,6 +16,6 @@
16
16
 
17
17
  module SnFoil
18
18
  module Context
19
- VERSION = '1.1.0'
19
+ VERSION = '1.2.0'
20
20
  end
21
21
  end
@@ -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
- authorize(name, **options) if respond_to?(:authorize)
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
- authorize(name, **options) if respond_to?(:authorize)
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.1.0
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-10-05 00:00:00.000000000 Z
12
+ date: 2022-12-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport