snfoil-context 0.0.1 → 0.0.2

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: 96734bc3c562904649028a48af86b3bfce1c6afd8273bdf5112dd5e5d608013c
4
- data.tar.gz: c380bc1234066ff9d29d6f969214b9d72a57f713ff98a11d64cf969e5310ee02
3
+ metadata.gz: 192d032e33ddaa32cb1ead86d97947a03eaee657af7c26a44effe1c47eeefe7a
4
+ data.tar.gz: e181f4ac51ccc95c0e50377b3186679b5f313824f4a650f7dbe80efb69e4f68b
5
5
  SHA512:
6
- metadata.gz: e6c4262868a512ea479115a6dc709425d7e264b9fbebaabab3134e299ced2e7b089833573d109627e670cffe2edd17cc92ffb9ff19e00f4341bf902b9cdb69e5
7
- data.tar.gz: f9eb6db011db1d21437e95c6881a89b9e361310a16952cccf7a57b58ed6342533643622b6379a2eae1cc8a5ab2413a6e69228308cde9b0e58a6ef98da0cd2710
6
+ metadata.gz: 41bbbdce248d49d94e646a2d446ff99ce9fa195dc235024cd85030d8f4664c2f0ddb4b1b42ba906df50ce71d330425bc5d582a8783be10603f9dc94745b10871
7
+ data.tar.gz: d0cbddc6b61b6bccae81d5a6b2db8930cada0f9f9729595aa1203252440f93b0d8e3fc9ea630dd2790eba7e69d17242390e76766d6e5b36dc35ef87fc4c3c5c5
@@ -16,6 +16,6 @@
16
16
 
17
17
  module SnFoil
18
18
  module Context
19
- VERSION = '0.0.1'
19
+ VERSION = '0.0.2'
20
20
  end
21
21
  end
@@ -38,11 +38,19 @@ module SnFoil
38
38
  raise SnFoil::Context::Error, "action #{name} already defined for #{self.name}" if (@defined_actions ||= []).include?(name)
39
39
 
40
40
  @defined_actions << name
41
- setup_hooks(name)
41
+ define_workflow_hooks(name)
42
42
  define_action_primary(name, with, block)
43
43
  end
44
44
  end
45
45
 
46
+ def run_action_group(group_name, **options)
47
+ hooks = self.class.instance_variable_get("@#{group_name}_hooks") || []
48
+ options = hooks.reduce(options) { |opts, hook| run_hook(hook, opts) }
49
+ options = send(group_name, **options) if respond_to?(group_name)
50
+
51
+ options
52
+ end
53
+
46
54
  private
47
55
 
48
56
  # rubocop:disable reason: These are builder/mapping methods that are just too complex to simplify without
@@ -66,7 +74,7 @@ module SnFoil
66
74
  end
67
75
  end
68
76
 
69
- def setup_hooks(name)
77
+ def define_workflow_hooks(name)
70
78
  hook_builder('setup_%s', name)
71
79
  hook_builder('before_%s', name)
72
80
  hook_builder('after_%s_success', name)
@@ -98,13 +106,5 @@ module SnFoil
98
106
 
99
107
  instance_exec options, &block
100
108
  end
101
-
102
- def run_action_group(group_name, **options)
103
- options = self.class.instance_variable_get("@#{group_name}_hooks")
104
- .reduce(options) { |opts, hook| run_hook(hook, opts) }
105
- options = send(group_name, **options) if respond_to?(group_name)
106
-
107
- options
108
- end
109
109
  end
110
110
  end
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
8
8
  spec.authors = ['Matthew Howes']
9
9
  spec.email = ['howeszy@gmail.com']
10
10
 
11
- spec.summary = ''
12
- spec.description = ''
11
+ spec.summary = 'Setup simple pipelined workflows'
12
+ spec.description = 'An easy way to make extensible workflows and actions'
13
13
  spec.homepage = 'https://github.com/limited-effort/snfoil-context'
14
14
  spec.license = 'MIT'
15
15
  spec.required_ruby_version = '>= 2.5.0'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snfoil-context
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Howes
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-10-12 00:00:00.000000000 Z
11
+ date: 2021-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -108,7 +108,7 @@ dependencies:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: '2.5'
111
- description: ''
111
+ description: An easy way to make extensible workflows and actions
112
112
  email:
113
113
  - howeszy@gmail.com
114
114
  executables: []
@@ -132,7 +132,7 @@ files:
132
132
  - lib/snfoil/context/error.rb
133
133
  - lib/snfoil/context/structure.rb
134
134
  - lib/snfoil/context/version.rb
135
- - snfoil-policy.gemspec
135
+ - snfoil-context.gemspec
136
136
  homepage: https://github.com/limited-effort/snfoil-context
137
137
  licenses:
138
138
  - MIT
@@ -158,5 +158,5 @@ requirements: []
158
158
  rubygems_version: 3.1.6
159
159
  signing_key:
160
160
  specification_version: 4
161
- summary: ''
161
+ summary: Setup simple pipelined workflows
162
162
  test_files: []