cmdx 1.6.1 → 1.6.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/.cursor/rules/cursor-instructions.mdc +2 -2
- data/CHANGELOG.md +7 -1
- data/LLM.md +19 -0
- data/docs/attributes/coercions.md +2 -0
- data/docs/attributes/validations.md +2 -0
- data/docs/callbacks.md +2 -0
- data/docs/getting_started.md +8 -0
- data/docs/middlewares.md +2 -0
- data/lib/cmdx/railtie.rb +2 -2
- data/lib/cmdx/version.rb +1 -1
- data/lib/generators/cmdx/templates/install.rb +7 -0
- metadata +15 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c8b62e944f3c8fdb0f69dba9e33e3aad9f62d90b6a7487b18e9c0104392c4a8d
|
4
|
+
data.tar.gz: a032133acd6f0e6d5999d8336a179df495fd4460fbf632385a8dbcd4ee31fd66
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05a82e75e96e364df809f158a791a015ce22cff03b10f1ae255ba2e116d602fadd741d0a82638c5feabcbbdf96e3e61e9a9ae54be8c3220253d542f0d8a303d5
|
7
|
+
data.tar.gz: 881fe8149e8a029fbb79a1164faced4406f4f28d1e206659e09ee460129d9246a9a074aef76a61cbd94a38ed4f1a39612753a6842460e3a3827b3bd1c5301cc1
|
@@ -10,8 +10,8 @@ Follow the official Ruby gem guides for best practices.
|
|
10
10
|
Reference the guides outlined in https://guides.rubygems.org
|
11
11
|
|
12
12
|
## Project Context
|
13
|
-
CMDx provides a framework for designing and executing complex
|
14
|
-
|
13
|
+
CMDx provides a framework for designing and executing complex business logic within service/command objects.
|
14
|
+
Reference the CMDx documentation in https://github.com/drexed/cmdx/blob/main/LLM.md
|
15
15
|
|
16
16
|
## Technology Stack
|
17
17
|
- Ruby 3.4+
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
|
7
7
|
## [TODO]
|
8
8
|
|
9
|
+
## [1.6.2] - 2025-08-24
|
10
|
+
|
11
|
+
### Changes
|
12
|
+
- Prefix railtie I18n with `::` to play nice with `CMDx::I18n`
|
13
|
+
- Use `cmdx-rspec` for matchers support
|
14
|
+
|
9
15
|
## [1.6.1] - 2025-08-23
|
10
16
|
|
11
17
|
### Changes
|
@@ -27,7 +33,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
27
33
|
## [1.5.1] - 2025-08-21
|
28
34
|
|
29
35
|
### Changes
|
30
|
-
- Prefix I18n with `::` to play nice with `CMDx::I18n`
|
36
|
+
- Prefix locale I18n with `::` to play nice with `CMDx::I18n`
|
31
37
|
- Safe navigate length and numeric validators
|
32
38
|
- Update railtie file path points to correct directory
|
33
39
|
|
data/LLM.md
CHANGED
@@ -72,6 +72,8 @@ end
|
|
72
72
|
|
73
73
|
### Middlewares
|
74
74
|
|
75
|
+
See the [Middelwares](#https://github.com/drexed/cmdx/blob/main/docs/middlewares.md#declarations) docs for task level configurations.
|
76
|
+
|
75
77
|
```ruby
|
76
78
|
CMDx.configure do |config|
|
77
79
|
# Via callable (must respond to `call(task, options)`)
|
@@ -99,6 +101,8 @@ end
|
|
99
101
|
|
100
102
|
### Callbacks
|
101
103
|
|
104
|
+
See the [Callbacks](#https://github.com/drexed/cmdx/blob/main/docs/callbacks.md#declarations) docs for task level configurations.
|
105
|
+
|
102
106
|
```ruby
|
103
107
|
CMDx.configure do |config|
|
104
108
|
# Via method
|
@@ -123,6 +127,8 @@ end
|
|
123
127
|
|
124
128
|
### Coercions
|
125
129
|
|
130
|
+
See the [Attributes - Coercions](#https://github.com/drexed/cmdx/blob/main/docs/attributes/coercions.md#declarations) docs for task level configurations.
|
131
|
+
|
126
132
|
```ruby
|
127
133
|
CMDx.configure do |config|
|
128
134
|
# Via callable (must respond to `call(value, options)`)
|
@@ -147,6 +153,8 @@ end
|
|
147
153
|
|
148
154
|
### Validators
|
149
155
|
|
156
|
+
See the [Attributes - Validations](#https://github.com/drexed/cmdx/blob/main/docs/attributes/validations.md#declarations) docs for task level configurations.
|
157
|
+
|
150
158
|
```ruby
|
151
159
|
CMDx.configure do |config|
|
152
160
|
# Via callable (must respond to `call(value, options)`)
|
@@ -907,6 +915,7 @@ fail!("Unsupported")
|
|
907
915
|
# Bad: Default, cannot determine reason
|
908
916
|
skip! #=> "no reason given"
|
909
917
|
fail! #=> "no reason given"
|
918
|
+
```
|
910
919
|
|
911
920
|
---
|
912
921
|
|
@@ -1727,6 +1736,7 @@ result.metadata #=> {
|
|
1727
1736
|
# port: ["is required"]
|
1728
1737
|
# }
|
1729
1738
|
# }
|
1739
|
+
```
|
1730
1740
|
|
1731
1741
|
---
|
1732
1742
|
|
@@ -1810,6 +1820,8 @@ url: https://github.com/drexed/cmdx/blob/main/docs/attributes/coercions.md
|
|
1810
1820
|
|
1811
1821
|
Attribute coercions automatically convert task arguments to expected types, ensuring type safety while providing flexible input handling. Coercions transform raw input values into the specified types, supporting simple conversions like string-to-integer and complex operations like JSON parsing.
|
1812
1822
|
|
1823
|
+
Check out the [Getting Started](https://github.com/drexed/cmdx/blob/main/docs/getting_started.md#coercions) docs for global configuration.
|
1824
|
+
|
1813
1825
|
## Usage
|
1814
1826
|
|
1815
1827
|
Define attribute types to enable automatic coercion:
|
@@ -1952,6 +1964,7 @@ result.metadata #=> {
|
|
1952
1964
|
# score: ["could not coerce into one of: float, big_decimal"]
|
1953
1965
|
# }
|
1954
1966
|
# }
|
1967
|
+
```
|
1955
1968
|
|
1956
1969
|
---
|
1957
1970
|
|
@@ -1962,6 +1975,8 @@ url: https://github.com/drexed/cmdx/blob/main/docs/attributes/validations.md
|
|
1962
1975
|
|
1963
1976
|
Attribute validations ensure task arguments meet specified requirements before execution begins. Validations run after coercions and provide declarative rules for data integrity, supporting both built-in validators and custom validation logic.
|
1964
1977
|
|
1978
|
+
Check out the [Getting Started](https://github.com/drexed/cmdx/blob/main/docs/getting_started.md#validations) docs for global configuration.
|
1979
|
+
|
1965
1980
|
## Usage
|
1966
1981
|
|
1967
1982
|
Define validation rules on attributes to enforce data requirements:
|
@@ -2338,6 +2353,8 @@ url: https://github.com/drexed/cmdx/blob/main/docs/callbacks.md
|
|
2338
2353
|
|
2339
2354
|
Callbacks provide precise control over task execution lifecycle, running custom logic at specific transition points. Callback callables have access to the same context and result information as the `execute` method, enabling rich integration patterns.
|
2340
2355
|
|
2356
|
+
Check out the [Getting Started](https://github.com/drexed/cmdx/blob/main/docs/getting_started.md#callbacks) docs for global configuration.
|
2357
|
+
|
2341
2358
|
> [!IMPORTANT]
|
2342
2359
|
> Callbacks execute in the order they are declared within each hook type. Multiple callbacks of the same type execute in declaration order (FIFO: first in, first out).
|
2343
2360
|
|
@@ -2497,6 +2514,8 @@ url: https://github.com/drexed/cmdx/blob/main/docs/middlewares.md
|
|
2497
2514
|
|
2498
2515
|
Middleware provides Rack-style wrappers around task execution for cross-cutting concerns like authentication, logging, caching, and error handling.
|
2499
2516
|
|
2517
|
+
Check out the [Getting Started](https://github.com/drexed/cmdx/blob/main/docs/getting_started.md#middlewares) docs for global configuration.
|
2518
|
+
|
2500
2519
|
## Order
|
2501
2520
|
|
2502
2521
|
Middleware executes in a nested fashion, creating an onion-like execution pattern:
|
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
Attribute coercions automatically convert task arguments to expected types, ensuring type safety while providing flexible input handling. Coercions transform raw input values into the specified types, supporting simple conversions like string-to-integer and complex operations like JSON parsing.
|
4
4
|
|
5
|
+
Check out the [Getting Started](https://github.com/drexed/cmdx/blob/main/docs/getting_started.md#coercions) docs for global configuration.
|
6
|
+
|
5
7
|
## Table of Contents
|
6
8
|
|
7
9
|
- [Usage](#usage)
|
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
Attribute validations ensure task arguments meet specified requirements before execution begins. Validations run after coercions and provide declarative rules for data integrity, supporting both built-in validators and custom validation logic.
|
4
4
|
|
5
|
+
Check out the [Getting Started](https://github.com/drexed/cmdx/blob/main/docs/getting_started.md#validations) docs for global configuration.
|
6
|
+
|
5
7
|
## Table of Contents
|
6
8
|
|
7
9
|
- [Usage](#usage)
|
data/docs/callbacks.md
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
Callbacks provide precise control over task execution lifecycle, running custom logic at specific transition points. Callback callables have access to the same context and result information as the `execute` method, enabling rich integration patterns.
|
4
4
|
|
5
|
+
Check out the [Getting Started](https://github.com/drexed/cmdx/blob/main/docs/getting_started.md#callbacks) docs for global configuration.
|
6
|
+
|
5
7
|
> [!IMPORTANT]
|
6
8
|
> Callbacks execute in the order they are declared within each hook type. Multiple callbacks of the same type execute in declaration order (FIFO: first in, first out).
|
7
9
|
|
data/docs/getting_started.md
CHANGED
@@ -82,6 +82,8 @@ end
|
|
82
82
|
|
83
83
|
### Middlewares
|
84
84
|
|
85
|
+
See the [Middelwares](#https://github.com/drexed/cmdx/blob/main/docs/middlewares.md#declarations) docs for task level configurations.
|
86
|
+
|
85
87
|
```ruby
|
86
88
|
CMDx.configure do |config|
|
87
89
|
# Via callable (must respond to `call(task, options)`)
|
@@ -109,6 +111,8 @@ end
|
|
109
111
|
|
110
112
|
### Callbacks
|
111
113
|
|
114
|
+
See the [Callbacks](#https://github.com/drexed/cmdx/blob/main/docs/callbacks.md#declarations) docs for task level configurations.
|
115
|
+
|
112
116
|
```ruby
|
113
117
|
CMDx.configure do |config|
|
114
118
|
# Via method
|
@@ -133,6 +137,8 @@ end
|
|
133
137
|
|
134
138
|
### Coercions
|
135
139
|
|
140
|
+
See the [Attributes - Coercions](#https://github.com/drexed/cmdx/blob/main/docs/attributes/coercions.md#declarations) docs for task level configurations.
|
141
|
+
|
136
142
|
```ruby
|
137
143
|
CMDx.configure do |config|
|
138
144
|
# Via callable (must respond to `call(value, options)`)
|
@@ -157,6 +163,8 @@ end
|
|
157
163
|
|
158
164
|
### Validators
|
159
165
|
|
166
|
+
See the [Attributes - Validations](#https://github.com/drexed/cmdx/blob/main/docs/attributes/validations.md#declarations) docs for task level configurations.
|
167
|
+
|
160
168
|
```ruby
|
161
169
|
CMDx.configure do |config|
|
162
170
|
# Via callable (must respond to `call(value, options)`)
|
data/docs/middlewares.md
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
Middleware provides Rack-style wrappers around task execution for cross-cutting concerns like authentication, logging, caching, and error handling.
|
4
4
|
|
5
|
+
Check out the [Getting Started](https://github.com/drexed/cmdx/blob/main/docs/getting_started.md#middlewares) docs for global configuration.
|
6
|
+
|
5
7
|
## Table of Contents
|
6
8
|
|
7
9
|
- [Order](#order)
|
data/lib/cmdx/railtie.rb
CHANGED
data/lib/cmdx/version.rb
CHANGED
@@ -31,4 +31,11 @@ CMDx.configure do |config|
|
|
31
31
|
formatter: CMDx::LogFormatters::Line.new,
|
32
32
|
level: Logger::INFO
|
33
33
|
)
|
34
|
+
|
35
|
+
# Additional global configurations - automatically applied to all tasks
|
36
|
+
#
|
37
|
+
# Middlewares - https://github.com/drexed/cmdx/blob/main/docs/middlewares.md
|
38
|
+
# Callbacks - https://github.com/drexed/cmdx/blob/main/docs/callbacks.md
|
39
|
+
# Coercions - https://github.com/drexed/cmdx/blob/main/docs/coercions.md
|
40
|
+
# Validations - https://github.com/drexed/cmdx/blob/main/docs/validations.md
|
34
41
|
end
|
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.6.
|
4
|
+
version: 1.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juan Gomez
|
@@ -65,6 +65,20 @@ dependencies:
|
|
65
65
|
- - ">="
|
66
66
|
- !ruby/object:Gem::Version
|
67
67
|
version: '0'
|
68
|
+
- !ruby/object:Gem::Dependency
|
69
|
+
name: cmdx-rspec
|
70
|
+
requirement: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
75
|
+
type: :development
|
76
|
+
prerelease: false
|
77
|
+
version_requirements: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ">="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '0'
|
68
82
|
- !ruby/object:Gem::Dependency
|
69
83
|
name: i18n
|
70
84
|
requirement: !ruby/object:Gem::Requirement
|