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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e1949724cfdf1045f5b0ab6f013187b395f3baaf96b357a6367c894b251ce1e2
4
- data.tar.gz: d22d453c480ce21caf923195c36f984135e488454bdb939131cc0e896088017d
3
+ metadata.gz: f110ef0a50149ab84f49b40209a05bbf152a995b802a8664c59ff95f0eb36ee1
4
+ data.tar.gz: d35940933ad93ca75eba984ed9a83cad28045ba3492e6745bda41d4c95154ec5
5
5
  SHA512:
6
- metadata.gz: b956452863277b0218420ee73ca45eb9e28b449441ac2bc4458dcb5880cb95630ff5a5395ced570c50df1e2f98523b782dc5f39befc574834d13d739daf917be
7
- data.tar.gz: 700f88243a8ba2a3add1c394c97ffc2d3e09e5a10ca157a1c4fcd5256fefc327bc04480ee5ddda8c329d3ff787acfb0321b33b219ca9ba78cc858b8c7ab4ea67
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.0...HEAD
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 App
986
+ ## Example Rails Apps
987
987
 
988
- A full Rails 8 blog application demonstrating every EasyOp feature in real-world code lives in `/examples/easyop_test_app/`. It is **not included in the gem** — only in the repository.
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
- The app covers:
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 /examples/easyop_test_app
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.tap do
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
@@ -1,3 +1,3 @@
1
1
  module Easyop
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easyop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pawel Niemczyk