snfoil-context 1.0.1 → 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: 2f6ae006560cdebebc26c85b934844f41a97798a0380c533e8fe63ec20c87878
4
- data.tar.gz: 55969fedd2c359612b3b5e8a2159d8a877694df5a53aa150c96bebfce3cc6a29
3
+ metadata.gz: 6c8dbabb2362b9f056aa022c30b3b272a66f77c9316e65693f3b1a62312b7f70
4
+ data.tar.gz: 6bbb3416847d30ffc991751760076cbe709b127a203c2172bbe13d600ae55c00
5
5
  SHA512:
6
- metadata.gz: 2f765c83ea9194475a845ecf6592629db78b364f1b0fd1542532aa2e267df6134415554c271c9f3709d56d4e708c0e750ea7670362fe65dbfa4c9b6f0ceb6a30
7
- data.tar.gz: ae9ee679b230d7e189b485355a0cf9203ace33c39719c1250a1345efafeb7648ef837af535362af04cdbce7c92a8813e48daf837e02dbe957f462147f541c75f
6
+ metadata.gz: aa99ee8c5289136c65ab060112b33e664d92fc866d43cc131f6c783159c2c81e9213d25789955360e41758835ee4b3068b17546131598474a63513d35a8ffc66
7
+ data.tar.gz: 779f732fe717014a137e8450465e0cde4be9bd4e13080674af794aefcb2f5a2eeb162f4e0f66568d24199b2a0b89d5c975b37a0643d7b67ac25e86bfc18818a8
data/Gemfile CHANGED
@@ -4,3 +4,14 @@ source 'https://rubygems.org'
4
4
 
5
5
  # Specify your gem's dependencies in snfoil-policy.gemspec
6
6
  gemspec
7
+
8
+ group :development, :test do
9
+ gem 'bundle-audit', '~> 0.1.0'
10
+ gem 'fasterer', '~> 0.10.0'
11
+ gem 'pry-byebug', '~> 3.9', platform: :mri
12
+ gem 'rake', '~> 13.0'
13
+ gem 'rspec', '~> 3.10'
14
+ gem 'rubocop', '1.33'
15
+ gem 'rubocop-performance', '1.14.3'
16
+ gem 'rubocop-rspec', '2.12.1'
17
+ end
@@ -16,6 +16,6 @@
16
16
 
17
17
  module SnFoil
18
18
  module Context
19
- VERSION = '1.0.1'
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)
@@ -105,6 +113,8 @@ module SnFoil
105
113
  end
106
114
 
107
115
  def define_instance_methods(method_name)
116
+ return if method_defined? method_name
117
+
108
118
  define_method(method_name) do |**options|
109
119
  options
110
120
  end
@@ -29,13 +29,4 @@ Gem::Specification.new do |spec|
29
29
  spec.require_paths = ['lib']
30
30
 
31
31
  spec.add_dependency 'activesupport', '>= 5.2.6'
32
-
33
- spec.add_development_dependency 'bundle-audit', '~> 0.1.0'
34
- spec.add_development_dependency 'fasterer', '~> 0.10.0'
35
- spec.add_development_dependency 'pry-byebug', '~> 3.9'
36
- spec.add_development_dependency 'rake', '~> 13.0'
37
- spec.add_development_dependency 'rspec', '~> 3.10'
38
- spec.add_development_dependency 'rubocop', '1.33'
39
- spec.add_development_dependency 'rubocop-performance', '1.14.3'
40
- spec.add_development_dependency 'rubocop-rspec', '2.12.1'
41
32
  end
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.0.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-08-08 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
@@ -25,118 +25,6 @@ dependencies:
25
25
  - - ">="
26
26
  - !ruby/object:Gem::Version
27
27
  version: 5.2.6
