easyop 0.1.0 → 0.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 +4 -4
- data/CHANGELOG.md +8 -1
- data/README.md +30 -9
- data/lib/easyop/plugins/recording.rb +7 -1
- data/lib/easyop/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f110ef0a50149ab84f49b40209a05bbf152a995b802a8664c59ff95f0eb36ee1
|
|
4
|
+
data.tar.gz: d35940933ad93ca75eba984ed9a83cad28045ba3492e6745bda41d4c95154ec5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 47f9214496757ec818887f4d9372d03b3e4d26c488927de696637212d1b3aef42f3fcefda00fff85aa6f6452a4e93ecbbd674f859f38fda974b7b77bead059ff
|
|
7
|
+
data.tar.gz: 5544728ce871c2eac2b9dfe6dfc278cc0c4f3cbe38f648ce031d82a55f16eb3400b29c34a883092a5167d07284beadc061ab6ab54eaac695cb5a87f6d8486d84
|
data/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.1.1] — 2026-04-01
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- **`Plugins::Recording`** — operations executed as steps inside a `Flow` were not recorded on failure. Flows run each step with `raise_on_failure: true`, causing `Ctx::Failure` to propagate and skip the `.tap` block used to persist the log entry. Fixed by moving the persistence call into an `ensure` block so every execution — successful or failed — is always recorded.
|
|
15
|
+
|
|
10
16
|
## [0.1.0] — 2026-04-01
|
|
11
17
|
|
|
12
18
|
### Added
|
|
@@ -37,5 +43,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
37
43
|
- `examples/easyop_test_app/` — full Rails 8 blog application demonstrating all features in real-world code
|
|
38
44
|
- `examples/usage.rb` — 13 runnable plain-Ruby examples
|
|
39
45
|
|
|
40
|
-
[Unreleased]: https://github.com/pniemczyk/easyop/compare/v0.1.
|
|
46
|
+
[Unreleased]: https://github.com/pniemczyk/easyop/compare/v0.1.1...HEAD
|
|
47
|
+
[0.1.1]: https://github.com/pniemczyk/easyop/compare/v0.1.0...v0.1.1
|
|
41
48
|
[0.1.0]: https://github.com/pniemczyk/easyop/releases/tag/v0.1.0
|
data/README.md
CHANGED
|
@@ -983,15 +983,13 @@ ProcessCheckout.prepare
|
|
|
983
983
|
ruby examples/usage.rb
|
|
984
984
|
```
|
|
985
985
|
|
|
986
|
-
## Example Rails
|
|
986
|
+
## Example Rails Apps
|
|
987
987
|
|
|
988
|
-
|
|
988
|
+
Two full Rails 8 applications live in `/examples/`. Neither is included in the gem — repository only.
|
|
989
989
|
|
|
990
|
-
|
|
991
|
-
/examples/easyop_test_app/
|
|
992
|
-
```
|
|
990
|
+
### Blog App — `easyop_test_app`
|
|
993
991
|
|
|
994
|
-
|
|
992
|
+
A blog + newsletter app demonstrating the full EasyOp feature set.
|
|
995
993
|
|
|
996
994
|
| Feature | Where to look |
|
|
997
995
|
|---|---|
|
|
@@ -1006,10 +1004,8 @@ The app covers:
|
|
|
1006
1004
|
| Transactional plugin | `ApplicationOperation` → all DB ops wrapped in transactions |
|
|
1007
1005
|
| Rails controller integration | `app/controllers/articles_controller.rb`, `transfers_controller.rb` |
|
|
1008
1006
|
|
|
1009
|
-
**Running the example app:**
|
|
1010
|
-
|
|
1011
1007
|
```bash
|
|
1012
|
-
cd
|
|
1008
|
+
cd examples/easyop_test_app
|
|
1013
1009
|
bundle install
|
|
1014
1010
|
bin/rails db:create db:migrate db:seed
|
|
1015
1011
|
bin/rails server -p 3002
|
|
@@ -1017,6 +1013,31 @@ bin/rails server -p 3002
|
|
|
1017
1013
|
|
|
1018
1014
|
Seed accounts: `alice@example.com` / `password123` (500 credits), `bob`, `carol`, `dave` (0 credits — tests insufficient-funds error).
|
|
1019
1015
|
|
|
1016
|
+
### TicketFlow — `ticketflow`
|
|
1017
|
+
|
|
1018
|
+
A full event ticket-selling platform with modern Tailwind UI and admin panel. Every operation is powered by EasyOp.
|
|
1019
|
+
|
|
1020
|
+
| Feature | Where to look |
|
|
1021
|
+
|---|---|
|
|
1022
|
+
| Multi-step checkout Flow | `app/operations/flows/checkout.rb` — 6 chained operations |
|
|
1023
|
+
| `skip_if` (optional discount step) | `app/operations/orders/apply_discount.rb` |
|
|
1024
|
+
| Rollback on payment failure | `app/operations/orders/process_payment.rb#rollback` |
|
|
1025
|
+
| `prepare` + callbacks in controller | `app/controllers/checkouts_controller.rb` |
|
|
1026
|
+
| Recording plugin → operation logs | `app/operations/application_operation.rb` |
|
|
1027
|
+
| Admin metrics dashboard | `app/controllers/admin/dashboard_controller.rb` |
|
|
1028
|
+
| Admin order refund operation | `app/operations/admin/refund_order.rb` |
|
|
1029
|
+
| Virtual ticket generation | `app/operations/tickets/generate_tickets.rb` |
|
|
1030
|
+
|
|
1031
|
+
```bash
|
|
1032
|
+
cd examples/ticketflow
|
|
1033
|
+
bundle install
|
|
1034
|
+
bin/rails db:create db:migrate db:seed
|
|
1035
|
+
bin/rails server -p 3001
|
|
1036
|
+
```
|
|
1037
|
+
|
|
1038
|
+
Seed accounts: `admin@ticketflow.com` / `password123` (admin), `user@ticketflow.com` / `password123` (customer).
|
|
1039
|
+
Discount codes: `SAVE10` (10% off), `FLAT20` ($20 off), `VIP50` (50% off).
|
|
1040
|
+
|
|
1020
1041
|
## Running Specs
|
|
1021
1042
|
|
|
1022
1043
|
```
|
|
@@ -71,7 +71,13 @@ module Easyop
|
|
|
71
71
|
return super unless self.class.name # skip anonymous classes
|
|
72
72
|
|
|
73
73
|
start = Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
|
74
|
-
super
|
|
74
|
+
super
|
|
75
|
+
ensure
|
|
76
|
+
# Always record — including when raise_on_failure: true raises Ctx::Failure
|
|
77
|
+
# (e.g. when this operation is a step inside a Flow). Without the ensure
|
|
78
|
+
# branch the tap block would be skipped and failures inside flows would
|
|
79
|
+
# never be persisted.
|
|
80
|
+
if start
|
|
75
81
|
ms = ((Process.clock_gettime(Process::CLOCK_MONOTONIC) - start) * 1000).round(2)
|
|
76
82
|
_recording_persist!(ctx, model, ms)
|
|
77
83
|
end
|
data/lib/easyop/version.rb
CHANGED