cmdx 2.1.0 → 2.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8d3bfaab740912c354bf1fb028b0ba0271760974f23490a9d6b8a67a82bd1675
4
- data.tar.gz: 3c8dca3e0708d701b36dc65cbf7eefa0c14a932b783226c40f9f951886c1edb0
3
+ metadata.gz: 03bacf5f39e3f6588988b533606f53a90cdba94beef7bc2c9303e1e00c53a989
4
+ data.tar.gz: 02f9e8a212ace89b6d9e7b134a9b92b469ce049b553876506e5d6786bede830e
5
5
  SHA512:
6
- metadata.gz: c6d28f1702c1034b55b9ffdad6e902f3d99b741bed3b12131d0fc5f15e7538143ac5a4e15f04e82c1f922d872415256290390b93a926f7a3bc830c046603f25c
7
- data.tar.gz: 63bd3228b4b1fc75acb295d0d10f734e9f7452447568e650252b43a308c1ed9e1552c16a92f7a308e3c0acc87eebe962730ab758c3139a1b0f7c3f46c3664bfd
6
+ metadata.gz: 4d76b548878d4b78ed131a18804c4810d928fa99dfa66cf31723a475e89034ccac16451ed62e1be7880be491911eaef31b215c9540d2a7e4b864b716ac5a8cf7
7
+ data.tar.gz: 107083dfef5796ed6f628b662d1920bb0e7028e0ea9a56ecaf63d979f261c248d6ab113c3881079522352abe97fdde451d8e741403a77f1b38ea2b082d003179
data/CHANGELOG.md CHANGED
@@ -6,6 +6,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
 
7
7
  ## [2.x.x] - UNRELEASED
8
8
 
9
+ ## [2.1.1] - 2026-07-26
10
+
11
+ ### Added
12
+ - `Result#to_h` includes `:errors` (`Errors#to_h`) for structured validation messages in logs, telemetry, and JSON serialization
13
+
14
+ ### Fixed
15
+ - `Input` resolution continues coerce → transform → validate when the key is present (including explicit `nil`) instead of stopping after defaults; omitted keys still stop when the value is `nil` after defaults
16
+
17
+ ## [2.1.0] - 2026-05-19
18
+
9
19
  ### Added
10
20
  - `Result#error` — convenience returning `cause` (rescued `Exception`) when a failure was raised, otherwise the `reason` `String`; `nil` for non-failed results. Lets telemetry adapters branch on type without repeating the `cause || reason` dance
11
21
  - Middlewares and lifecycle callbacks may halt the task with `success!` / `skip!` / `fail!` / `throw!` — `Runtime#execute` now wraps the middleware chain in `catch(Signal::TAG)` so a signal thrown before yielding to `next_link` becomes the task's outcome instead of an `UncaughtThrowError`
data/lib/cmdx/input.rb CHANGED
@@ -189,7 +189,7 @@ module CMDx
189
189
  end
190
190
 
191
191
  value = apply_default(task) if value.nil?
192
- return if value.nil?
192
+ return if value.nil? && !key_provided
193
193
 
194
194
  @coercions ||= task.class.coercions.extract(@options)
195
195
  value = task.class.coercions.coerce(task, accessor_name, value, @coercions)
data/lib/cmdx/result.rb CHANGED
@@ -273,9 +273,9 @@ module CMDx
273
273
  task.settings.tags
274
274
  end
275
275
 
276
- # @return [Hash{Symbol => Object}] memoized serialization. Includes
277
- # `:cause`, `:origin`, `:threw_failure`, `:caused_failure`, `:rolled_back`
278
- # on failure.
276
+ # @return [Hash{Symbol => Object}] memoized serialization. `:errors` mirrors
277
+ # {Errors#to_h}. Includes `:cause`, `:origin`, `:threw_failure`,
278
+ # `:caused_failure`, `:rolled_back` on failure.
279
279
  def to_h
280
280
  @to_h ||= {
281
281
  xid:,
@@ -290,6 +290,7 @@ module CMDx
290
290
  status:,
291
291
  reason:,
292
292
  metadata:,
293
+ errors: errors.to_h,
293
294
  strict: strict?,
294
295
  deprecated: deprecated?,
295
296
  retried: retried?,
data/lib/cmdx/version.rb CHANGED
@@ -3,6 +3,6 @@
3
3
  module CMDx
4
4
 
5
5
  # Gem version. Bumped on release; mirrored in the gemspec.
6
- VERSION = "2.1.0"
6
+ VERSION = "2.1.1"
7
7
 
8
8
  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: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Gomez
@@ -312,7 +312,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
312
312
  - !ruby/object:Gem::Version
313
313
  version: '0'
314
314
  requirements: []
315
- rubygems_version: 4.0.11
315
+ rubygems_version: 4.0.13
316
316
  specification_version: 4
317
317
  summary: CMDx is a framework for building maintainable business processes.
318
318
  test_files: []