dry-transaction 0.11.2 → 0.13.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +317 -0
  3. data/LICENSE +20 -0
  4. data/README.md +15 -43
  5. data/dry-transaction.gemspec +35 -0
  6. data/lib/dry-transaction.rb +2 -0
  7. data/lib/dry/transaction.rb +2 -0
  8. data/lib/dry/transaction/builder.rb +6 -4
  9. data/lib/dry/transaction/callable.rb +18 -0
  10. data/lib/dry/transaction/dsl.rb +9 -7
  11. data/lib/dry/transaction/errors.rb +2 -0
  12. data/lib/dry/transaction/instance_methods.rb +24 -20
  13. data/lib/dry/transaction/operation.rb +5 -3
  14. data/lib/dry/transaction/operation_resolver.rb +4 -2
  15. data/lib/dry/transaction/result_matcher.rb +7 -5
  16. data/lib/dry/transaction/stack.rb +2 -0
  17. data/lib/dry/transaction/step.rb +37 -24
  18. data/lib/dry/transaction/step_adapter.rb +6 -4
  19. data/lib/dry/transaction/step_adapters.rb +9 -7
  20. data/lib/dry/transaction/step_adapters/around.rb +4 -2
  21. data/lib/dry/transaction/step_adapters/check.rb +2 -0
  22. data/lib/dry/transaction/step_adapters/map.rb +2 -0
  23. data/lib/dry/transaction/step_adapters/raw.rb +5 -3
  24. data/lib/dry/transaction/step_adapters/tee.rb +2 -0
  25. data/lib/dry/transaction/step_adapters/try.rb +3 -1
  26. data/lib/dry/transaction/step_failure.rb +12 -0
  27. data/lib/dry/transaction/version.rb +3 -1
  28. metadata +14 -110
  29. data/Gemfile +0 -15
  30. data/Gemfile.lock +0 -97
  31. data/LICENSE.md +0 -9
  32. data/Rakefile +0 -6
  33. data/spec/examples.txt +0 -83
  34. data/spec/integration/around_spec.rb +0 -81
  35. data/spec/integration/auto_injection_spec.rb +0 -32
  36. data/spec/integration/custom_step_adapters_spec.rb +0 -41
  37. data/spec/integration/operation_spec.rb +0 -30
  38. data/spec/integration/passing_step_arguments_spec.rb +0 -51
  39. data/spec/integration/publishing_step_events_spec.rb +0 -119
  40. data/spec/integration/transaction_spec.rb +0 -566
  41. data/spec/integration/transaction_without_steps_spec.rb +0 -101
  42. data/spec/spec_helper.rb +0 -116
  43. data/spec/support/container.rb +0 -10
  44. data/spec/support/database.rb +0 -12
  45. data/spec/support/db_transactions.rb +0 -45
  46. data/spec/support/result_mixin.rb +0 -3
  47. data/spec/support/test_module_constants.rb +0 -11
  48. data/spec/unit/step_adapters/around_spec.rb +0 -46
  49. data/spec/unit/step_adapters/check_spec.rb +0 -43
  50. data/spec/unit/step_adapters/map_spec.rb +0 -16
  51. data/spec/unit/step_adapters/raw_spec.rb +0 -36
  52. data/spec/unit/step_adapters/tee_spec.rb +0 -17
  53. data/spec/unit/step_adapters/try_spec.rb +0 -89
  54. data/spec/unit/step_spec.rb +0 -131
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 276cf0f224a91609346da41546c856d66b812f170e1cefdf955b47bbcd026be4
4
- data.tar.gz: 0c221a299d6fbd3827444f1dae381ba939660562c9c7faad3e8f1c413ea8f8d9
3
+ metadata.gz: 625617cfd08882549ed80e2c6f9fca647b433b3c9b01f141722dd8e5e350ca93
4
+ data.tar.gz: 4c4eab3625d39e43ad4d8e867e07d161af1397220cae2ac95022e660f5120149
5
5
  SHA512:
