wicked-pipeline 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.standard.yml +1 -1
- data/CHANGELOG.md +5 -0
- data/README.md +58 -36
- data/lib/generators/rspec/wicked/pipeline/USAGE +12 -0
- data/lib/generators/rspec/wicked/pipeline/pipeline_generator.rb +25 -0
- data/lib/generators/rspec/wicked/pipeline/step/USAGE +12 -0
- data/lib/generators/rspec/wicked/pipeline/step/step_generator.rb +27 -0
- data/lib/generators/rspec/wicked/pipeline/step/templates/step_spec.rb.tt +9 -0
- data/lib/generators/rspec/wicked/pipeline/templates/pipeline_spec.rb.tt +7 -0
- data/lib/generators/wicked/pipeline/USAGE +15 -0
- data/lib/generators/wicked/pipeline/pipeline_generator.rb +54 -0
- data/lib/generators/wicked/pipeline/step/USAGE +15 -0
- data/lib/generators/wicked/pipeline/step/step_generator.rb +39 -0
- data/lib/generators/wicked/pipeline/step/templates/step.rb.tt +79 -0
- data/lib/generators/wicked/pipeline/templates/pipeline.rb.tt +17 -0
- data/lib/wicked/pipeline/version.rb +1 -1
- data/wicked-pipeline.gemspec +1 -2
- metadata +14 -3
- data/sig/wicked/pipeline.rbs +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c59b79336370d4dff4c11d14e81248c309a7621abffec1b4e07252047db97312
|
4
|
+
data.tar.gz: 11bb3cbed87f59db523471ccaf24669b375b7122e46a2bbe2b7e91c1fd0c306d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5416bd3edb4ecb54735249a6546cce437468c4cc33b925be995236bee843bb4ed054f639e592fdc01acba1f720a4c380a2ce2b16d23aa31d0970c40a65b59a3a
|
7
|
+
data.tar.gz: daa012c32f06118c45c8983ad8a08fe12cc9f44f39e9437b46c43264f3524310d12dbc589512e7e004ae527ba2cec9c58395eac3dbadc2328ea48a10d4425501
|
data/.standard.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,30 +1,34 @@
|
|
1
1
|
Wicked::Pipeline
|
2
2
|
================
|
3
3
|
|
4
|
-
|
4
|
+
[![RSpec](https://github.com/RobertAudi/wicked-pipeline/actions/workflows/rspec.yml/badge.svg)](https://github.com/RobertAudi/wicked-pipeline/actions/workflows/rspec.yml)
|
5
|
+
[![Standard](https://github.com/RobertAudi/wicked-pipeline/actions/workflows/standard.yml/badge.svg)](https://github.com/RobertAudi/wicked-pipeline/actions/workflows/standard.yml)
|
5
6
|
|
6
|
-
|
7
|
-
- A step pipeline class that encapsulates all the steps in a pipeline
|
8
|
-
- A step controller
|
7
|
+
A step by step pipeline system built on top of [Wicked](https://github.com/zombocom/wicked).
|
9
8
|
|
10
9
|
Table of Contents
|
11
10
|
-----------------
|
12
11
|
|
12
|
+
- [Table of Contents](#table-of-contents)
|
13
13
|
- [Installation](#installation)
|
14
|
-
- [
|
15
|
-
- [
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
- [
|
20
|
-
- [
|
21
|
-
- [
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
14
|
+
- [Usage](#usage)
|
15
|
+
- [Step objects](#step-objects)
|
16
|
+
- [Attributes](#attributes)
|
17
|
+
- [Validations](#validations)
|
18
|
+
- [Blocking](#blocking)
|
19
|
+
- [Blocking reason](#blocking-reason)
|
20
|
+
- [Step pipelines](#step-pipelines)
|
21
|
+
- [Steps controllers](#steps-controllers)
|
22
|
+
- [Routes](#routes)
|
23
|
+
- [Nested routes](#nested-routes)
|
24
|
+
- [Actions](#actions)
|
25
|
+
- [Flash messages](#flash-messages)
|
26
|
+
- [Views](#views)
|
27
|
+
- [Forms](#forms)
|
28
|
+
- [Breadcrumbs](#breadcrumbs)
|
29
|
+
- [Development](#development)
|
30
|
+
- [Contributing](#contributing)
|
31
|
+
- [License](#license)
|
28
32
|
|
29
33
|
Installation
|
30
34
|
------------
|
@@ -41,8 +45,26 @@ If bundler is not being used to manage dependencies, install the gem by executin
|
|
41
45
|
$ gem install wicked-pipeline
|
42
46
|
```
|
43
47
|
|
44
|
-
|
45
|
-
|
48
|
+
Usage
|
49
|
+
-----
|
50
|
+
|
51
|
+
You can generate a pipeline using the dedicated generator:
|
52
|
+
|
53
|
+
```console
|
54
|
+
$ rails generate wicked:pipeline Registration identification profile preferences
|
55
|
+
```
|
56
|
+
|
57
|
+
This will geneate the `RegistrationPipeline`, `IdentificationStep`, `ProfileStep`, and `PreferencesStep` classes under `app/steps`. It will also generate test files under `spec/steps` if RSpec is installed.
|
58
|
+
|
59
|
+
You can also generate individual steps:
|
60
|
+
|
61
|
+
```console
|
62
|
+
$ rails generate wicked:pipeline:step identification email subscribe_to_newsletter:boolean interests:array
|
63
|
+
```
|
64
|
+
|
65
|
+
This will generate the `IdentificationStep` with the `email`, `subscribe_to_newsletter` and `interests` attributes. It will also generate a test file under `spec/steps` if RSpec is installed.
|
66
|
+
|
67
|
+
### Step objects
|
46
68
|
|
47
69
|
A step object is very similar to a form object. It takes a "resource" (the `ActiveRecord` model) and optional params as arguments and will contain attribute definitions, validations for the step, a list of permitted params and a `#save` method. The validations are specific to the step but the resource will also be validated before being saved.
|
48
70
|
|
@@ -50,10 +72,10 @@ Step objects are subclasses of the `BaseStep` class, and they live in the `app/s
|
|
50
72
|
|
51
73
|
- The name of a step class must end with `Step`
|
52
74
|
- Attributes must be defined using the `ActiveModel::Attributes` API (more on that later)
|
53
|
-
|
75
|
+
- Nested attributes must **not** be defined as attributes in the step object.
|
54
76
|
- The class must implement the `permitted_params` method which returns an array of attributes.
|
55
77
|
- If the `#save` method is overridden, `super` must be called and its value must be used.
|
56
|
-
|
78
|
+
- The `#save` method **must** return a boolean value.
|
57
79
|
|
58
80
|
The only method that needs to be implemented is the `permitted_params` private method, everything else is optional. Here is the most basic step object that can exist:
|
59
81
|
|
@@ -77,7 +99,7 @@ As mentioned before, step objects require a resource:
|
|
77
99
|
Users::ProfileStep.new(User.last)
|
78
100
|
```
|
79
101
|
|
80
|
-
|
102
|
+
#### Attributes
|
81
103
|
|
82
104
|
The attributes of a step object are defined using the `.attribute` method. The first argument is the name of the attribute, and the second argument is the type of the attribute. The type argument is optional but it **must** be specified for boolean attributes.
|
83
105
|
|
@@ -103,7 +125,7 @@ end
|
|
103
125
|
|
104
126
|
The attributes **must** be in the list of permitted parameters!
|
105
127
|
|
106
|
-
|
128
|
+
#### Validations
|
107
129
|
|
108
130
|
Validations are used the same way as in `ActiveRecord` models. One exception is the uniqueness validation which is **not** available in step objects.
|
109
131
|
|
@@ -133,7 +155,7 @@ end
|
|
133
155
|
|
134
156
|
Custom validation errors must be added to the step object **not** the resource itself, they will be merged into the resource's errors automatically.
|
135
157
|
|
136
|
-
|
158
|
+
#### Blocking
|
137
159
|
|
138
160
|
A blocking step will short-circuit a pipeline. In other words, all step following a blocking step will be inaccessible.
|
139
161
|
|
@@ -185,8 +207,7 @@ module Users
|
|
185
207
|
end
|
186
208
|
```
|
187
209
|
|
188
|
-
Step pipelines
|
189
|
-
--------------
|
210
|
+
### Step pipelines
|
190
211
|
|
191
212
|
A step pipeline class is a subclass of the `BasePipeline` class and live in `app/steps`. At the most basic level should contain a list of step classes.
|
192
213
|
|
@@ -225,8 +246,7 @@ Finally, pipelines are also used to check if all steps are valid for a given res
|
|
225
246
|
UserAccountPipeline.valid?(User.last)
|
226
247
|
```
|
227
248
|
|
228
|
-
Steps controllers
|
229
|
-
-----------------
|
249
|
+
### Steps controllers
|
230
250
|
|
231
251
|
A steps controller is a subclass of `BaseStepsController`, it can have any name and can be placed anywhere under the `app/controllers` directory. Unlike a regular controller, the `:id` parameter references the current step **not** the ID of a resource. For this reason, the name of the resource ID parameter must be specified using the `#resource_param_name` private method.
|
232
252
|
|
@@ -262,7 +282,7 @@ end
|
|
262
282
|
- The `#find_resource` method must only retrieve the record associated with the resource ID (`#includes` is allowed), **not** a collection of records.
|
263
283
|
- The `#find_resource` method must return the record.
|
264
284
|
|
265
|
-
|
285
|
+
#### Routes
|
266
286
|
|
267
287
|
The `param` option must be specified when defining resource routes:
|
268
288
|
|
@@ -272,7 +292,7 @@ resources :users, only: [:show, :update], param: :user_id
|
|
272
292
|
|
273
293
|
**DO NOT** use nested routes with the step routes.
|
274
294
|
|
275
|
-
|
295
|
+
#### Nested routes
|
276
296
|
|
277
297
|
When the controller has an `index` action, nested routes can be defined in the following way:
|
278
298
|
|
@@ -294,7 +314,7 @@ scope path: "users/:user_id" do
|
|
294
314
|
end
|
295
315
|
```
|
296
316
|
|
297
|
-
|
317
|
+
#### Actions
|
298
318
|
|
299
319
|
A step controller has the `show` and `update` actions. **It cannot have the `new`, `edit` and `create` actions!** The `index` and `destroy` actions can be implemented but they will be independent of the pipeline.
|
300
320
|
|
@@ -336,7 +356,7 @@ end
|
|
336
356
|
- `@next_step`
|
337
357
|
- `@previous_step`
|
338
358
|
|
339
|
-
|
359
|
+
#### Flash messages
|
340
360
|
|
341
361
|
Flash messages can be set manually **after** calling `super`. Step objects have a `#saved?` method which can be used to verify that it was successfully saved. The method should be used before setting a flash messages:
|
342
362
|
|
@@ -359,7 +379,7 @@ class UsersController < BaseStepsController
|
|
359
379
|
end
|
360
380
|
```
|
361
381
|
|
362
|
-
|
382
|
+
#### Views
|
363
383
|
|
364
384
|
There must be a view for each step, **not** a partial, it must have the name of the step and it should live in the root directory of the controller's view directory:
|
365
385
|
|
@@ -377,7 +397,7 @@ app
|
|
377
397
|
- **DO NOT** create a view for the `show` action.
|
378
398
|
- **DO NOT** create views named `new` or `edit`.
|
379
399
|
|
380
|
-
|
400
|
+
#### Forms
|
381
401
|
|
382
402
|
The form in step view must be declared in the following way:
|
383
403
|
|
@@ -400,7 +420,7 @@ The form in step view must be declared in the following way:
|
|
400
420
|
- The resource object must be passed to `form_for`, **not** the step processor
|
401
421
|
- The form's method must be either `:put` or `:patch`
|
402
422
|
|
403
|
-
|
423
|
+
#### Breadcrumbs
|
404
424
|
|
405
425
|
Step controllers provide a extended version of their pipeline's steps metadata with the following added info:
|
406
426
|
|
@@ -443,6 +463,8 @@ Contributing
|
|
443
463
|
|
444
464
|
Bug reports and pull requests are welcome on GitHub at https://github.com/RobertAudi/wicked-pipeline.
|
445
465
|
|
466
|
+
The code is linted using [Standard](https://github.com/testdouble/standard). To lint the code run `bundle exec rake standard` or `bundle exec rake standard:fix` to autocorrect offenses.
|
467
|
+
|
446
468
|
License
|
447
469
|
-------
|
448
470
|
|
@@ -0,0 +1,12 @@
|
|
1
|
+
Description:
|
2
|
+
Generates a spec file for a Pipeline. Pass the pipeline name, either CamelCased
|
3
|
+
or under_scored.
|
4
|
+
|
5
|
+
To create a pipeline within a module, specify the pipeline name as a
|
6
|
+
path like "parent_module/pipeline_name".
|
7
|
+
|
8
|
+
Example:
|
9
|
+
`bin/rails generate rspec:wicked:pipeline Registration
|
10
|
+
|
11
|
+
Registration spec.
|
12
|
+
RSpec: spec/steps/registration_pipeline_spec.rb
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "rails/generators/named_base"
|
4
|
+
|
5
|
+
module Rspec
|
6
|
+
module Wicked
|
7
|
+
class PipelineGenerator < Rails::Generators::NamedBase
|
8
|
+
source_root File.expand_path("templates", __dir__)
|
9
|
+
|
10
|
+
def create_spec_file
|
11
|
+
template "pipeline_spec.rb", File.join("spec/steps", class_path, "#{file_name}_pipeline_spec.rb")
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def file_name
|
17
|
+
@_file_name ||= remove_possible_suffix(super)
|
18
|
+
end
|
19
|
+
|
20
|
+
def remove_possible_suffix(name)
|
21
|
+
name.sub(/_?pipeline\z/i, "")
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
Description:
|
2
|
+
Generates a spec file for a Step. Pass the step name, either CamelCased
|
3
|
+
or under_scored.
|
4
|
+
|
5
|
+
To create a step within a module, specify the step name as a
|
6
|
+
path like "parent_module/step_name".
|
7
|
+
|
8
|
+
Example:
|
9
|
+
`bin/rails generate rspec:wicked:pipeline:step UserIdendification
|
10
|
+
|
11
|
+
UserIdentificationStep spec.
|
12
|
+
RSpec: spec/steps/user_identification_step_spec.rb
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "rails/generators/named_base"
|
4
|
+
|
5
|
+
module Rspec
|
6
|
+
module Wicked
|
7
|
+
module Pipeline
|
8
|
+
class StepGenerator < Rails::Generators::NamedBase
|
9
|
+
source_root File.expand_path("templates", __dir__)
|
10
|
+
|
11
|
+
def create_spec_file
|
12
|
+
template "step_spec.rb", File.join("spec/steps", class_path, "#{file_name}_step_spec.rb")
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
def file_name
|
18
|
+
@_file_name ||= remove_possible_suffix(super)
|
19
|
+
end
|
20
|
+
|
21
|
+
def remove_possible_suffix(name)
|
22
|
+
name.sub(/_?step\z/i, "")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
Description:
|
2
|
+
Generates a new pipeline. Pass the pipeline name, either CamelCased or
|
3
|
+
under_scored, and an optional list of steps.
|
4
|
+
|
5
|
+
To create a pipeline within a module, specify the pipeline name as a
|
6
|
+
path like "parent_module/pipeline_name".
|
7
|
+
|
8
|
+
Example:
|
9
|
+
`bin/rails generate wicked:pipeline Registration identification profile preferences
|
10
|
+
|
11
|
+
RegistrationPipeline.
|
12
|
+
Pipeline: app/steps/registration_pipeline.rb
|
13
|
+
Step: app/steps/identification_step.rb
|
14
|
+
Step: app/steps/profile_step.rb
|
15
|
+
Step: app/steps/preferences_step.rb
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "rails/generators/named_base"
|
4
|
+
|
5
|
+
module Wicked
|
6
|
+
class PipelineGenerator < Rails::Generators::NamedBase
|
7
|
+
check_class_collision suffix: "Pipeline"
|
8
|
+
|
9
|
+
source_root File.expand_path("templates", __dir__)
|
10
|
+
|
11
|
+
argument :steps, type: :array, default: [], banner: "step_name step_name"
|
12
|
+
|
13
|
+
def create_pipeline_file
|
14
|
+
template "pipeline.rb", File.join("app/steps", class_path, "#{file_name}_pipeline.rb")
|
15
|
+
end
|
16
|
+
|
17
|
+
hook_for :test_framework, as: "wicked:pipeline"
|
18
|
+
|
19
|
+
def create_step_files
|
20
|
+
step_classes.each do |step_class|
|
21
|
+
Rails::Generators.invoke "wicked:pipeline:step", [step_class, *options_as_switches], behavior: behavior
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
def file_name
|
28
|
+
@_file_name ||= remove_possible_suffix(super)
|
29
|
+
end
|
30
|
+
|
31
|
+
def remove_possible_suffix(name)
|
32
|
+
name.sub(/_?pipeline\z/i, "")
|
33
|
+
end
|
34
|
+
|
35
|
+
def step_classes
|
36
|
+
@step_classes ||= steps.map do |step_name|
|
37
|
+
if step_name.match?(/\/|::/)
|
38
|
+
String.new(step_name.sub(/_?step\z/i, "").camelize) << "Step"
|
39
|
+
else
|
40
|
+
String.new((class_path + [step_name.sub(/_?step\z/i, "")]).map!(&:camelize).join("::")) << "Step"
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
def options_as_switches
|
46
|
+
@options_as_switches ||= options.compact_blank.each_with_object([]) do |(option, value), obj|
|
47
|
+
next unless value
|
48
|
+
|
49
|
+
obj << "--#{option.to_s.dasherize}"
|
50
|
+
obj << value.presence unless value == true
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
Description:
|
2
|
+
Generates a new step. Pass the step name, either CamelCased or
|
3
|
+
under_scored, and an optional list of attribute pairs as arguments.
|
4
|
+
|
5
|
+
Attribute pairs are name:type arguments specifying the
|
6
|
+
step's attributes.
|
7
|
+
|
8
|
+
To create a step within a module, specify the step name as a
|
9
|
+
path like "parent_module/step_name".
|
10
|
+
|
11
|
+
Example:
|
12
|
+
`bin/rails generate wicked:pipeline:step UserIdendification name is_active:boolean hobbies:array`
|
13
|
+
|
14
|
+
UserIdentificationStep.
|
15
|
+
Step: app/steps/user_identification_step.rb
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "rails/generators/named_base"
|
4
|
+
|
5
|
+
module Wicked
|
6
|
+
module Pipeline
|
7
|
+
class StepGenerator < Rails::Generators::NamedBase
|
8
|
+
check_class_collision suffix: "Step"
|
9
|
+
|
10
|
+
source_root File.expand_path("templates", __dir__)
|
11
|
+
|
12
|
+
argument :attributes, type: :array, default: [], banner: "attribute[:type] attribute[:type]"
|
13
|
+
|
14
|
+
def create_step_file
|
15
|
+
template "step.rb", File.join("app/steps", class_path, "#{file_name}_step.rb")
|
16
|
+
end
|
17
|
+
|
18
|
+
hook_for :test_framework, as: "wicked:pipeline:step"
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def file_name
|
23
|
+
@_file_name ||= remove_possible_suffix(super)
|
24
|
+
end
|
25
|
+
|
26
|
+
def remove_possible_suffix(name)
|
27
|
+
name.sub(/_?step\z/i, "")
|
28
|
+
end
|
29
|
+
|
30
|
+
def array_attributes
|
31
|
+
@array_attributes ||= attributes.select { |attribute| attribute.type == :array }
|
32
|
+
end
|
33
|
+
|
34
|
+
def boolean_attributes
|
35
|
+
@boolean_attributes ||= attributes.select { |attribute| attribute.type == :boolean }
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
<% module_namespacing do -%>
|
4
|
+
class <%= class_name %>Step < Wicked::Pipeline::BaseStep
|
5
|
+
# -------------------------------------------- #
|
6
|
+
# Attributes #
|
7
|
+
# -------------------------------------------- #
|
8
|
+
|
9
|
+
<% if attributes.present? -%>
|
10
|
+
<% attributes.each do |attribute| -%>
|
11
|
+
<% if attribute.type == :array -%>
|
12
|
+
attribute :<%= attribute.name %>, array: true
|
13
|
+
<% elsif attribute.type != :string -%>
|
14
|
+
attribute :<%= attribute.name %>, :<%= attribute.type %>
|
15
|
+
<% else -%>
|
16
|
+
attribute :<%= attribute.name %>
|
17
|
+
<% end -%>
|
18
|
+
<% end -%>
|
19
|
+
<% else -%>
|
20
|
+
# ...
|
21
|
+
<% end -%>
|
22
|
+
|
23
|
+
# -------------------------------------------- #
|
24
|
+
# Validations #
|
25
|
+
# -------------------------------------------- #
|
26
|
+
|
27
|
+
<% if boolean_attributes.present? -%>
|
28
|
+
<% boolean_attributes.each do |attribute| -%>
|
29
|
+
validates :<%= attribute.name %>, inclusion: {in: [true, false]}
|
30
|
+
<% end -%>
|
31
|
+
|
32
|
+
# ...
|
33
|
+
<% else -%>
|
34
|
+
# ...
|
35
|
+
<% end -%>
|
36
|
+
|
37
|
+
# -------------------------------------------- #
|
38
|
+
|
39
|
+
<% array_attributes.each do |attribute| -%>
|
40
|
+
def <%= attribute.name %>=(value)
|
41
|
+
super(Array(value).compact_blank)
|
42
|
+
end
|
43
|
+
|
44
|
+
<% end -%>
|
45
|
+
# def blocking?
|
46
|
+
# false
|
47
|
+
# end
|
48
|
+
|
49
|
+
private
|
50
|
+
|
51
|
+
def permitted_params
|
52
|
+
<% if attributes.present? -%>
|
53
|
+
[
|
54
|
+
<% attributes.each_with_index do |attribute, index| -%>
|
55
|
+
<% next if attribute.type == :array -%>
|
56
|
+
:<%= attribute.name %><%= "," if index < attributes.size - 1 %>
|
57
|
+
<% end -%>
|
58
|
+
<% array_attributes.each_with_index do |attribute, index| -%>
|
59
|
+
<%= attribute.name %>: []<%= "," if index < array_attributes.size - 1 %>
|
60
|
+
<% end -%>
|
61
|
+
]
|
62
|
+
<% else -%>
|
63
|
+
[]
|
64
|
+
<% end -%>
|
65
|
+
end
|
66
|
+
|
67
|
+
# def regenerate_blocking_reasons!
|
68
|
+
# super
|
69
|
+
# end
|
70
|
+
|
71
|
+
# def stale_attributes
|
72
|
+
# stale_attributes = []
|
73
|
+
#
|
74
|
+
# # ...
|
75
|
+
#
|
76
|
+
# stale_attributes
|
77
|
+
# end
|
78
|
+
end
|
79
|
+
<% end -%>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
<% module_namespacing do -%>
|
4
|
+
class <%= class_name %>Pipeline < Wicked::Pipeline::BasePipeline
|
5
|
+
def steps
|
6
|
+
<% if step_classes.present? -%>
|
7
|
+
[
|
8
|
+
<% step_classes.each_with_index do |step_class, index| -%>
|
9
|
+
<%= step_class %><%= "," if index < step_classes.size - 1 %>
|
10
|
+
<% end -%>
|
11
|
+
]
|
12
|
+
<% else -%>
|
13
|
+
[]
|
14
|
+
<% end -%>
|
15
|
+
end
|
16
|
+
end
|
17
|
+
<% end -%>
|
data/wicked-pipeline.gemspec
CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.authors = ["Robert Audi"]
|
9
9
|
spec.email = ["robert@robertaudi.com"]
|
10
10
|
|
11
|
-
spec.summary = "
|
11
|
+
spec.summary = "A step by step pipeline system built on top of Wicked"
|
12
12
|
spec.license = "MIT"
|
13
13
|
spec.required_ruby_version = ">= 2.6.0"
|
14
14
|
|
@@ -23,7 +23,6 @@ Gem::Specification.new do |spec|
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
-
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
27
26
|
spec.require_paths = ["lib"]
|
28
27
|
|
29
28
|
spec.add_dependency "railties", ">= 6.1", "< 7"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wicked-pipeline
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Audi
|
@@ -120,13 +120,24 @@ files:
|
|
120
120
|
- README.md
|
121
121
|
- Rakefile
|
122
122
|
- app/controllers/wicked/pipeline/base_steps_controller.rb
|
123
|
+
- lib/generators/rspec/wicked/pipeline/USAGE
|
124
|
+
- lib/generators/rspec/wicked/pipeline/pipeline_generator.rb
|
125
|
+
- lib/generators/rspec/wicked/pipeline/step/USAGE
|
126
|
+
- lib/generators/rspec/wicked/pipeline/step/step_generator.rb
|
127
|
+
- lib/generators/rspec/wicked/pipeline/step/templates/step_spec.rb.tt
|
128
|
+
- lib/generators/rspec/wicked/pipeline/templates/pipeline_spec.rb.tt
|
129
|
+
- lib/generators/wicked/pipeline/USAGE
|
130
|
+
- lib/generators/wicked/pipeline/pipeline_generator.rb
|
131
|
+
- lib/generators/wicked/pipeline/step/USAGE
|
132
|
+
- lib/generators/wicked/pipeline/step/step_generator.rb
|
133
|
+
- lib/generators/wicked/pipeline/step/templates/step.rb.tt
|
134
|
+
- lib/generators/wicked/pipeline/templates/pipeline.rb.tt
|
123
135
|
- lib/wicked/pipeline.rb
|
124
136
|
- lib/wicked/pipeline/base_pipeline.rb
|
125
137
|
- lib/wicked/pipeline/base_step.rb
|
126
138
|
- lib/wicked/pipeline/engine.rb
|
127
139
|
- lib/wicked/pipeline/readonly_step.rb
|
128
140
|
- lib/wicked/pipeline/version.rb
|
129
|
-
- sig/wicked/pipeline.rbs
|
130
141
|
- wicked-pipeline.gemspec
|
131
142
|
homepage: https://github.com/RobertAudi/wicked-pipeline
|
132
143
|
licenses:
|
@@ -153,5 +164,5 @@ requirements: []
|
|
153
164
|
rubygems_version: 3.3.11
|
154
165
|
signing_key:
|
155
166
|
specification_version: 4
|
156
|
-
summary:
|
167
|
+
summary: A step by step pipeline system built on top of Wicked
|
157
168
|
test_files: []
|