cmdx 1.5.1 → 1.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/LLM.md +12 -3
- data/README.md +4 -5
- data/docs/getting_started.md +11 -2
- data/docs/workflows.md +1 -1
- data/lib/cmdx/version.rb +1 -1
- data/lib/cmdx/workflow.rb +5 -5
- metadata +2 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14a2616a171c3c514fbc553369936eac48fe2fd3d8e406cc4780ee39a483637f
|
4
|
+
data.tar.gz: 28d973a4973c4f2dc5e3acf1c1a09d4a0e0fbe158bc2f3553a5722acb9490051
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 363225923cd389ddca29f5580321ef3fb3efe863b08480a31b505f67ca08db260695e752631f0b58912421679bc43b52bd679c6e3a0441a8d54628f7b09d855c
|
7
|
+
data.tar.gz: 7d479a75b0e048e9eb7385ce31b7f3bc10512856ba9fe95b34bde5b4a833822787a087d0420a6020830fc322846d72e80604ff3706d25795cc486707d1c31726
|
data/CHANGELOG.md
CHANGED
data/LLM.md
CHANGED
@@ -44,11 +44,20 @@ Globally these settings are initialized with sensible defaults.
|
|
44
44
|
|
45
45
|
### Breakpoints
|
46
46
|
|
47
|
-
|
47
|
+
Raise `CMDx::Fault` when a task called with `execute!` returns a matching status.
|
48
48
|
|
49
49
|
```ruby
|
50
50
|
CMDx.configure do |config|
|
51
|
-
|
51
|
+
# String or Array[String]
|
52
|
+
config.task_breakpoints = "failed"
|
53
|
+
end
|
54
|
+
```
|
55
|
+
|
56
|
+
Workflow breakpoints stops execution and of workflow pipeline on the first task that returns a matching status and throws its `CMDx::Fault`.
|
57
|
+
|
58
|
+
```ruby
|
59
|
+
CMDx.configure do |config|
|
60
|
+
# String or Array[String]
|
52
61
|
config.workflow_breakpoints = ["skipped", "failed"]
|
53
62
|
end
|
54
63
|
```
|
@@ -2964,7 +2973,7 @@ Workflow orchestrates sequential execution of multiple tasks in a linear pipelin
|
|
2964
2973
|
|
2965
2974
|
## Declarations
|
2966
2975
|
|
2967
|
-
Tasks execute in declaration order (FIFO). The workflow context propagates to each task, allowing access to data from previous executions.
|
2976
|
+
Tasks execute sequentially in declaration order (FIFO). The workflow context propagates to each task, allowing access to data from previous executions.
|
2968
2977
|
|
2969
2978
|
> [!IMPORTANT]
|
2970
2979
|
> Do **NOT** define a `work` method in workflow tasks. The included module automatically provides the execution logic.
|
data/README.md
CHANGED
@@ -122,13 +122,12 @@ end
|
|
122
122
|
|
123
123
|
## Ecosystem
|
124
124
|
|
125
|
+
- [cmdx-i18n](https://github.com/drexed/cmdx-i18n) - 85+ translations
|
126
|
+
|
125
127
|
The following gems are currently under development:
|
126
128
|
|
127
|
-
- `cmdx-
|
128
|
-
- `cmdx-
|
129
|
-
- `cmdx-minitest` Minitest matchers
|
130
|
-
- `cmdx-jobs` Background job integrations
|
131
|
-
- `cmdx-parallel` Parallel workflow task execution
|
129
|
+
- `cmdx-testing` - RSpec and Minitest matchers
|
130
|
+
- `cmdx-parallel` - Parallel workflow task execution
|
132
131
|
|
133
132
|
## Development
|
134
133
|
|
data/docs/getting_started.md
CHANGED
@@ -54,11 +54,20 @@ Globally these settings are initialized with sensible defaults.
|
|
54
54
|
|
55
55
|
### Breakpoints
|
56
56
|
|
57
|
-
|
57
|
+
Raise `CMDx::Fault` when a task called with `execute!` returns a matching status.
|
58
58
|
|
59
59
|
```ruby
|
60
60
|
CMDx.configure do |config|
|
61
|
-
|
61
|
+
# String or Array[String]
|
62
|
+
config.task_breakpoints = "failed"
|
63
|
+
end
|
64
|
+
```
|
65
|
+
|
66
|
+
Workflow breakpoints stops execution and of workflow pipeline on the first task that returns a matching status and throws its `CMDx::Fault`.
|
67
|
+
|
68
|
+
```ruby
|
69
|
+
CMDx.configure do |config|
|
70
|
+
# String or Array[String]
|
62
71
|
config.workflow_breakpoints = ["skipped", "failed"]
|
63
72
|
end
|
64
73
|
```
|
data/docs/workflows.md
CHANGED
@@ -15,7 +15,7 @@ Workflow orchestrates sequential execution of multiple tasks in a linear pipelin
|
|
15
15
|
|
16
16
|
## Declarations
|
17
17
|
|
18
|
-
Tasks execute in declaration order (FIFO). The workflow context propagates to each task, allowing access to data from previous executions.
|
18
|
+
Tasks execute sequentially in declaration order (FIFO). The workflow context propagates to each task, allowing access to data from previous executions.
|
19
19
|
|
20
20
|
> [!IMPORTANT]
|
21
21
|
> Do **NOT** define a `work` method in workflow tasks. The included module automatically provides the execution logic.
|
data/lib/cmdx/version.rb
CHANGED
data/lib/cmdx/workflow.rb
CHANGED
@@ -35,10 +35,10 @@ module CMDx
|
|
35
35
|
# include CMDx::Workflow
|
36
36
|
# task Task1
|
37
37
|
# task Task2
|
38
|
-
# puts
|
38
|
+
# puts pipeline.size # => 2
|
39
39
|
# end
|
40
|
-
def
|
41
|
-
@
|
40
|
+
def pipeline
|
41
|
+
@pipeline ||= []
|
42
42
|
end
|
43
43
|
|
44
44
|
# Adds multiple tasks to the workflow with optional configuration.
|
@@ -56,7 +56,7 @@ module CMDx
|
|
56
56
|
# tasks ValidateTask, ProcessTask, NotifyTask, breakpoints: [:failure, :halt]
|
57
57
|
# end
|
58
58
|
def tasks(*tasks, **options)
|
59
|
-
|
59
|
+
pipeline << ExecutionGroup.new(
|
60
60
|
tasks.map do |task|
|
61
61
|
next task if task.is_a?(Class) && (task <= Task)
|
62
62
|
|
@@ -107,7 +107,7 @@ module CMDx
|
|
107
107
|
# workflow = DataProcessingWorkflow.new
|
108
108
|
# workflow.work # Stops on first breakpoint encountered
|
109
109
|
def work
|
110
|
-
self.class.
|
110
|
+
self.class.pipeline.each do |group|
|
111
111
|
next unless Utils::Condition.evaluate(self, group.options, self)
|
112
112
|
|
113
113
|
breakpoints = group.options[:breakpoints] || self.class.settings[:workflow_breakpoints]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cmdx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juan Gomez
|
@@ -163,9 +163,7 @@ dependencies:
|
|
163
163
|
- - ">="
|
164
164
|
- !ruby/object:Gem::Version
|
165
165
|
version: '0'
|
166
|
-
description:
|
167
|
-
validation, coercion, callbacks, and workflow orchestration for building maintainable
|
168
|
-
business processes.
|
166
|
+
description: CMDx is a framework for building maintainable business processes.
|
169
167
|
email:
|
170
168
|
- drexed@users.noreply.github.com
|
171
169
|
executables: []
|