cmdx 1.1.0 → 1.1.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.
Files changed (89) hide show
  1. checksums.yaml +4 -4
  2. data/.cursor/prompts/docs.md +9 -0
  3. data/.cursor/prompts/rspec.md +13 -12
  4. data/.cursor/prompts/yardoc.md +11 -6
  5. data/.ruby-version +1 -1
  6. data/CHANGELOG.md +19 -2
  7. data/README.md +1 -0
  8. data/docs/ai_prompts.md +269 -195
  9. data/docs/basics/call.md +124 -58
  10. data/docs/basics/chain.md +190 -160
  11. data/docs/basics/context.md +242 -154
  12. data/docs/basics/setup.md +302 -32
  13. data/docs/callbacks.md +390 -94
  14. data/docs/configuration.md +181 -65
  15. data/docs/deprecation.md +245 -0
  16. data/docs/getting_started.md +161 -39
  17. data/docs/internationalization.md +590 -70
  18. data/docs/interruptions/exceptions.md +135 -118
  19. data/docs/interruptions/faults.md +150 -125
  20. data/docs/interruptions/halt.md +134 -80
  21. data/docs/logging.md +181 -118
  22. data/docs/middlewares.md +150 -377
  23. data/docs/outcomes/result.md +140 -112
  24. data/docs/outcomes/states.md +134 -99
  25. data/docs/outcomes/statuses.md +204 -146
  26. data/docs/parameters/coercions.md +232 -281
  27. data/docs/parameters/defaults.md +224 -169
  28. data/docs/parameters/definitions.md +289 -141
  29. data/docs/parameters/namespacing.md +250 -161
  30. data/docs/parameters/validations.md +260 -133
  31. data/docs/testing.md +191 -197
  32. data/docs/workflows.md +143 -98
  33. data/lib/cmdx/callback.rb +23 -19
  34. data/lib/cmdx/callback_registry.rb +1 -3
  35. data/lib/cmdx/chain_inspector.rb +23 -23
  36. data/lib/cmdx/chain_serializer.rb +38 -19
  37. data/lib/cmdx/coercion.rb +20 -12
  38. data/lib/cmdx/coercion_registry.rb +51 -32
  39. data/lib/cmdx/configuration.rb +84 -31
  40. data/lib/cmdx/context.rb +32 -21
  41. data/lib/cmdx/core_ext/hash.rb +13 -13
  42. data/lib/cmdx/core_ext/module.rb +1 -1
  43. data/lib/cmdx/core_ext/object.rb +12 -12
  44. data/lib/cmdx/correlator.rb +60 -39
  45. data/lib/cmdx/error.rb +7 -0
  46. data/lib/cmdx/errors.rb +105 -131
  47. data/lib/cmdx/fault.rb +66 -45
  48. data/lib/cmdx/immutator.rb +20 -21
  49. data/lib/cmdx/lazy_struct.rb +78 -70
  50. data/lib/cmdx/log_formatters/json.rb +1 -1
  51. data/lib/cmdx/log_formatters/key_value.rb +1 -1
  52. data/lib/cmdx/log_formatters/line.rb +1 -1
  53. data/lib/cmdx/log_formatters/logstash.rb +1 -1
  54. data/lib/cmdx/log_formatters/pretty_json.rb +1 -1
  55. data/lib/cmdx/log_formatters/pretty_key_value.rb +1 -1
  56. data/lib/cmdx/log_formatters/pretty_line.rb +1 -1
  57. data/lib/cmdx/log_formatters/raw.rb +2 -2
  58. data/lib/cmdx/logger.rb +19 -14
  59. data/lib/cmdx/logger_ansi.rb +33 -17
  60. data/lib/cmdx/logger_serializer.rb +85 -24
  61. data/lib/cmdx/middleware.rb +39 -21
  62. data/lib/cmdx/middleware_registry.rb +4 -3
  63. data/lib/cmdx/parameter.rb +151 -89
  64. data/lib/cmdx/parameter_inspector.rb +34 -21
  65. data/lib/cmdx/parameter_registry.rb +36 -30
  66. data/lib/cmdx/parameter_serializer.rb +21 -14
  67. data/lib/cmdx/result.rb +136 -135
  68. data/lib/cmdx/result_ansi.rb +31 -17
  69. data/lib/cmdx/result_inspector.rb +32 -27
  70. data/lib/cmdx/result_logger.rb +23 -14
  71. data/lib/cmdx/result_serializer.rb +65 -27
  72. data/lib/cmdx/task.rb +234 -113
  73. data/lib/cmdx/task_deprecator.rb +30 -27
  74. data/lib/cmdx/task_processor.rb +89 -88
  75. data/lib/cmdx/task_serializer.rb +27 -14
  76. data/lib/cmdx/utils/monotonic_runtime.rb +2 -4
  77. data/lib/cmdx/validator.rb +25 -16
  78. data/lib/cmdx/validator_registry.rb +53 -31
  79. data/lib/cmdx/validators/exclusion.rb +1 -1
  80. data/lib/cmdx/validators/format.rb +2 -2
  81. data/lib/cmdx/validators/inclusion.rb +2 -2
  82. data/lib/cmdx/validators/length.rb +2 -2
  83. data/lib/cmdx/validators/numeric.rb +3 -3
  84. data/lib/cmdx/validators/presence.rb +2 -2
  85. data/lib/cmdx/version.rb +1 -1
  86. data/lib/cmdx/workflow.rb +54 -33
  87. data/lib/generators/cmdx/task_generator.rb +6 -6
  88. data/lib/generators/cmdx/workflow_generator.rb +6 -6
  89. metadata +4 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3bd1613d4572cca134192d5c80bf3016b278b42a9a002d13fba66d2871da92fb