6
- metadata.gz: 60e0c3811eaa55ba407af65b383801e7a51ca27cae32bd8957fdb43b96896b8ff6020c60a49e4cbc6f7121655ae14d61269573226ad64cf24e6e828b9245be4b
7
- data.tar.gz: 3ca91483d02fde42afac52df0dcf22aeef1b11d6325f923f7267de7c238df6b66070850582c865a4229449d2f7341b6a38dfe8c7d9f277b796523147f78f7b80
6
+ metadata.gz: 400e487b067363922f1c03a218b6d3b078d3a43cecbf47d0d3f8419373c0007926aae5d71848927f8dd17fdb9db9abc398922d968aebee4af16f7a7ccd80307a
7
+ data.tar.gz: 1b577f303186b90200f292eca519f4de03b08ab67d5c15ead11f435d9c5a7319be49075f5b253907b05a0595b1cf40d8e4d17036638b323c35100e9774481688
data/CHANGELOG.md ADDED
@@ -0,0 +1,317 @@
1
+ <!--- DO NOT EDIT THIS FILE - IT'S AUTOMATICALLY GENERATED VIA DEVTOOLS --->
2
+
3
+ ## 0.13.1 2021-01-31
4
+
5
+
6
+ ### Changed
7
+
8
+ - Resolve Ruby 2.7 deprecation warnings and support Ruby 3.0 (@robbl-as in PR #134)
9
+
10
+ [Compare v0.13.0...v0.13.1](https://github.com/dry-rb/dry-transaction/compare/v0.13.0...v0.13.1)
11
+
12
+ ## 0.13.0 2018-06-13
13
+
14
+
15
+ ### Changed
16
+
17
+ - 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])
18
+
19
+ [Compare v0.12.1...v0.13.0](https://github.com/dry-rb/dry-transaction/compare/v0.12.1...v0.13.0)
20
+
21
+ ## 0.12.1 2018-06-05
22
+
23
+
24
+ ### Fixed
25
+
26
+ - Support result matching on step failures nested within around steps (flash-gordon in [#106][pr106])
27
+
28
+
29
+ [Compare v0.12.0...v0.12.1](https://github.com/dry-rb/dry-transaction/compare/v0.12.0...v0.12.1)
30
+
31
+ ## 0.12.0 2018-05-16
32
+
33
+
34
+ ### Changed
35
+
36
+ - Switch to `Dry::Monads::Result` API (away from `Either` API deprecated in dry-monads 1.0 betas) (Morozzzko in [#104][pr104])
37
+
38
+ [Compare v0.11.2...v0.12.0](https://github.com/dry-rb/dry-transaction/compare/v0.11.2...v0.12.0)
39
+
40
+ ## 0.11.2 2018-05-15
41
+
42
+
43
+ ### Changed
44
+
45
+ - Use `Dry::Monads::Result` instead of the deprecated `Dry::Monads::Either` in the `check` step adapter (PavelTkachenko in [#103][pr103])
46
+
47
+ [Compare v0.11.1...v0.11.2](https://github.com/dry-rb/dry-transaction/compare/v0.11.1...v0.11.2)
48
+
49
+ ## 0.11.1 2018-03-15
50
+
51
+
52
+ ### Added
53
+
54
+ - 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])
55
+
56
+
57
+ [Compare v0.11.0...v0.11.1](https://github.com/dry-rb/dry-transaction/compare/v0.11.0...v0.11.1)
58
+
59
+ ## 0.11.0 2018-02-19
60
+
61
+
62
+ ### Added
63
+
64
+ - 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])
65
+ - Broadcast when a step has started by sending the event `step_called` (mihairadulescu in [#82][pr82])
66
+ - Add new step `check` that returns `Success` or `Failure` base on conditions (semenovDL in [#84][pr84])
67
+ - Support for transaction steps without input values (GustavoCaso and timriley in [#69][pr69])
68
+
69
+ ### Fixed
70
+
71
+ - Pass arguments to a step with keyword arguments with default values (flash-gordon in [#74][pr74])
72
+ - Steps can be wrapped with private methods (semenovDL in [#70][pr70])
73
+ - Improved error message on missing transaction step (Morozzzko in [#79][pr79])
74
+
75
+ ### Changed
76
+
77
+ - [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])
78
+ - [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])
79
+ - [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])
80
+ - 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])
81
+ - Minimal Ruby version is 2.2 (flash-gordon in [#72][pr72])
82
+
83
+ [Compare v0.10.2...v0.11.0](https://github.com/dry-rb/dry-transaction/compare/v0.10.2...v0.11.0)
84
+
85
+ ## 0.10.2 2017-07-10
86
+
87
+
88
+ ### Fixed
89
+
90
+ - 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])
91
+
92
+
93
+ [Compare v0.10.1...v0.10.2](https://github.com/dry-rb/dry-transaction/compare/v0.10.1...v0.10.2)
94
+
95
+ ## 0.10.1 2017-06-30
96
+
97
+
98
+ ### Fixed
99
+
100
+ - 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))
101
+
102
+
103
+ [Compare v0.10.0...v0.10.1](https://github.com/dry-rb/dry-transaction/compare/v0.10.0...v0.10.1)
104
+
105
+ ## 0.10.0 2017-06-15
106
+
107
+ 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.
108
+
109
+ ### Added
110
+
111
+ - 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))
112
+
113
+ ```ruby
114
+ class MyOperation
115
+ include Dry::Transaction::Operation
116
+
117
+ def call(input)
118
+ Right(input)
119
+ end
120
+ end
121
+
122
+ my_op = MyOperation.new
123
+ my_op.("hello") do |m|
124
+ m.success do |v|
125
+ "Success: #{v}
126
+ end
127
+ m.failure do |v|
128
+ "Failure: #{v}"
129
+ end
130
+ end
131
+ # => "Success: hello"
132
+
133
+ ### Changed
134
+
135
+ - [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))
136
+
137
+ ```ruby
138
+ class CreateUser
139
+ include Dry::Transaction(container: Container)
140
+
141
+ step :process, with: "operations.process"
142
+ step :validate, with: "operations.validate"
143
+ step :persist, with: "operations.persist"
144
+ end
145
+
146
+ create_user = CreateUser.new
147
+ create_user.call("name" => "Jane Doe")
148
+ ```
149
+
150
+ Instance methods can wrap operations by calling `super`:
151
+
152
+ ```ruby
153
+ class CreateUser
154
+ include Dry::Transaction(container: Container)
155
+
156
+ step :process, with: "operations.process"
157
+ step :validate, with: "operations.validate"
158
+ step :persist, with: "operations.persist"
159
+
160
+ def process(input)
161
+ adjusted_input = do_something_with(input)
162
+ super(adjusted_input)
163
+ end
164
+ end
165
+ ```
166
+
167
+ Substitute operations can be injected when initializing objects (helpful for testing):
168
+
169
+ ```ruby
170
+ create_user = CreateUser.new(process: substitute_process_operation)
171
+ ```
172
+ - Transactions can be defined without an operations container, using instance methods only.
173
+
174
+ ```ruby
175
+ class CreateUser
176
+ include Dry::Transaction
177
+
178
+ step :process
179
+ step :validate
180
+
181
+ def process(input)
182
+ input = do_something_with(input)
183
+ Right(input)
184
+ end
185
+
186
+ def validate(input)
187
+ if input[:email].include?("@")
188
+ Right(input)
189
+ else
190
+ Left(:not_valid)
191
+ end
192
+ end
193
+ end
194
+ ```
195
+ - [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.
196
+ - [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).
197
+ - [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.
198
+
199
+ [Compare v0.9.0...v0.10.0](https://github.com/dry-rb/dry-transaction/compare/v0.9.0...v0.10.0)
200
+
201
+ ## 0.9.0 2016-12-19
202
+
203
+
204
+ ### Added
205
+
206
+ - 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))
207
+
208
+ ```ruby
209
+ Dry.Transaction(container: MyContainer) do
210
+ step :some_step, with: "operations.some_thing"
211
+ step :another, with: -> input {
212
+ # your code here
213
+ }
214
+ end
215
+ ```
216
+ - Support for passing blocks to step adapters (am-kantox in [#36](https://github.com/dry-rb/dry-transaction/pull/36))
217
+
218
+ ```ruby
219
+ Dry.Transaction(container: MyContainer) do
220
+ my_custom_step :some_step do
221
+ # this code is captured as a block and passed to the step adapter
222
+ end
223
+ end
224
+ ```
225
+
226
+ ### Changed
227
+
228
+ - 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))
229
+ - `#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))
230
+ - `Dry::Transaction::Sequence` renamed to `Dry::Transaction` (timriley in [#49](https://github.com/dry-rb/dry-transaction/pull/49))
231
+
232
+ [Compare v0.8.0...v0.9.0](https://github.com/dry-rb/dry-transaction/compare/v0.8.0...v0.9.0)
233
+
234
+ ## 0.8.0 2016-07-06
235
+
236
+
237
+ ### Added
238
+
239
+ - Provide your own matcher object via a `matcher:` option passed to `Dry.Transaction` (timriley)
240
+
241
+ ### Changed
242
+
243
+ - Match block API is now provided by `dry-matcher` gem (timriley)
244
+ - 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)
245
+
246
+ [Compare v0.7.0...v0.8.0](https://github.com/dry-rb/dry-transaction/compare/v0.7.0...v0.8.0)
247
+
248
+ ## 0.7.0 2016-06-06
249
+
250
+
251
+ ### Added
252
+
253
+ - `try` steps support a `:raise` option, so a caught exception can be re-raised as a different (more domain-specific) exception (mrbongiolo)
254
+
255
+ ### Fixed
256
+
257
+ - Add `#respond_to_missing?` to `StepFailure` wrapper class so it can more faithfully represent the failure object it wraps (flash-gordon)
258
+ - Stop the DSL processing from conflicting with ActiveSupport's `Object#try` monkey-patch (joevandyk)
259
+
260
+ ### Changed
261
+
262
+ - Use dry-monads (e.g. `Dry::Monads::Either::Right`) instead of kleisli (`Kleisli::Either::Right`) (flash-gordon)
263
+
264
+ [Compare v0.6.0...v0.7.0](https://github.com/dry-rb/dry-transaction/compare/v0.6.0...v0.7.0)
265
+
266
+ ## 0.6.0 2016-04-06
267
+
268
+
269
+ ### Added
270
+
271
+ - Allow custom step adapters to be supplied via a container of adapters being passed as a `step_adapters:` option to `Dry.Transaction` (timriley)
272
+ - Raise a meaningful error if a `step` step returns a non-`Either` object (davidpelaez)
273
+ - ## Internal
274
+ - Change the step adapter API so more step-related information remains available at the time of the step being called (timriley)
275
+
276
+
277
+ [Compare v0.5.0...v0.6.0](https://github.com/dry-rb/dry-transaction/compare/v0.5.0...v0.6.0)
278
+
279
+ ## 0.5.0 2016-03-16
280
+
281
+
282
+
283
+ [Compare v0.4.0...v0.5.0](https://github.com/dry-rb/dry-transaction/compare/v0.4.0...v0.5.0)
284
+
285
+ ## 0.4.0 2015-12-26
286
+
287
+
288
+
289
+ [Compare v0.3.2...v0.4.0](https://github.com/dry-rb/dry-transaction/compare/v0.3.2...v0.4.0)
290
+
291
+ ## 0.3.2 2015-11-13
292
+
293
+
294
+
295
+ [Compare v0.3.1...v0.3.2](https://github.com/dry-rb/dry-transaction/compare/v0.3.1...v0.3.2)
296
+
297
+ ## 0.3.1 2015-11-12
298
+
299
+
300
+
301
+ [Compare v0.3.0...v0.3.1](https://github.com/dry-rb/dry-transaction/compare/v0.3.0...v0.3.1)
302
+
303
+ ## 0.3.0 2015-11-11
304
+
305
+
306
+
307
+ [Compare v0.2.0...v0.3.0](https://github.com/dry-rb/dry-transaction/compare/v0.2.0...v0.3.0)
308
+
309
+ ## 0.2.0 2015-11-02
310
+
311
+
312
+
313
+ [Compare v0.1.0...v0.2.0](https://github.com/dry-rb/dry-transaction/compare/v0.1.0...v0.2.0)
314
+
315
+ ## 0.1.0 2015-10-28
316
+
317
+ 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,29 @@
1
- [gitter]: https://gitter.im/dry-rb/chat
2
- [gem]: https://img.shields.io/gem/v/dry-transaction.svg]
3
- [travis]: https://travis-ci.org/dry-rb/dry-transaction
4
- [gemnasium]: https://gemnasium.com/dry-rb/dry-transaction
5
- [codeclimate]: https://codeclimate.com/github/dry-rb/dry-transaction
6
- [coveralls]: https://coveralls.io/r/dry-rb/dry-transaction
1
+ [gem]: https://rubygems.org/gems/dry-transaction
2
+ [actions]: https://github.com/dry-rb/dry-transaction/actions
3
+ [codacy]: https://www.codacy.com/gh/dry-rb/dry-transaction
4
+ [chat]: https://dry-rb.zulipchat.com
7
5
  [inchpages]: http://inch-ci.org/github/dry-rb/dry-transaction
8
6
 
9
- # dry-transaction [![Join the chat at https://gitter.im/dry-rb/chat](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/dry-rb/chat)
7
+ # dry-transaction [![Join the chat at https://dry-rb.zulipchat.com](https://img.shields.io/badge/dry--rb-join%20chat-%23346b7a.svg)][chat]
10
8
 
11
9
  [![Gem Version](https://badge.fury.io/rb/dry-transaction.svg)][gem]
12
- [![Build Status](https://travis-ci.org/dry-rb/dry-transaction.svg?branch=master)][travis]
13
- [![Dependency Status](https://gemnasium.com/dry-rb/dry-transaction.svg)][gemnasium]
14
- [![Code Climate](https://codeclimate.com/github/dry-rb/dry-transaction/badges/gpa.svg)][codeclimate]
15
- [![Test Coverage](https://codeclimate.com/github/dry-rb/dry-transaction/badges/coverage.svg)][codeclimate]
10
+ [![CI Status](https://github.com/dry-rb/dry-transaction/workflows/ci/badge.svg)][actions]
11
+ [![Codacy Badge](https://api.codacy.com/project/badge/Grade/f2c8f3f2e96a477faee00109cfb2090d)][codacy]
12
+ [![Codacy Badge](https://api.codacy.com/project/badge/Coverage/f2c8f3f2e96a477faee00109cfb2090d)][codacy]
16
13
  [![Inline docs](http://inch-ci.org/github/dry-rb/dry-transaction.svg?branch=master)][inchpages]
17
14
 
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
15
  ## Links
41
16
 
42
- * [Documentation](http://dry-rb.org/gems/dry-transaction)
43
- * [API documentation](http://www.rubydoc.info/github/dry-rb/dry-transaction)
44
-
45
- ## Development
17
+ * [User documentation](http://dry-rb.org/gems/dry-transaction)
18
+ * [API documentation](http://rubydoc.info/gems/dry-transaction)
46
19
 
47
- After checking out the repo, run `bundle install` to install dependencies. Then, run
48
- `rake spec` to run the tests. You can also run `bin/console` for an interactive
49
- prompt that will allow you to experiment.
20
+ ## Supported Ruby versions
50
21
 
51
- ## Contributing
22
+ This library officially supports the following Ruby versions:
52
23
 
53
- Bug reports and pull requests are welcome on GitHub at <https://github.com/dry-rb/dry-transaction>.
24
+ * MRI >= `2.5`
25
+ * jruby >= `9.2`
54
26
 
55
27
  ## License
56
28
 
57
- Copyright © 2015-2016 [Icelab](http://icelab.com.au/). dry-transaction is free software, and may be redistributed under the terms specified in the [license](LICENSE.md).
29
+ See `LICENSE` file.
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+ # this file is managed by dry-rb/devtools project
3
+
4
+ lib = File.expand_path('lib', __dir__)
5
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
6
+ require 'dry/transaction/version'
7
+
8
+ Gem::Specification.new do |spec|
9
+ spec.name = 'dry-transaction'
10
+ spec.authors = ["Tim Riley"]
11
+ spec.email = ["tim@icelab.com.au"]
12
+ spec.license = 'MIT'
13
+ spec.version = Dry::Transaction::VERSION.dup
14
+
15
+ spec.summary = "Business Transaction Flow DSL"
16
+ spec.description = spec.summary
17
+ spec.homepage = 'https://dry-rb.org/gems/dry-transaction'
18
+ spec.files = Dir["CHANGELOG.md", "LICENSE", "README.md", "dry-transaction.gemspec", "lib/**/*"]
19
+ spec.bindir = 'bin'
20
+ spec.executables = []
21
+ spec.require_paths = ['lib']
22
+
23
+ spec.metadata['allowed_push_host'] = 'https://rubygems.org'
24
+ spec.metadata['changelog_uri'] = 'https://github.com/dry-rb/dry-transaction/blob/master/CHANGELOG.md'
25
+ spec.metadata['source_code_uri'] = 'https://github.com/dry-rb/dry-transaction'
26
+ spec.metadata['bug_tracker_uri'] = 'https://github.com/dry-rb/dry-transaction/issues'
27
+
28
+ spec.required_ruby_version = ">= 2.5.0"
29
+
30
+ # to update dependencies edit project.yml
31
+ spec.add_runtime_dependency "dry-container", ">= 0.2.8"
32
+ spec.add_runtime_dependency "dry-events", ">= 0.1.0"
33
+ spec.add_runtime_dependency "dry-matcher", ">= 0.7.0"
34
+ spec.add_runtime_dependency "dry-monads", ">= 0.4.0"
35
+ end