28
- - !ruby/object:Gem::Dependency
29
- name: bundle-audit
30
- requirement: !ruby/object:Gem::Requirement
31
- requirements:
32
- - - "~>"
33
- - !ruby/object:Gem::Version
34
- version: 0.1.0
35
- type: :development
36
- prerelease: false
37
- version_requirements: !ruby/object:Gem::Requirement
38
- requirements:
39
- - - "~>"
40
- - !ruby/object:Gem::Version
41
- version: 0.1.0
42
- - !ruby/object:Gem::Dependency
43
- name: fasterer
44
- requirement: !ruby/object:Gem::Requirement
45
- requirements:
46
- - - "~>"
47
- - !ruby/object:Gem::Version
48
- version: 0.10.0
49
- type: :development
50
- prerelease: false
51
- version_requirements: !ruby/object:Gem::Requirement
52
- requirements:
53
- - - "~>"
54
- - !ruby/object:Gem::Version
55
- version: 0.10.0
56
- - !ruby/object:Gem::Dependency
57
- name: pry-byebug
58
- requirement: !ruby/object:Gem::Requirement
59
- requirements:
60
- - - "~>"
61
- - !ruby/object:Gem::Version
62
- version: '3.9'
63
- type: :development
64
- prerelease: false
65
- version_requirements: !ruby/object:Gem::Requirement
66
- requirements:
67
- - - "~>"
68
- - !ruby/object:Gem::Version
69
- version: '3.9'
70
- - !ruby/object:Gem::Dependency
71
- name: rake
72
- requirement: !ruby/object:Gem::Requirement
73
- requirements:
74
- - - "~>"
75
- - !ruby/object:Gem::Version
76
- version: '13.0'
77
- type: :development
78
- prerelease: false
79
- version_requirements: !ruby/object:Gem::Requirement
80
- requirements:
81
- - - "~>"
82
- - !ruby/object:Gem::Version
83
- version: '13.0'
84
- - !ruby/object:Gem::Dependency
85
- name: rspec
86
- requirement: !ruby/object:Gem::Requirement
87
- requirements:
88
- - - "~>"
89
- - !ruby/object:Gem::Version
90
- version: '3.10'
91
- type: :development
92
- prerelease: false
93
- version_requirements: !ruby/object:Gem::Requirement
94
- requirements:
95
- - - "~>"
96
- - !ruby/object:Gem::Version
97
- version: '3.10'
98
- - !ruby/object:Gem::Dependency
99
- name: rubocop
100
- requirement: !ruby/object:Gem::Requirement
101
- requirements:
102
- - - '='
103
- - !ruby/object:Gem::Version
104
- version: '1.33'
105
- type: :development
106
- prerelease: false
107
- version_requirements: !ruby/object:Gem::Requirement
108
- requirements:
109
- - - '='
110
- - !ruby/object:Gem::Version
111
- version: '1.33'
112
- - !ruby/object:Gem::Dependency
113
- name: rubocop-performance
114
- requirement: !ruby/object:Gem::Requirement
115
- requirements:
116
- - - '='
117
- - !ruby/object:Gem::Version
118
- version: 1.14.3
119
- type: :development
120
- prerelease: false
121
- version_requirements: !ruby/object:Gem::Requirement
122
- requirements:
123
- - - '='
124
- - !ruby/object:Gem::Version
125
- version: 1.14.3
126
- - !ruby/object:Gem::Dependency
127
- name: rubocop-rspec
128
- requirement: !ruby/object:Gem::Requirement
129
- requirements:
130
- - - '='
131
- - !ruby/object:Gem::Version
132
- version: 2.12.1
133
- type: :development
134
- prerelease: false
135
- version_requirements: !ruby/object:Gem::Requirement
136
- requirements:
137
- - - '='
138
- - !ruby/object:Gem::Version
139
- version: 2.12.1
140
28
  description: An easy way to make extensible workflows and actions
141
29
  email:
142
30
  - howeszy@gmail.com
@@ -179,7 +67,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
179
67
  - !ruby/object:Gem::Version
180
68
  version: '0'
181
69
  requirements: []
182
- rubygems_version: 3.1.6
70
+ rubygems_version: 3.3.7
183
71
  signing_key:
184
72
  specification_version: 4
185
73
  summary: Setup Simple Pipelined Workflows