4
- data.tar.gz: 1a174bc8b62bf3402e1e464b8252cdcd589731f8e81141723b8dbf3cf97f9f1b
3
+ metadata.gz: 3dda80e40c4516ca1578dc67755ad2a5d97f55c3ce1137d80e2cee11460ab145
4
+ data.tar.gz: a42b255005f0d6fd52053948b9ba7839af23ddcffea51bd2382400e02c820b8a
5
5
  SHA512:
6
- metadata.gz: df70552dbf814fddff62cb3e1d593edf6bf5c33087d84154f36c794d430ee156b986998651383fa15b3b08e4d14d198d69020bb0dec7a13ffab43c75b1c57b02
7
- data.tar.gz: 03ad35b1f6007e1afa3c41f3b63d44784566e78b9eb9b7f25f301d81165753af14b06bb8a6cfd67ea7e5bce02a03c311c338f61538d9d981d7de58d7f2b36f8f
6
+ metadata.gz: c5510e7d51eb74f5c4250ccfa6f84bf299b9cea0c5caa38f68c269381be0feb8914eb325307002e7f2d96cbc3677a442206a09ad69f81acb36248f6f5aa684d3
7
+ data.tar.gz: 1f0073fbbfd2c578a3ea070fea968e1cbe92b152c1c7d9ffd2cd89729a4e5a017c12b1ce581bf3f61b37b426dc884ffb403f1247969ff7a766e75cf0799b483f
@@ -0,0 +1,9 @@
1
+ Update the file in context using the following guidelines:
2
+
3
+ - Follow best practices and implementation
4
+ - Use a consistent professional voice
5
+ - Examples should be concise, non-repetitive, and realistic
6
+ - Update any pre-existing documentation to match stated rules
7
+ - Examples should not cross boundaries or focus
8
+ - Docs must cover both typical use cases, including invalid inputs and error conditions
9
+ - Use GitHub flavored markdown, including alerts to emphasize critical information (https://github.com/orgs/community/discussions/16925)
@@ -1,20 +1,21 @@
1
- Add tests for the file in context.
1
+ Add tests for the file in context using the following guidelines:
2
+
2
3
  - Expectations should be concise, non-repetitive, and realistic (how it would be used in the real world)
3
4
  - Follow best practices and implementation
4
5
  - Update any pre-existing specs to match stated rules
5
6
  - New tests should be consistent with current `spec/cmdx` specs
6
7
  - Use custom matchers available within `lib/cmdx/rspec`
7
8
  - Use task helpers available within `spec/support/helpers`
8
- - Use stubs to return predefined values for specific methods. Isolate the unit being tested, but avoid over-mocking; test real behavior when possible. (mocks should be used only when necessary)
9
- - Ensure each test is independent; avoid shared state between tests.
10
- - Use let and let! to define test data, ensuring minimal and necessary setup.
9
+ - Use stubs to return predefined values for specific methods. Isolate the unit being tested, but avoid over-mocking; test real behavior when possible (mocks should be used only when necessary)
10
+ - Ensure each test is independent; avoid shared state between tests
11
+ - Use let and let! to define test data, ensuring minimal and necessary setup
11
12
  - Context block descriptions should start with the following words: `when`, `with`, `without`
12
- - Organize tests logically using describe for classes/modules and context for different scenarios.
13
- - Use subject to define the object under test when appropriate to avoid repetition.
14
- - Ensure test file paths mirror the structure of the files being tested, but within the spec directory (e.g., lib/cmdx/task.rb → spec/cmdx/task_spec.rb).
15
- - Use clear and descriptive names for describe, context, and it blocks.
16
- - Prefer the expect syntax for assertions to improve readability.
17
- - Keep test code concise; avoid unnecessary complexity or duplication.
18
- - Tests must cover both typical cases and edge cases, including invalid inputs and error conditions.
19
- - Consider all possible scenarios for each method or behavior and ensure they are tested.
13
+ - Organize tests logically using describe for classes/modules and context for different scenarios
14
+ - Use subject to define the object under test when appropriate to avoid repetition
15
+ - Ensure test file paths mirror the structure of the files being tested, but within the spec directory (e.g., lib/cmdx/task.rb → spec/cmdx/task_spec.rb)
16
+ - Use clear and descriptive names for describe, context, and it blocks
17
+ - Prefer the expect syntax for assertions to improve readability
18
+ - Keep test code concise; avoid unnecessary complexity or duplication
19
+ - Tests must cover both typical cases and edge cases, including invalid inputs and error conditions
20
+ - Consider all possible scenarios for each method or behavior and ensure they are tested
20
21
  - Verify all specs are passing
@@ -1,8 +1,13 @@
1
- Add yardoc to the file in context.
2
- - Do NOT include `CMDx` module level docs
3
- - Module level docs description should NOT include `@example`
4
- - Method level docs should include `@example`, `@return`, `@raise`
5
- - Examples should be concise and realistic
1
+ Add yardoc to the file in context using the following guidelines:
2
+
6
3
  - Follow best practices and implementation
7
- - Update any pre-existing docs to match stated rules
8
4
  - New documentation should be consistent with current `lib/cmdx` documentation
5
+ - Examples should be concise, non-repetitive, and realistic
6
+ - Avoid unnecessary complexity or duplication
7
+ - Consider all possible scenarios for each method or behavior and ensure they are tested.
8
+ - Update any pre-existing documentation to match stated rules
9
+ - Do NOT include `CMDx` module level docs
10
+ - Module level docs description should NOT include `@example`
11
+ - Method level docs should include `@example`, `param`, `@options`, `@return`, and any `@raise`
12
+ - Hash `@params` should expand with possible `@option`
13
+ - Module and method level docs should NOT include `@since`
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.4.4
1
+ 3.4.5
data/CHANGELOG.md CHANGED
@@ -7,16 +7,33 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [TODO]
9
9
 
10
- - Add table and pretty_table log formatters
11
- - Refactor all `docs`
10
+ - Rebuild parameters to use a less magical approach
11
+ - Revert deprecator to use old options
12
+ - Validators to add errors directly instead of raising errors
13
+ - Coercions to add errors directly instead of raising errors
14
+ - Update procs to call with object as first item
12
15
 
13
16
  ## [Unreleased]
14
17
 
18
+ ## [1.1.2] - 2025-07-20
19
+
20
+ ### Added
21
+ - Add `UnknownDeprecationError` for unknown deprecation type
22
+
23
+ ## [1.1.1] - 2025-07-20
24
+
25
+ ### Changed
26
+ - Updated all docs and specs
27
+ - Update deprecation key words
28
+
29
+ ## [1.1.0] - 2025-07-17
30
+
15
31
  ### Added
16
32
  - Added `CoercionRegistry` class for managing parameter coercions with support for custom type registration
17
33
  - Added `ValidatorRegistry` class for managing parameter validators with support for custom validator registration
18
34
  - Added `CallbackRegistry` class to take uninstantiated callback classes
19
35
  - Added `Validator` and `Coercion` classes to build their respective handlers
36
+ - Added deprecation setting
20
37
 
21
38
  ### Changed
22
39
  - Moved `Task::CALLBACKS` constant to `CallbackRegistry::TYPES`
data/README.md CHANGED
@@ -102,6 +102,7 @@ end
102
102
  - [Logging](docs/logging.md)
103
103
  - [Internationalization (i18n)](docs/internationalization.md)
104
104
  - [Testing](docs/testing.md)
105
+ - [Deprecation](docs/deprecation.md)
105
106
  - [AI Prompts](docs/ai_prompts.md)
106
107
  - [Tips & Tricks](docs/tips_and_tricks.md)
107
108