dry-transaction 0.12.0 → 0.13.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +337 -0
- data/LICENSE +20 -0
- data/README.md +16 -43
- data/dry-transaction.gemspec +41 -0
- data/lib/dry-transaction.rb +2 -0
- data/lib/dry/transaction.rb +2 -0
- data/lib/dry/transaction/builder.rb +6 -4
- data/lib/dry/transaction/callable.rb +22 -2
- data/lib/dry/transaction/dsl.rb +9 -7
- data/lib/dry/transaction/errors.rb +2 -0
- data/lib/dry/transaction/instance_methods.rb +24 -20
- data/lib/dry/transaction/operation.rb +5 -3
- data/lib/dry/transaction/operation_resolver.rb +4 -2
- data/lib/dry/transaction/result_matcher.rb +4 -2
- data/lib/dry/transaction/stack.rb +2 -0
- data/lib/dry/transaction/step.rb +37 -24
- data/lib/dry/transaction/step_adapter.rb +6 -4
- data/lib/dry/transaction/step_adapters.rb +9 -7
- data/lib/dry/transaction/step_adapters/around.rb +4 -2
- data/lib/dry/transaction/step_adapters/check.rb +2 -0
- data/lib/dry/transaction/step_adapters/map.rb +2 -0
- data/lib/dry/transaction/step_adapters/raw.rb +5 -3
- data/lib/dry/transaction/step_adapters/tee.rb +2 -0
- data/lib/dry/transaction/step_adapters/try.rb +3 -1
- data/lib/dry/transaction/step_failure.rb +12 -0
- data/lib/dry/transaction/version.rb +3 -1
- metadata +14 -110
- data/Gemfile +0 -15
- data/Gemfile.lock +0 -97
- data/LICENSE.md +0 -9
- data/Rakefile +0 -6
- data/spec/examples.txt +0 -85
- data/spec/integration/around_spec.rb +0 -81
- data/spec/integration/auto_injection_spec.rb +0 -32
- data/spec/integration/custom_step_adapters_spec.rb +0 -41
- data/spec/integration/operation_spec.rb +0 -30
- data/spec/integration/passing_step_arguments_spec.rb +0 -51
- data/spec/integration/publishing_step_events_spec.rb +0 -119
- data/spec/integration/transaction_spec.rb +0 -566
- data/spec/integration/transaction_without_steps_spec.rb +0 -101
- data/spec/spec_helper.rb +0 -116
- data/spec/support/container.rb +0 -10
- data/spec/support/database.rb +0 -12
- data/spec/support/db_transactions.rb +0 -45
- data/spec/support/result_mixin.rb +0 -3
- data/spec/support/test_module_constants.rb +0 -11
- data/spec/unit/step_adapters/around_spec.rb +0 -46
- data/spec/unit/step_adapters/check_spec.rb +0 -43
- data/spec/unit/step_adapters/map_spec.rb +0 -16
- data/spec/unit/step_adapters/raw_spec.rb +0 -36
- data/spec/unit/step_adapters/tee_spec.rb +0 -17
- data/spec/unit/step_adapters/try_spec.rb +0 -89
- data/spec/unit/step_spec.rb +0 -131
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cfebcfe9879d78d03bfb502faeb3965ecf265d000f34573c6aacc1cfbd9c89ac
|
4
|
+
data.tar.gz: 94e63ed189b258ff5e049893e483a0f0f105bf570c8806bbf8b58abac5b09947
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9187e6d04eed0ce3409ddc2d7e8778a33e37f4ba53f6eb6d0a9bccbc1c06f6eda992866a5d850be062c19bf3b943df202b683fd4d0eacfc5a40393ea7d3c2e6c
|
7
|
+
data.tar.gz: bf0d4654a70605d33e9343290c4178d0d8d9284cc1faeb6f184f31a909dc3bb8223fe59078ea69490ced8abbdbedcff00d855c591ff288dc8b4f5b19dfc51729
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,337 @@
|
|
1
|
+
<!--- DO NOT EDIT THIS FILE - IT'S AUTOMATICALLY GENERATED VIA DEVTOOLS --->
|
2
|
+
|
3
|
+
## 0.13.3 2021-06-07
|
4
|
+
|
5
|
+
|
6
|
+
### Fixed
|
7
|
+
|
8
|
+
- Fix deprecation warning on Ruby 3.0 when there are empty hash-like args (via #137) (@bestwebua)
|
9
|
+
|
10
|
+
|
11
|
+
[Compare v0.13.2...v0.13.3](https://github.com/dry-rb/dry-transaction/compare/v0.13.2...v0.13.3)
|
12
|
+
|
13
|
+
## 0.13.2 2021-02-08
|
14
|
+
|
15
|
+
|
16
|
+
### Fixed
|
17
|
+
|
18
|
+
- Re-allow Hash-like parameters to be passed to steps, e.g. `HashWithIndifferentAccess` and other `Hash` subclasses (this was broken with the Ruby 2.7/3.0 fixes in 0.13.1) (@trammel in #136)
|
19
|
+
|
20
|
+
|
21
|
+
[Compare v0.13.1...v0.13.2](https://github.com/dry-rb/dry-transaction/compare/v0.13.1...v0.13.2)
|
22
|
+
|
23
|
+
## 0.13.1 2021-01-31
|
24
|
+
|
25
|
+
|
26
|
+
### Changed
|
27
|
+
|
28
|
+
- Resolve Ruby 2.7 deprecation warnings and support Ruby 3.0 (@robbl-as in PR #134)
|
29
|
+
|
30
|
+
[Compare v0.13.0...v0.13.1](https://github.com/dry-rb/dry-transaction/compare/v0.13.0...v0.13.1)
|
31
|
+
|
32
|
+
## 0.13.0 2018-06-13
|
33
|
+
|
34
|
+
|
35
|
+
### Changed
|
36
|
+
|
37
|
+
- Internal step operations (steps backed by instance methods) can now be replaced via constructor arguments. Using instance methods to wrap external step operations now only works if the step is defined using the `with:` option (timriley in [#109][pr109])
|
38
|
+
|
39
|
+
[Compare v0.12.1...v0.13.0](https://github.com/dry-rb/dry-transaction/compare/v0.12.1...v0.13.0)
|
40
|
+
|
41
|
+
## 0.12.1 2018-06-05
|
42
|
+
|
43
|
+
|
44
|
+
### Fixed
|
45
|
+
|
46
|
+
- Support result matching on step failures nested within around steps (flash-gordon in [#106][pr106])
|
47
|
+
|
48
|
+
|
49
|
+
[Compare v0.12.0...v0.12.1](https://github.com/dry-rb/dry-transaction/compare/v0.12.0...v0.12.1)
|
50
|
+
|
51
|
+
## 0.12.0 2018-05-16
|
52
|
+
|
53
|
+
|
54
|
+
### Changed
|
55
|
+
|
56
|
+
- Switch to `Dry::Monads::Result` API (away from `Either` API deprecated in dry-monads 1.0 betas) (Morozzzko in [#104][pr104])
|
57
|
+
|
58
|
+
[Compare v0.11.2...v0.12.0](https://github.com/dry-rb/dry-transaction/compare/v0.11.2...v0.12.0)
|
59
|
+
|
60
|
+
## 0.11.2 2018-05-15
|
61
|
+
|
62
|
+
|
63
|
+
### Changed
|
64
|
+
|
65
|
+
- Use `Dry::Monads::Result` instead of the deprecated `Dry::Monads::Either` in the `check` step adapter (PavelTkachenko in [#103][pr103])
|
66
|
+
|
67
|
+
[Compare v0.11.1...v0.11.2](https://github.com/dry-rb/dry-transaction/compare/v0.11.1...v0.11.2)
|
68
|
+
|
69
|
+
## 0.11.1 2018-03-15
|
70
|
+
|
71
|
+
|
72
|
+
### Added
|
73
|
+
|
74
|
+
- Include `operation_name:` in options passed to step adapters. This is helpful for 3rd party step adapters that need the operation's name to fetch it from the container again later. (timriley in [#94][pr94])
|
75
|
+
|
76
|
+
|
77
|
+
[Compare v0.11.0...v0.11.1](https://github.com/dry-rb/dry-transaction/compare/v0.11.0...v0.11.1)
|
78
|
+
|
79
|
+
## 0.11.0 2018-02-19
|
80
|
+
|
81
|
+
|
82
|
+
### Added
|
83
|
+
|
84
|
+
- Around steps, which allow control of the execution of subsequently called steps. If you know how middleware works in rack or how around callbacks can be used in RSpec, it's the same. A typical example of usage would be for DB transactions (now first class support!) or controlling side effects: rolling back the changes, cleaning garbage produced by a failed transaction, etc. See a more detailed explanation of how this works [in the PR][pr85] (flash-gordon in [#85][pr85])
|
85
|
+
- Broadcast when a step has started by sending the event `step_called` (mihairadulescu in [#82][pr82])
|
86
|
+
- Add new step `check` that returns `Success` or `Failure` base on conditions (semenovDL in [#84][pr84])
|
87
|
+
- Support for transaction steps without input values (GustavoCaso and timriley in [#69][pr69])
|
88
|
+
|
89
|
+
### Fixed
|
90
|
+
|
91
|
+
- Pass arguments to a step with keyword arguments with default values (flash-gordon in [#74][pr74])
|
92
|
+
- Steps can be wrapped with private methods (semenovDL in [#70][pr70])
|
93
|
+
- Improved error message on missing transaction step (Morozzzko in [#79][pr79])
|
94
|
+
|
95
|
+
### Changed
|
96
|
+
|
97
|
+
- [BREAKING] Steps no longer broadcast events with their step name followed by `_success` or `_failure`. Now, more generic names are used for the broadcast events. Before each step runs, a `step` event is broadcast, with the step name and its arguments. After a step runs, a `step_succeeded` or `step_failed` event is broadcast, also with the step name, the arguments and the return value (GustavoCaso in [#83][pr83])
|
98
|
+
- [BREAKING] Pub/sub support is now handled using [dry-events][dry-events] instead of wisper. Subscriber objects should now respond to `#on_step`, `#on_step_succeeded`, or `#on_step_failed` to receive broadcast events (GustavoCaso in [#90][pr90])
|
99
|
+
- [BREAKING] The step adapter API has been changed in order to support around steps, although, the changes are not significant. Previously, an adapter received a `step` and a list of arguments for calling the operation. The list was passed as `*args` then you were needed to call `call_operation` on `step` and provide the list. From now on an adapter gets an `operation`, its `options`, and `args` (_without_ `*`). `operation` is an ordinary callable object so a typical call is as simple as `operation.(*args)`, that's it. If you want to turn your adapter into an around-like one you need to add `&block` parameter to the list of `call` arguments (e.g. `def call(operation, options, args, &block)`). `block` is responsible for calling the subsequent steps thus you can check or transform the return value and make some decisions based on it. Note capturing the block in the list of arguments is mandatory, a simple `yield` won't work, there are reasons, believe us. Check out the sources of [`around.rb`](https://github.com/dry-rb/dry-transaction/blob/master/lib/dry/transaction/step_adapters/around.rb) for reference, it's dead simple (flash-gordon in [#85][pr85])
|
100
|
+
- Usages of the `Either` monad was updated with `Result` and its constructors. See [the changes](https://github.com/dry-rb/dry-monads/blob/master/CHANGELOG.md#v040-2017-11-11) in `dry-monads` for more details (flash-gordon in [#81][pr81])
|
101
|
+
- Minimal Ruby version is 2.2 (flash-gordon in [#72][pr72])
|
102
|
+
|
103
|
+
[Compare v0.10.2...v0.11.0](https://github.com/dry-rb/dry-transaction/compare/v0.10.2...v0.11.0)
|
104
|
+
|
105
|
+
## 0.10.2 2017-07-10
|
106
|
+
|
107
|
+
|
108
|
+
### Fixed
|
109
|
+
|
110
|
+
- Only resolve an operation object from the container if the container reports that the key is present. This prevents exceptions from being raised when using dry-container and defining a transaction that includes steps both container-based and local method steps (jonolsson in [#64][pr64])
|
111
|
+
|
112
|
+
|
113
|
+
[Compare v0.10.1...v0.10.2](https://github.com/dry-rb/dry-transaction/compare/v0.10.1...v0.10.2)
|
114
|
+
|
115
|
+
## 0.10.1 2017-06-30
|
116
|
+
|
117
|
+
|
118
|
+
### Fixed
|
119
|
+
|
120
|
+
- Preserve step notification listeners when calling a transaction after passing extra step arguments (jcmfernandes in [#65](https://github.com/dry-rb/dry-transaction/pull/65))
|
121
|
+
|
122
|
+
|
123
|
+
[Compare v0.10.0...v0.10.1](https://github.com/dry-rb/dry-transaction/compare/v0.10.0...v0.10.1)
|
124
|
+
|
125
|
+
## 0.10.0 2017-06-15
|
126
|
+
|
127
|
+
This release makes major changes to the dry-transaction API: transactions are now defined within your own class, support instance methods for defining or wrapping steps, and operation containers are now optional.
|
128
|
+
|
129
|
+
### Added
|
130
|
+
|
131
|
+
- Added `Dry::Transaction::Operation` convenience mixin. This gives easy access to `Right` and `Left` result builders within your operation objects, and also enables dry-matcher's block-based result matching API for when the operations are called individually. (timriley in [#58](https://github.com/dry-rb/dry-transaction/pull/58))
|
132
|
+
|
133
|
+
```ruby
|
134
|
+
class MyOperation
|
135
|
+
include Dry::Transaction::Operation
|
136
|
+
|
137
|
+
def call(input)
|
138
|
+
Right(input)
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
142
|
+
my_op = MyOperation.new
|
143
|
+
my_op.("hello") do |m|
|
144
|
+
m.success do |v|
|
145
|
+
"Success: #{v}
|
146
|
+
end
|
147
|
+
m.failure do |v|
|
148
|
+
"Failure: #{v}"
|
149
|
+
end
|
150
|
+
end
|
151
|
+
# => "Success: hello"
|
152
|
+
|
153
|
+
### Changed
|
154
|
+
|
155
|
+
- [BREAKING] Transactions are now defined within your own classes using a mixin & class-level API for step definitions (GustavoCaso & timriley in [#58](https://github.com/dry-rb/dry-transaction/pull/58))
|
156
|
+
|
157
|
+
```ruby
|
158
|
+
class CreateUser
|
159
|
+
include Dry::Transaction(container: Container)
|
160
|
+
|
161
|
+
step :process, with: "operations.process"
|
162
|
+
step :validate, with: "operations.validate"
|
163
|
+
step :persist, with: "operations.persist"
|
164
|
+
end
|
165
|
+
|
166
|
+
create_user = CreateUser.new
|
167
|
+
create_user.call("name" => "Jane Doe")
|
168
|
+
```
|
169
|
+
|
170
|
+
Instance methods can wrap operations by calling `super`:
|
171
|
+
|
172
|
+
```ruby
|
173
|
+
class CreateUser
|
174
|
+
include Dry::Transaction(container: Container)
|
175
|
+
|
176
|
+
step :process, with: "operations.process"
|
177
|
+
step :validate, with: "operations.validate"
|
178
|
+
step :persist, with: "operations.persist"
|
179
|
+
|
180
|
+
def process(input)
|
181
|
+
adjusted_input = do_something_with(input)
|
182
|
+
super(adjusted_input)
|
183
|
+
end
|
184
|
+
end
|
185
|
+
```
|
186
|
+
|
187
|
+
Substitute operations can be injected when initializing objects (helpful for testing):
|
188
|
+
|
189
|
+
```ruby
|
190
|
+
create_user = CreateUser.new(process: substitute_process_operation)
|
191
|
+
```
|
192
|
+
- Transactions can be defined without an operations container, using instance methods only.
|
193
|
+
|
194
|
+
```ruby
|
195
|
+
class CreateUser
|
196
|
+
include Dry::Transaction
|
197
|
+
|
198
|
+
step :process
|
199
|
+
step :validate
|
200
|
+
|
201
|
+
def process(input)
|
202
|
+
input = do_something_with(input)
|
203
|
+
Right(input)
|
204
|
+
end
|
205
|
+
|
206
|
+
def validate(input)
|
207
|
+
if input[:email].include?("@")
|
208
|
+
Right(input)
|
209
|
+
else
|
210
|
+
Left(:not_valid)
|
211
|
+
end
|
212
|
+
end
|
213
|
+
end
|
214
|
+
```
|
215
|
+
- [BREAKING] You can no longer extend existing transactions with `#prepend`, `#append`, `#insert`, or `#remove`. Since transactions will now be instances of your own classes, with their own different behaviors, there’s no predictable way to combine the behaviors of two different classes. If you need the ability to add or remove steps, you can create separate transactions for the different behaviours you need to offer, or build into your own transaction class a way to skip steps based on input or step arguments.
|
216
|
+
- [BREAKING] Blocks in step definitions are no longer accepted. If you want to wrap a step with some local behavior, wrap it with an instance method (see above).
|
217
|
+
- [BREAKING] There is no longer an option for configuring the result matcher block API - we now use `Dry::Transaction::ResultMatcher` by default. If you want to provide your own matcher, you can do this by overriding `#call` in your transaction classes and using your own matcher when a block is given.
|
218
|
+
|
219
|
+
[Compare v0.9.0...v0.10.0](https://github.com/dry-rb/dry-transaction/compare/v0.9.0...v0.10.0)
|
220
|
+
|
221
|
+
## 0.9.0 2016-12-19
|
222
|
+
|
223
|
+
|
224
|
+
### Added
|
225
|
+
|
226
|
+
- Procs (or any callable objects) can be passed as a step's `with:` option instead of a container identifier string (AMHOL in [#44](https://github.com/dry-rb/dry-transaction/pull/44))
|
227
|
+
|
228
|
+
```ruby
|
229
|
+
Dry.Transaction(container: MyContainer) do
|
230
|
+
step :some_step, with: "operations.some_thing"
|
231
|
+
step :another, with: -> input {
|
232
|
+
# your code here
|
233
|
+
}
|
234
|
+
end
|
235
|
+
```
|
236
|
+
- Support for passing blocks to step adapters (am-kantox in [#36](https://github.com/dry-rb/dry-transaction/pull/36))
|
237
|
+
|
238
|
+
```ruby
|
239
|
+
Dry.Transaction(container: MyContainer) do
|
240
|
+
my_custom_step :some_step do
|
241
|
+
# this code is captured as a block and passed to the step adapter
|
242
|
+
end
|
243
|
+
end
|
244
|
+
```
|
245
|
+
|
246
|
+
### Changed
|
247
|
+
|
248
|
+
- Whole step object is passed to `StepFailure` upon failure, which provides more information to custom matchers (mrbongiolo in [#35](https://github.com/dry-rb/dry-transaction/pull/35))
|
249
|
+
- `#call` argument order for step operations is now `#call(input, *args)`, not `#call(*args, input)` (timriley in [#48](https://github.com/dry-rb/dry-transaction/pull/48))
|
250
|
+
- `Dry::Transaction::Sequence` renamed to `Dry::Transaction` (timriley in [#49](https://github.com/dry-rb/dry-transaction/pull/49))
|
251
|
+
|
252
|
+
[Compare v0.8.0...v0.9.0](https://github.com/dry-rb/dry-transaction/compare/v0.8.0...v0.9.0)
|
253
|
+
|
254
|
+
## 0.8.0 2016-07-06
|
255
|
+
|
256
|
+
|
257
|
+
### Added
|
258
|
+
|
259
|
+
- Provide your own matcher object via a `matcher:` option passed to `Dry.Transaction` (timriley)
|
260
|
+
|
261
|
+
### Changed
|
262
|
+
|
263
|
+
- Match block API is now provided by `dry-matcher` gem (timriley)
|
264
|
+
- Matching behaviour is clearer: match cases are run in order, the first match case “wins” and is executed, and all subsequent cases are ignored. This ensures a single, deterministic return value from the match block - the output of the single “winning” match case. (timriley)
|
265
|
+
|
266
|
+
[Compare v0.7.0...v0.8.0](https://github.com/dry-rb/dry-transaction/compare/v0.7.0...v0.8.0)
|
267
|
+
|
268
|
+
## 0.7.0 2016-06-06
|
269
|
+
|
270
|
+
|
271
|
+
### Added
|
272
|
+
|
273
|
+
- `try` steps support a `:raise` option, so a caught exception can be re-raised as a different (more domain-specific) exception (mrbongiolo)
|
274
|
+
|
275
|
+
### Fixed
|
276
|
+
|
277
|
+
- Add `#respond_to_missing?` to `StepFailure` wrapper class so it can more faithfully represent the failure object it wraps (flash-gordon)
|
278
|
+
- Stop the DSL processing from conflicting with ActiveSupport's `Object#try` monkey-patch (joevandyk)
|
279
|
+
|
280
|
+
### Changed
|
281
|
+
|
282
|
+
- Use dry-monads (e.g. `Dry::Monads::Either::Right`) instead of kleisli (`Kleisli::Either::Right`) (flash-gordon)
|
283
|
+
|
284
|
+
[Compare v0.6.0...v0.7.0](https://github.com/dry-rb/dry-transaction/compare/v0.6.0...v0.7.0)
|
285
|
+
|
286
|
+
## 0.6.0 2016-04-06
|
287
|
+
|
288
|
+
|
289
|
+
### Added
|
290
|
+
|
291
|
+
- Allow custom step adapters to be supplied via a container of adapters being passed as a `step_adapters:` option to `Dry.Transaction` (timriley)
|
292
|
+
- Raise a meaningful error if a `step` step returns a non-`Either` object (davidpelaez)
|
293
|
+
- ## Internal
|
294
|
+
- Change the step adapter API so more step-related information remains available at the time of the step being called (timriley)
|
295
|
+
|
296
|
+
|
297
|
+
[Compare v0.5.0...v0.6.0](https://github.com/dry-rb/dry-transaction/compare/v0.5.0...v0.6.0)
|
298
|
+
|
299
|
+
## 0.5.0 2016-03-16
|
300
|
+
|
301
|
+
|
302
|
+
|
303
|
+
[Compare v0.4.0...v0.5.0](https://github.com/dry-rb/dry-transaction/compare/v0.4.0...v0.5.0)
|
304
|
+
|
305
|
+
## 0.4.0 2015-12-26
|
306
|
+
|
307
|
+
|
308
|
+
|
309
|
+
[Compare v0.3.2...v0.4.0](https://github.com/dry-rb/dry-transaction/compare/v0.3.2...v0.4.0)
|
310
|
+
|
311
|
+
## 0.3.2 2015-11-13
|
312
|
+
|
313
|
+
|
314
|
+
|
315
|
+
[Compare v0.3.1...v0.3.2](https://github.com/dry-rb/dry-transaction/compare/v0.3.1...v0.3.2)
|
316
|
+
|
317
|
+
## 0.3.1 2015-11-12
|
318
|
+
|
319
|
+
|
320
|
+
|
321
|
+
[Compare v0.3.0...v0.3.1](https://github.com/dry-rb/dry-transaction/compare/v0.3.0...v0.3.1)
|
322
|
+
|
323
|
+
## 0.3.0 2015-11-11
|
324
|
+
|
325
|
+
|
326
|
+
|
327
|
+
[Compare v0.2.0...v0.3.0](https://github.com/dry-rb/dry-transaction/compare/v0.2.0...v0.3.0)
|
328
|
+
|
329
|
+
## 0.2.0 2015-11-02
|
330
|
+
|
331
|
+
|
332
|
+
|
333
|
+
[Compare v0.1.0...v0.2.0](https://github.com/dry-rb/dry-transaction/compare/v0.1.0...v0.2.0)
|
334
|
+
|
335
|
+
## 0.1.0 2015-10-28
|
336
|
+
|
337
|
+
Initial release.
|
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015-2021 dry-rb team
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
6
|
+
this software and associated documentation files (the "Software"), to deal in
|
7
|
+
the Software without restriction, including without limitation the rights to
|
8
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
9
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
10
|
+
subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
17
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
18
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
19
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
20
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
@@ -1,57 +1,30 @@
|
|
1
|
-
|
2
|
-
[gem]: https://
|
3
|
-
[
|
4
|
-
[
|
5
|
-
[
|
6
|
-
[coveralls]: https://coveralls.io/r/dry-rb/dry-transaction
|
1
|
+
<!--- this file is synced from dry-rb/template-gem project -->
|
2
|
+
[gem]: https://rubygems.org/gems/dry-transaction
|
3
|
+
[actions]: https://github.com/dry-rb/dry-transaction/actions
|
4
|
+
[codacy]: https://www.codacy.com/gh/dry-rb/dry-transaction
|
5
|
+
[chat]: https://dry-rb.zulipchat.com
|
7
6
|
[inchpages]: http://inch-ci.org/github/dry-rb/dry-transaction
|
8
7
|
|
9
|
-
# dry-transaction [![Join the chat at https://
|
8
|
+
# dry-transaction [![Join the chat at https://dry-rb.zulipchat.com](https://img.shields.io/badge/dry--rb-join%20chat-%23346b7a.svg)][chat]
|
10
9
|
|
11
10
|
[![Gem Version](https://badge.fury.io/rb/dry-transaction.svg)][gem]
|
12
|
-
[![
|
13
|
-
[![
|
14
|
-
[![
|
15
|
-
[![Test Coverage](https://codeclimate.com/github/dry-rb/dry-transaction/badges/coverage.svg)][codeclimate]
|
11
|
+
[![CI Status](https://github.com/dry-rb/dry-transaction/workflows/ci/badge.svg)][actions]
|
12
|
+
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/f2c8f3f2e96a477faee00109cfb2090d)][codacy]
|
13
|
+
[![Codacy Badge](https://api.codacy.com/project/badge/Coverage/f2c8f3f2e96a477faee00109cfb2090d)][codacy]
|
16
14
|
[![Inline docs](http://inch-ci.org/github/dry-rb/dry-transaction.svg?branch=master)][inchpages]
|
17
15
|
|
18
|
-
dry-transaction is a business transaction DSL. It provides a simple way to define a complex business transaction that includes processing by many different objects.
|
19
|
-
|
20
|
-
## Installation
|
21
|
-
|
22
|
-
Add this line to your application's Gemfile:
|
23
|
-
|
24
|
-
```ruby
|
25
|
-
gem 'dry-transaction'
|
26
|
-
```
|
27
|
-
|
28
|
-
And then execute:
|
29
|
-
|
30
|
-
```sh
|
31
|
-
$ bundle
|
32
|
-
```
|
33
|
-
|
34
|
-
Or install it yourself as:
|
35
|
-
|
36
|
-
```sh
|
37
|
-
$ gem install dry-transaction
|
38
|
-
```
|
39
|
-
|
40
16
|
## Links
|
41
17
|
|
42
|
-
* [
|
43
|
-
* [API documentation](http://
|
44
|
-
|
45
|
-
## Development
|
18
|
+
* [User documentation](https://dry-rb.org/gems/dry-transaction)
|
19
|
+
* [API documentation](http://rubydoc.info/gems/dry-transaction)
|
46
20
|
|
47
|
-
|
48
|
-
`rake spec` to run the tests. You can also run `bin/console` for an interactive
|
49
|
-
prompt that will allow you to experiment.
|
21
|
+
## Supported Ruby versions
|
50
22
|
|
51
|
-
|
23
|
+
This library officially supports the following Ruby versions:
|
52
24
|
|
53
|
-
|
25
|
+
* MRI `>= 2.6.0`
|
26
|
+
* jruby `>= 9.2`
|
54
27
|
|
55
28
|
## License
|
56
29
|
|
57
|
-
|
30
|
+
See `LICENSE` file.
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# this file is synced from dry-rb/template-gem project
|
4
|
+
|
5
|
+
lib = File.expand_path("lib", __dir__)
|
6
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
7
|
+
require "dry/transaction/version"
|
8
|
+
|
9
|
+
Gem::Specification.new do |spec|
|
10
|
+
spec.name = "dry-transaction"
|
11
|
+
spec.authors = ["Tim Riley"]
|
12
|
+
spec.email = ["tim@icelab.com.au"]
|
13
|
+
spec.license = "MIT"
|
14
|
+
spec.version = Dry::Transaction::VERSION.dup
|
15
|
+
|
16
|
+
spec.summary = "Business Transaction Flow DSL"
|
17
|
+
spec.description = spec.summary
|
18
|
+
spec.homepage = "https://dry-rb.org/gems/dry-transaction"
|
19
|
+
spec.files = Dir["CHANGELOG.md", "LICENSE", "README.md", "dry-transaction.gemspec", "lib/**/*"]
|
20
|
+
spec.bindir = "bin"
|
21
|
+
spec.executables = []
|
22
|
+
spec.require_paths = ["lib"]
|
23
|
+
|
24
|
+
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
25
|
+
spec.metadata["changelog_uri"] = "https://github.com/dry-rb/dry-transaction/blob/master/CHANGELOG.md"
|
26
|
+
spec.metadata["source_code_uri"] = "https://github.com/dry-rb/dry-transaction"
|
27
|
+
spec.metadata["bug_tracker_uri"] = "https://github.com/dry-rb/dry-transaction/issues"
|
28
|
+
|
29
|
+
if defined? JRUBY_VERSION
|
30
|
+
spec.required_ruby_version = ">= 2.5.0"
|
31
|
+
else
|
32
|
+
spec.required_ruby_version = ">= 2.6.0"
|
33
|
+
end
|
34
|
+
|
35
|
+
# to update dependencies edit project.yml
|
36
|
+
spec.add_runtime_dependency "dry-container", ">= 0.2.8"
|
37
|
+
spec.add_runtime_dependency "dry-events", ">= 0.1.0"
|
38
|
+
spec.add_runtime_dependency "dry-matcher", ">= 0.7.0"
|
39
|
+
spec.add_runtime_dependency "dry-monads", ">= 0.4.0"
|
40
|
+
|
41
|
+
end
|