senro_usecaser 0.3.0 → 0.4.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/.rubocop.yml +4 -0
- data/CHANGELOG.md +30 -0
- data/README.md +655 -0
- data/examples/namespace_demo.rb +50 -15
- data/examples/order_system.rb +222 -34
- data/examples/sig/namespace_demo.rbs +35 -10
- data/examples/sig/order_system.rbs +196 -20
- data/lib/senro_usecaser/base.rb +308 -76
- data/lib/senro_usecaser/depends_on.rb +257 -0
- data/lib/senro_usecaser/hook.rb +28 -82
- data/lib/senro_usecaser/retry_configuration.rb +131 -0
- data/lib/senro_usecaser/retry_context.rb +133 -0
- data/lib/senro_usecaser/version.rb +1 -1
- data/lib/senro_usecaser.rb +3 -0
- data/sig/generated/senro_usecaser/base.rbs +143 -30
- data/sig/generated/senro_usecaser/depends_on.rbs +197 -0
- data/sig/generated/senro_usecaser/hook.rbs +23 -35
- data/sig/generated/senro_usecaser/retry_configuration.rbs +90 -0
- data/sig/generated/senro_usecaser/retry_context.rbs +101 -0
- data/sig/overrides.rbs +0 -1
- metadata +7 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 128ebb74062f9e816768ebd4eb0bd7f2c8e3d6d9b5235acf83627da04b9db0a4
|
|
4
|
+
data.tar.gz: b8324bac7bfa047c2cdff59366c935f101250a90d77da1617524638f8fe828ad
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 16467023e02e3ac45125bd0e5e678aa107543b13dadffe12b1e63cef2be73138be323872d2f80dd31528a183235db69805fb9c90a64bda98c169b4c430f53393
|
|
7
|
+
data.tar.gz: bb894e33a9388a2a12117943f75b1ed992a89e1755dfb7c87def9ee48711fe908e25df49219f7f3d22e21423dde7dd5a832190e4fe12aebfee1c9afd6ab9a138
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,36 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.4.2] - 2026-02-07
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **DependsOn module for standalone DI support**
|
|
13
|
+
- New `SenroUsecaser::DependsOn` module can be extended into any class
|
|
14
|
+
- Provides `depends_on`, `namespace`, and automatic dependency resolution
|
|
15
|
+
- Default `initialize(container: nil)` is provided automatically
|
|
16
|
+
- Uses `SenroUsecaser.container` when no container is passed
|
|
17
|
+
- Supports custom initialize with `super(container: container)`
|
|
18
|
+
|
|
19
|
+
- **on_failure hook**
|
|
20
|
+
- Called only when UseCase execution results in failure
|
|
21
|
+
- Supports block syntax, module syntax, and Hook class syntax
|
|
22
|
+
- Receives `(input, result)` or `(input, result, context)` for retry support
|
|
23
|
+
- In pipelines, triggers rollback of previously successful steps in reverse order
|
|
24
|
+
|
|
25
|
+
- **Retry functionality**
|
|
26
|
+
- `retry_on :error_code, attempts: 3, wait: 1, backoff: :exponential`
|
|
27
|
+
- Backoff strategies: `:fixed`, `:linear`, `:exponential`
|
|
28
|
+
- `max_wait` and `jitter` options for fine-grained control
|
|
29
|
+
- `discard_on` to skip retry for specific errors
|
|
30
|
+
- `before_retry` and `after_retries_exhausted` callbacks
|
|
31
|
+
- Manual retry via `retry!` in `on_failure` hook
|
|
32
|
+
|
|
33
|
+
### Changed
|
|
34
|
+
|
|
35
|
+
- Removed redundant `include DependsOn::InstanceMethods` from Base and Hook classes
|
|
36
|
+
- `extend DependsOn` now automatically includes InstanceMethods
|
|
37
|
+
|
|
8
38
|
## [0.3.0] - 2026-01-31
|
|
9
39
|
|
|
10
40
|
### Added
|