cmdx 1.13.0 → 1.15.0
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 +92 -76
- data/LICENSE.txt +3 -20
- data/README.md +16 -8
- data/lib/cmdx/attribute.rb +42 -5
- data/lib/cmdx/context.rb +16 -0
- data/lib/cmdx/executor.rb +9 -9
- data/lib/cmdx/result.rb +27 -7
- data/lib/cmdx/task.rb +19 -0
- data/lib/cmdx/validator_registry.rb +1 -0
- data/lib/cmdx/validators/absence.rb +61 -0
- data/lib/cmdx/version.rb +1 -1
- data/lib/locales/af.yml +1 -0
- data/lib/locales/ar.yml +1 -0
- data/lib/locales/az.yml +1 -0
- data/lib/locales/be.yml +1 -0
- data/lib/locales/bg.yml +1 -0
- data/lib/locales/bn.yml +1 -0
- data/lib/locales/bs.yml +1 -0
- data/lib/locales/ca.yml +1 -0
- data/lib/locales/cnr.yml +1 -0
- data/lib/locales/cs.yml +1 -0
- data/lib/locales/cy.yml +1 -0
- data/lib/locales/da.yml +1 -0
- data/lib/locales/de.yml +1 -0
- data/lib/locales/dz.yml +1 -0
- data/lib/locales/el.yml +1 -0
- data/lib/locales/en.yml +1 -0
- data/lib/locales/eo.yml +1 -0
- data/lib/locales/es.yml +1 -0
- data/lib/locales/et.yml +1 -0
- data/lib/locales/eu.yml +1 -0
- data/lib/locales/fa.yml +1 -0
- data/lib/locales/fi.yml +1 -0
- data/lib/locales/fr.yml +1 -0
- data/lib/locales/fy.yml +1 -0
- data/lib/locales/gd.yml +1 -0
- data/lib/locales/gl.yml +1 -0
- data/lib/locales/he.yml +1 -0
- data/lib/locales/hi.yml +1 -0
- data/lib/locales/hr.yml +1 -0
- data/lib/locales/hu.yml +1 -0
- data/lib/locales/hy.yml +1 -0
- data/lib/locales/id.yml +1 -0
- data/lib/locales/is.yml +1 -0
- data/lib/locales/it.yml +1 -0
- data/lib/locales/ja.yml +1 -0
- data/lib/locales/ka.yml +1 -0
- data/lib/locales/kk.yml +1 -0
- data/lib/locales/km.yml +1 -0
- data/lib/locales/kn.yml +1 -0
- data/lib/locales/ko.yml +1 -0
- data/lib/locales/lb.yml +1 -0
- data/lib/locales/lo.yml +1 -0
- data/lib/locales/lt.yml +1 -0
- data/lib/locales/lv.yml +1 -0
- data/lib/locales/mg.yml +1 -0
- data/lib/locales/mk.yml +1 -0
- data/lib/locales/ml.yml +1 -0
- data/lib/locales/mn.yml +1 -0
- data/lib/locales/mr-IN.yml +1 -0
- data/lib/locales/ms.yml +1 -0
- data/lib/locales/nb.yml +1 -0
- data/lib/locales/ne.yml +1 -0
- data/lib/locales/nl.yml +1 -0
- data/lib/locales/nn.yml +1 -0
- data/lib/locales/oc.yml +1 -0
- data/lib/locales/or.yml +1 -0
- data/lib/locales/pa.yml +1 -0
- data/lib/locales/pl.yml +1 -0
- data/lib/locales/pt.yml +1 -0
- data/lib/locales/rm.yml +1 -0
- data/lib/locales/ro.yml +1 -0
- data/lib/locales/ru.yml +1 -0
- data/lib/locales/sc.yml +1 -0
- data/lib/locales/sk.yml +1 -0
- data/lib/locales/sl.yml +1 -0
- data/lib/locales/sq.yml +1 -0
- data/lib/locales/sr.yml +1 -0
- data/lib/locales/st.yml +1 -0
- data/lib/locales/sv.yml +1 -0
- data/lib/locales/sw.yml +1 -0
- data/lib/locales/ta.yml +1 -0
- data/lib/locales/te.yml +1 -0
- data/lib/locales/th.yml +1 -0
- data/lib/locales/tl.yml +1 -0
- data/lib/locales/tr.yml +1 -0
- data/lib/locales/tt.yml +1 -0
- data/lib/locales/ug.yml +1 -0
- data/lib/locales/uk.yml +1 -0
- data/lib/locales/ur.yml +1 -0
- data/lib/locales/uz.yml +1 -0
- data/lib/locales/vi.yml +1 -0
- data/lib/locales/wo.yml +1 -0
- data/lib/locales/zh-CN.yml +1 -0
- data/lib/locales/zh-HK.yml +1 -0
- data/lib/locales/zh-TW.yml +1 -0
- data/lib/locales/zh-YUE.yml +1 -0
- data/mkdocs.yml +65 -36
- metadata +4 -57
- data/.cursor/prompts/docs.md +0 -12
- data/.cursor/prompts/llms.md +0 -8
- data/.cursor/prompts/rspec.md +0 -24
- data/.cursor/prompts/yardoc.md +0 -15
- data/.cursor/rules/cursor-instructions.mdc +0 -68
- data/.irbrc +0 -18
- data/.rspec +0 -4
- data/.rubocop.yml +0 -95
- data/.ruby-version +0 -1
- data/.yard-lint.yml +0 -174
- data/.yardopts +0 -7
- data/docs/.DS_Store +0 -0
- data/docs/assets/favicon.ico +0 -0
- data/docs/assets/favicon.svg +0 -1
- data/docs/attributes/coercions.md +0 -155
- data/docs/attributes/defaults.md +0 -77
- data/docs/attributes/definitions.md +0 -283
- data/docs/attributes/naming.md +0 -68
- data/docs/attributes/transformations.md +0 -63
- data/docs/attributes/validations.md +0 -336
- data/docs/basics/chain.md +0 -108
- data/docs/basics/context.md +0 -121
- data/docs/basics/execution.md +0 -152
- data/docs/basics/setup.md +0 -107
- data/docs/callbacks.md +0 -157
- data/docs/configuration.md +0 -314
- data/docs/deprecation.md +0 -143
- data/docs/getting_started.md +0 -137
- data/docs/index.md +0 -134
- data/docs/internationalization.md +0 -126
- data/docs/interruptions/exceptions.md +0 -52
- data/docs/interruptions/faults.md +0 -169
- data/docs/interruptions/halt.md +0 -216
- data/docs/logging.md +0 -90
- data/docs/middlewares.md +0 -191
- data/docs/outcomes/result.md +0 -197
- data/docs/outcomes/states.md +0 -66
- data/docs/outcomes/statuses.md +0 -65
- data/docs/retries.md +0 -121
- data/docs/stylesheets/extra.css +0 -42
- data/docs/tips_and_tricks.md +0 -157
- data/docs/workflows.md +0 -226
- data/examples/active_record_database_transaction.md +0 -27
- data/examples/active_record_query_tagging.md +0 -46
- data/examples/flipper_feature_flags.md +0 -50
- data/examples/paper_trail_whatdunnit.md +0 -39
- data/examples/redis_idempotency.md +0 -71
- data/examples/sentry_error_tracking.md +0 -46
- data/examples/sidekiq_async_execution.md +0 -29
- data/examples/stoplight_circuit_breaker.md +0 -36
- data/src/cmdx-dark-logo.png +0 -0
- data/src/cmdx-favicon.svg +0 -1
- data/src/cmdx-light-logo.png +0 -0
- data/src/cmdx-logo.svg +0 -1
data/lib/locales/ru.yml
CHANGED
data/lib/locales/sc.yml
CHANGED
data/lib/locales/sk.yml
CHANGED
data/lib/locales/sl.yml
CHANGED
data/lib/locales/sq.yml
CHANGED
data/lib/locales/sr.yml
CHANGED
data/lib/locales/st.yml
CHANGED
data/lib/locales/sv.yml
CHANGED
data/lib/locales/sw.yml
CHANGED
data/lib/locales/ta.yml
CHANGED
data/lib/locales/te.yml
CHANGED
data/lib/locales/th.yml
CHANGED
data/lib/locales/tl.yml
CHANGED
data/lib/locales/tr.yml
CHANGED
data/lib/locales/tt.yml
CHANGED
data/lib/locales/ug.yml
CHANGED
data/lib/locales/uk.yml
CHANGED
data/lib/locales/ur.yml
CHANGED
data/lib/locales/uz.yml
CHANGED
data/lib/locales/vi.yml
CHANGED
data/lib/locales/wo.yml
CHANGED
data/lib/locales/zh-CN.yml
CHANGED
data/lib/locales/zh-HK.yml
CHANGED
data/lib/locales/zh-TW.yml
CHANGED
data/lib/locales/zh-YUE.yml
CHANGED
data/mkdocs.yml
CHANGED
|
@@ -54,6 +54,8 @@ theme:
|
|
|
54
54
|
- navigation.expand
|
|
55
55
|
- navigation.path
|
|
56
56
|
- navigation.sections
|
|
57
|
+
- navigation.tabs
|
|
58
|
+
- navigation.tabs.sticky
|
|
57
59
|
- navigation.top
|
|
58
60
|
- navigation.tracking
|
|
59
61
|
- search.highlight
|
|
@@ -81,9 +83,26 @@ markdown_extensions:
|
|
|
81
83
|
- tables
|
|
82
84
|
- toc:
|
|
83
85
|
permalink: true
|
|
86
|
+
title: On this page
|
|
84
87
|
|
|
85
88
|
plugins:
|
|
86
89
|
- search
|
|
90
|
+
- rss:
|
|
91
|
+
match_path: blog/posts/.*
|
|
92
|
+
date_from_meta:
|
|
93
|
+
as_creation: date
|
|
94
|
+
categories:
|
|
95
|
+
- categories
|
|
96
|
+
- blog:
|
|
97
|
+
blog_dir: blog
|
|
98
|
+
blog_toc: true
|
|
99
|
+
post_date_format: long
|
|
100
|
+
post_url_format: "{slug}"
|
|
101
|
+
archive_date_format: MMMM yyyy
|
|
102
|
+
draft_if_future_date: true
|
|
103
|
+
categories_allowed:
|
|
104
|
+
- Tutorials
|
|
105
|
+
- Updates
|
|
87
106
|
- llmstxt:
|
|
88
107
|
markdown_description: >-
|
|
89
108
|
CMDx is a Ruby framework for building maintainable, observable business logic through composable command/service objects.
|
|
@@ -124,51 +143,61 @@ plugins:
|
|
|
124
143
|
- workflows.md: Composing multiple tasks into sequential pipelines with conditional execution
|
|
125
144
|
More:
|
|
126
145
|
- tips_and_tricks.md: Best practices, patterns, and techniques for maintainable CMDx applications
|
|
146
|
+
- comparison.md: Comparison with other command/service object frameworks
|
|
147
|
+
Ecosystem:
|
|
148
|
+
- cmdx-rspec: RSpec test matchers (https://github.com/drexed/cmdx-rspec)
|
|
127
149
|
|
|
128
150
|
nav:
|
|
129
151
|
- Home: index.md
|
|
130
|
-
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
-
|
|
165
|
-
|
|
152
|
+
- Documentation:
|
|
153
|
+
- Getting Started: getting_started.md
|
|
154
|
+
- Configuration: configuration.md
|
|
155
|
+
- Basics:
|
|
156
|
+
- Setup: basics/setup.md
|
|
157
|
+
- Execution: basics/execution.md
|
|
158
|
+
- Context: basics/context.md
|
|
159
|
+
- Chain: basics/chain.md
|
|
160
|
+
- Interruptions:
|
|
161
|
+
- Halt: interruptions/halt.md
|
|
162
|
+
- Faults: interruptions/faults.md
|
|
163
|
+
- Exceptions: interruptions/exceptions.md
|
|
164
|
+
- Outcomes:
|
|
165
|
+
- Result: outcomes/result.md
|
|
166
|
+
- States: outcomes/states.md
|
|
167
|
+
- Statuses: outcomes/statuses.md
|
|
168
|
+
- Attributes:
|
|
169
|
+
- Definitions: attributes/definitions.md
|
|
170
|
+
- Naming: attributes/naming.md
|
|
171
|
+
- Coercions: attributes/coercions.md
|
|
172
|
+
- Validations: attributes/validations.md
|
|
173
|
+
- Defaults: attributes/defaults.md
|
|
174
|
+
- Transformations: attributes/transformations.md
|
|
175
|
+
- Features:
|
|
176
|
+
- Callbacks: callbacks.md
|
|
177
|
+
- Middlewares: middlewares.md
|
|
178
|
+
- Logging: logging.md
|
|
179
|
+
- Internationalization: internationalization.md
|
|
180
|
+
- Retries: retries.md
|
|
181
|
+
- Deprecation: deprecation.md
|
|
182
|
+
- Workflows: workflows.md
|
|
183
|
+
- More:
|
|
184
|
+
- Tips and Tricks: tips_and_tricks.md
|
|
185
|
+
- Comparison: comparison.md
|
|
186
|
+
- References:
|
|
187
|
+
- API Documentation: https://drexed.github.io/cmdx/api/index.html
|
|
188
|
+
- llms.txt: https://drexed.github.io/cmdx/llms.txt
|
|
189
|
+
- llms-full.txt: https://drexed.github.io/cmdx/llms-full.txt
|
|
190
|
+
- Ecosystem:
|
|
191
|
+
- cmdx-rspec: https://github.com/drexed/cmdx-rspec
|
|
192
|
+
- Blog: blog/index.md
|
|
166
193
|
|
|
167
194
|
extra:
|
|
168
195
|
generator: false
|
|
169
196
|
social:
|
|
170
197
|
- icon: fontawesome/brands/github
|
|
171
198
|
link: https://github.com/drexed/cmdx
|
|
199
|
+
- icon: fontawesome/solid/rss
|
|
200
|
+
link: https://drexed.github.io/cmdx/feed_rss_created.xml
|
|
172
201
|
|
|
173
202
|
extra_css:
|
|
174
203
|
- stylesheets/extra.css
|
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.
|
|
4
|
+
version: 1.15.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Juan Gomez
|
|
@@ -227,61 +227,11 @@ extensions: []
|
|
|
227
227
|
extra_rdoc_files: []
|
|
228
228
|
files:
|
|
229
229
|
- ".DS_Store"
|
|
230
|
-
- ".cursor/prompts/docs.md"
|
|
231
|
-
- ".cursor/prompts/llms.md"
|
|
232
|
-
- ".cursor/prompts/rspec.md"
|
|
233
|
-
- ".cursor/prompts/yardoc.md"
|
|
234
|
-
- ".cursor/rules/cursor-instructions.mdc"
|
|
235
|
-
- ".irbrc"
|
|
236
|
-
- ".rspec"
|
|
237
|
-
- ".rubocop.yml"
|
|
238
|
-
- ".ruby-version"
|
|
239
|
-
- ".yard-lint.yml"
|
|
240
|
-
- ".yardopts"
|
|
241
230
|
- CHANGELOG.md
|
|
242
231
|
- CODE_OF_CONDUCT.md
|
|
243
232
|
- LICENSE.txt
|
|
244
233
|
- README.md
|
|
245
234
|
- Rakefile
|
|
246
|
-
- docs/.DS_Store
|
|
247
|
-
- docs/assets/favicon.ico
|
|
248
|
-
- docs/assets/favicon.svg
|
|
249
|
-
- docs/attributes/coercions.md
|
|
250
|
-
- docs/attributes/defaults.md
|
|
251
|
-
- docs/attributes/definitions.md
|
|
252
|
-
- docs/attributes/naming.md
|
|
253
|
-
- docs/attributes/transformations.md
|
|
254
|
-
- docs/attributes/validations.md
|
|
255
|
-
- docs/basics/chain.md
|
|
256
|
-
- docs/basics/context.md
|
|
257
|
-
- docs/basics/execution.md
|
|
258
|
-
- docs/basics/setup.md
|
|
259
|
-
- docs/callbacks.md
|
|
260
|
-
- docs/configuration.md
|
|
261
|
-
- docs/deprecation.md
|
|
262
|
-
- docs/getting_started.md
|
|
263
|
-
- docs/index.md
|
|
264
|
-
- docs/internationalization.md
|
|
265
|
-
- docs/interruptions/exceptions.md
|
|
266
|
-
- docs/interruptions/faults.md
|
|
267
|
-
- docs/interruptions/halt.md
|
|
268
|
-
- docs/logging.md
|
|
269
|
-
- docs/middlewares.md
|
|
270
|
-
- docs/outcomes/result.md
|
|
271
|
-
- docs/outcomes/states.md
|
|
272
|
-
- docs/outcomes/statuses.md
|
|
273
|
-
- docs/retries.md
|
|
274
|
-
- docs/stylesheets/extra.css
|
|
275
|
-
- docs/tips_and_tricks.md
|
|
276
|
-
- docs/workflows.md
|
|
277
|
-
- examples/active_record_database_transaction.md
|
|
278
|
-
- examples/active_record_query_tagging.md
|
|
279
|
-
- examples/flipper_feature_flags.md
|
|
280
|
-
- examples/paper_trail_whatdunnit.md
|
|
281
|
-
- examples/redis_idempotency.md
|
|
282
|
-
- examples/sentry_error_tracking.md
|
|
283
|
-
- examples/sidekiq_async_execution.md
|
|
284
|
-
- examples/stoplight_circuit_breaker.md
|
|
285
235
|
- lib/cmdx.rb
|
|
286
236
|
- lib/cmdx/.DS_Store
|
|
287
237
|
- lib/cmdx/attribute.rb
|
|
@@ -329,6 +279,7 @@ files:
|
|
|
329
279
|
- lib/cmdx/utils/condition.rb
|
|
330
280
|
- lib/cmdx/utils/format.rb
|
|
331
281
|
- lib/cmdx/validator_registry.rb
|
|
282
|
+
- lib/cmdx/validators/absence.rb
|
|
332
283
|
- lib/cmdx/validators/exclusion.rb
|
|
333
284
|
- lib/cmdx/validators/format.rb
|
|
334
285
|
- lib/cmdx/validators/inclusion.rb
|
|
@@ -431,13 +382,9 @@ files:
|
|
|
431
382
|
- lib/locales/zh-TW.yml
|
|
432
383
|
- lib/locales/zh-YUE.yml
|
|
433
384
|
- mkdocs.yml
|
|
434
|
-
- src/cmdx-dark-logo.png
|
|
435
|
-
- src/cmdx-favicon.svg
|
|
436
|
-
- src/cmdx-light-logo.png
|
|
437
|
-
- src/cmdx-logo.svg
|
|
438
385
|
homepage: https://github.com/drexed/cmdx
|
|
439
386
|
licenses:
|
|
440
|
-
-
|
|
387
|
+
- LGPL-3.0
|
|
441
388
|
metadata:
|
|
442
389
|
homepage_uri: https://github.com/drexed/cmdx
|
|
443
390
|
source_code_uri: https://github.com/drexed/cmdx
|
|
@@ -459,7 +406,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
459
406
|
- !ruby/object:Gem::Version
|
|
460
407
|
version: '0'
|
|
461
408
|
requirements: []
|
|
462
|
-
rubygems_version:
|
|
409
|
+
rubygems_version: 4.0.3
|
|
463
410
|
specification_version: 4
|
|
464
411
|
summary: CMDx is a framework for building maintainable business processes.
|
|
465
412
|
test_files: []
|
data/.cursor/prompts/docs.md
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
You are a senior Ruby developer with expert knowledge of CMDx and writing documentation.
|
|
2
|
-
|
|
3
|
-
Update the active tab using the following guidelines:
|
|
4
|
-
|
|
5
|
-
- Follow best practices and implementation
|
|
6
|
-
- Use a consistent warm, friendly and professional voice
|
|
7
|
-
- Examples should be concise, non-repetitive, and realistic
|
|
8
|
-
- Update any pre-existing documentation to match stated rules
|
|
9
|
-
- Examples should not cross boundaries or focus
|
|
10
|
-
- Docs must cover both typical use cases, including invalid and error conditions
|
|
11
|
-
- Use mkdocs Admonitions to emphasize critical information (https://squidfunk.github.io/mkdocs-material/reference/admonitions/)
|
|
12
|
-
- Optimize for LLM's including coding and AI agents
|
data/.cursor/prompts/llms.md
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
Process the following instructions in the order given:
|
|
2
|
-
|
|
3
|
-
1. Create an `LLM.md` file
|
|
4
|
-
2. Append all files within `docs/**/*.md` into @LLM.md
|
|
5
|
-
2a. Use order outlined under the nav key in @mkdocs.yml
|
|
6
|
-
2b. Process one file at a time faster performance and improved accuracy
|
|
7
|
-
2c. Exclude @index.md and @LLM.md files
|
|
8
|
-
2d. All URLs should be absolute
|
data/.cursor/prompts/rspec.md
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
You are a senior Ruby developer with expert knowledge of RSpec.
|
|
2
|
-
|
|
3
|
-
Add tests for the active tab using the following guidelines:
|
|
4
|
-
|
|
5
|
-
- Expectations should be concise, non-repetitive, and realistic (how it would be used in the real world)
|
|
6
|
-
- Follow best practices and implementation
|
|
7
|
-
- Update any pre-existing specs to match stated rules
|
|
8
|
-
- New tests should be consistent with current `spec/cmdx` specs
|
|
9
|
-
- Use custom matchers available within `lib/cmdx/rspec`
|
|
10
|
-
- Use task helpers available within `spec/support/helpers`
|
|
11
|
-
- 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)
|
|
12
|
-
- Ensure each test is independent; avoid shared state between tests
|
|
13
|
-
- Use let and let! to define test data, ensuring minimal and necessary setup
|
|
14
|
-
- Context block descriptions should start with the following words: `when`, `with`, `without`
|
|
15
|
-
- Organize tests logically using describe for classes/modules and context for different scenarios
|
|
16
|
-
- Use subject to define the object under test when appropriate to avoid repetition
|
|
17
|
-
- 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)
|
|
18
|
-
- Use clear and descriptive names for describe, context, and it blocks
|
|
19
|
-
- Prefer the expect syntax for assertions to improve readability
|
|
20
|
-
- Keep test code concise; avoid unnecessary complexity or duplication
|
|
21
|
-
- Tests must cover both typical cases and edge cases, including Invalid and error conditions
|
|
22
|
-
- Consider all possible scenarios for each method or behavior and ensure they are tested
|
|
23
|
-
- Do NOT include integration or real world examples
|
|
24
|
-
- Verify all specs are passing
|
data/.cursor/prompts/yardoc.md
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
You are a senior Ruby developer with expert knowledge of YARDoc.
|
|
2
|
-
|
|
3
|
-
Add yardoc to the active tab using the following guidelines:
|
|
4
|
-
|
|
5
|
-
- Follow best practices and implementation
|
|
6
|
-
- New documentation should be consistent with current `lib/cmdx` documentation
|
|
7
|
-
- Examples should be concise, non-repetitive, and realistic
|
|
8
|
-
- Avoid unnecessary complexity or duplication
|
|
9
|
-
- Update any pre-existing documentation to match stated rules
|
|
10
|
-
- Do NOT include `CMDx` module level docs
|
|
11
|
-
- Module level docs description should NOT include `@example`
|
|
12
|
-
- Method level docs should include `@example`, `param`, `@options`, `@return`, and any `@raise`
|
|
13
|
-
- Hash `@params` should expand with possible `@option`
|
|
14
|
-
- Module and method level docs should NOT include `@since`
|
|
15
|
-
- Add RBS inline comments after YARDoc block
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description:
|
|
3
|
-
globs:
|
|
4
|
-
alwaysApply: true
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Ruby Coding Standards
|
|
8
|
-
|
|
9
|
-
Follow the official Ruby gem guides for best practices.
|
|
10
|
-
Reference the guides outlined in https://guides.rubygems.org
|
|
11
|
-
|
|
12
|
-
## Project Context
|
|
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
|
-
|
|
16
|
-
## Technology Stack
|
|
17
|
-
- Ruby 3.4+
|
|
18
|
-
- RSpec 3.1+
|
|
19
|
-
|
|
20
|
-
## Development Guidelines
|
|
21
|
-
- Performance is critical - benchmark any changes that could affect speed
|
|
22
|
-
- Follow existing code patterns and conventions
|
|
23
|
-
- Maintain backward compatibility for public API
|
|
24
|
-
|
|
25
|
-
## Code Style and Structure
|
|
26
|
-
- Write concise, idiomatic Ruby code with accurate examples
|
|
27
|
-
- Follow Ruby conventions and best practices
|
|
28
|
-
- Use object-oriented and functional programming patterns as appropriate
|
|
29
|
-
- Prefer iteration and modularization over code duplication
|
|
30
|
-
- Use descriptive variable and method names (e.g., user_signed_in?, calculate_total)
|
|
31
|
-
- Write comprehensive code documentation using the Yardoc format
|
|
32
|
-
- Minimize object allocations in hot paths
|
|
33
|
-
|
|
34
|
-
## Naming Conventions
|
|
35
|
-
- Use snake_case for file names, method names, and variables
|
|
36
|
-
- Use CamelCase for class and module names
|
|
37
|
-
|
|
38
|
-
## Syntax and Formatting
|
|
39
|
-
- Follow the Ruby Style Guide (https://rubystyle.guide/)
|
|
40
|
-
- Follow Ruby style conventions (2-space indentation, snake_case methods)
|
|
41
|
-
- Use Ruby's expressive syntax (e.g., unless, ||=, &.)
|
|
42
|
-
- Prefer double quotes for strings
|
|
43
|
-
- Respect my Rubocop options
|
|
44
|
-
- Run `bundle exec rubocop .` before finalizing any code changes
|
|
45
|
-
|
|
46
|
-
## Performance Optimization
|
|
47
|
-
- Use memoization for expensive operations
|
|
48
|
-
|
|
49
|
-
## Testing
|
|
50
|
-
- Follow the RSpec Style Guide (https://rspec.rubystyle.guide/)
|
|
51
|
-
- Write comprehensive tests using RSpec
|
|
52
|
-
- It's ok to put multiple assertions in the same example
|
|
53
|
-
- Include both BDD and TDD based tests
|
|
54
|
-
- Create test objects to share across tests
|
|
55
|
-
- Do NOT make tests for obvious or reflective expectations
|
|
56
|
-
- Prefer real objects over mocks. Use `instance_double` if necessary; never `double`
|
|
57
|
-
- Don't test declarative configuration
|
|
58
|
-
- Use appropriate matchers
|
|
59
|
-
- Update tests and update Yardocs after you write code
|
|
60
|
-
- Run `bundle rspec .` before finalizing any code changes
|
|
61
|
-
|
|
62
|
-
## Documentation
|
|
63
|
-
- Utilize the YARDoc format when documenting Ruby code
|
|
64
|
-
- Follow these best practices:
|
|
65
|
-
- Avoid redundant comments that merely restate the code
|
|
66
|
-
- Keep comments up-to-date with code changes
|
|
67
|
-
- Keep documentation consistent
|
|
68
|
-
- Update CHANGELOG.md with any changes
|
data/.irbrc
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require "pp"
|
|
4
|
-
|
|
5
|
-
# rubocop:disable Style/MixinUsage
|
|
6
|
-
unless defined?(CMDx)
|
|
7
|
-
require_relative "lib/cmdx"
|
|
8
|
-
|
|
9
|
-
require_relative "spec/support/helpers/task_builders"
|
|
10
|
-
require_relative "spec/support/helpers/workflow_builders"
|
|
11
|
-
include CMDx::Testing::TaskBuilders
|
|
12
|
-
include CMDx::Testing::WorkflowBuilders
|
|
13
|
-
end
|
|
14
|
-
# rubocop:enable Style/MixinUsage
|
|
15
|
-
|
|
16
|
-
def reload!
|
|
17
|
-
exec("irb")
|
|
18
|
-
end
|
data/.rspec
DELETED