dry-logic 0.6.1 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +121 -22
- data/LICENSE +1 -1
- data/README.md +12 -14
- data/dry-logic.gemspec +29 -14
- data/lib/dry-logic.rb +2 -0
- data/lib/dry/logic.rb +2 -0
- data/lib/dry/logic/appliable.rb +2 -0
- data/lib/dry/logic/evaluator.rb +2 -0
- data/lib/dry/logic/operations.rb +2 -0
- data/lib/dry/logic/operations/abstract.rb +5 -3
- data/lib/dry/logic/operations/and.rb +3 -1
- data/lib/dry/logic/operations/attr.rb +2 -0
- data/lib/dry/logic/operations/binary.rb +2 -0
- data/lib/dry/logic/operations/check.rb +3 -1
- data/lib/dry/logic/operations/each.rb +2 -0
- data/lib/dry/logic/operations/implication.rb +2 -0
- data/lib/dry/logic/operations/key.rb +4 -2
- data/lib/dry/logic/operations/negation.rb +2 -0
- data/lib/dry/logic/operations/or.rb +2 -0
- data/lib/dry/logic/operations/set.rb +2 -0
- data/lib/dry/logic/operations/unary.rb +2 -0
- data/lib/dry/logic/operations/xor.rb +2 -0
- data/lib/dry/logic/operators.rb +2 -0
- data/lib/dry/logic/predicates.rb +39 -21
- data/lib/dry/logic/result.rb +2 -0
- data/lib/dry/logic/rule.rb +5 -3
- data/lib/dry/logic/rule/interface.rb +3 -1
- data/lib/dry/logic/rule/predicate.rb +2 -0
- data/lib/dry/logic/rule_compiler.rb +2 -0
- data/lib/dry/logic/version.rb +3 -1
- metadata +11 -128
- data/.codeclimate.yml +0 -15
- data/.gitignore +0 -8
- data/.rspec +0 -3
- data/.travis.yml +0 -31
- data/CONTRIBUTING.md +0 -29
- data/Gemfile +0 -13
- data/Rakefile +0 -12
- data/benchmarks/rule_application.rb +0 -28
- data/benchmarks/setup.rb +0 -11
- data/bin/console +0 -10
- data/examples/basic.rb +0 -14
- data/spec/integration/result_spec.rb +0 -59
- data/spec/integration/rule_spec.rb +0 -53
- data/spec/shared/predicates.rb +0 -57
- data/spec/shared/rule.rb +0 -72
- data/spec/spec_helper.rb +0 -34
- data/spec/support/mutant.rb +0 -9
- data/spec/unit/operations/and_spec.rb +0 -68
- data/spec/unit/operations/attr_spec.rb +0 -27
- data/spec/unit/operations/check_spec.rb +0 -49
- data/spec/unit/operations/each_spec.rb +0 -47
- data/spec/unit/operations/implication_spec.rb +0 -30
- data/spec/unit/operations/key_spec.rb +0 -133
- data/spec/unit/operations/negation_spec.rb +0 -49
- data/spec/unit/operations/or_spec.rb +0 -73
- data/spec/unit/operations/set_spec.rb +0 -41
- data/spec/unit/operations/xor_spec.rb +0 -61
- data/spec/unit/predicates/array_spec.rb +0 -41
- data/spec/unit/predicates/attr_spec.rb +0 -29
- data/spec/unit/predicates/bool_spec.rb +0 -34
- data/spec/unit/predicates/case_spec.rb +0 -33
- data/spec/unit/predicates/date_spec.rb +0 -31
- data/spec/unit/predicates/date_time_spec.rb +0 -31
- data/spec/unit/predicates/decimal_spec.rb +0 -32
- data/spec/unit/predicates/empty_spec.rb +0 -38
- data/spec/unit/predicates/eql_spec.rb +0 -21
- data/spec/unit/predicates/even_spec.rb +0 -31
- data/spec/unit/predicates/excluded_from_spec.rb +0 -35
- data/spec/unit/predicates/excludes_spec.rb +0 -56
- data/spec/unit/predicates/false_spec.rb +0 -35
- data/spec/unit/predicates/filled_spec.rb +0 -38
- data/spec/unit/predicates/float_spec.rb +0 -31
- data/spec/unit/predicates/format_spec.rb +0 -21
- data/spec/unit/predicates/gt_spec.rb +0 -40
- data/spec/unit/predicates/gteq_spec.rb +0 -40
- data/spec/unit/predicates/included_in_spec.rb +0 -35
- data/spec/unit/predicates/includes_spec.rb +0 -24
- data/spec/unit/predicates/int_spec.rb +0 -34
- data/spec/unit/predicates/key_spec.rb +0 -29
- data/spec/unit/predicates/lt_spec.rb +0 -40
- data/spec/unit/predicates/lteq_spec.rb +0 -40
- data/spec/unit/predicates/max_size_spec.rb +0 -49
- data/spec/unit/predicates/min_size_spec.rb +0 -49
- data/spec/unit/predicates/none_spec.rb +0 -28
- data/spec/unit/predicates/not_eql_spec.rb +0 -21
- data/spec/unit/predicates/number_spec.rb +0 -37
- data/spec/unit/predicates/odd_spec.rb +0 -31
- data/spec/unit/predicates/size_spec.rb +0 -55
- data/spec/unit/predicates/str_spec.rb +0 -32
- data/spec/unit/predicates/time_spec.rb +0 -31
- data/spec/unit/predicates/true_spec.rb +0 -35
- data/spec/unit/predicates/type_spec.rb +0 -35
- data/spec/unit/predicates_spec.rb +0 -23
- data/spec/unit/rule/predicate_spec.rb +0 -53
- data/spec/unit/rule_compiler_spec.rb +0 -127
- data/spec/unit/rule_spec.rb +0 -211
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a6c0b350baaf47853027db9d61e790c195ced412ff40a9ecaac56b6588172da3
|
4
|
+
data.tar.gz: 966f1daee610a4eea2eae78743e8e17f0e57084b1106fd3f033483329895a4a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98002481f3e8cc83affa67ff7b3f8e69b22836f0737112bba1d4c656f39cbc06d9657bdb7865326fb9b6531660a9fd260b60d18d2062d9d149a97f25154a3974
|
7
|
+
data.tar.gz: cc6163b44e7e2ef296901e35085fa42290ad8b4b936237e26409f7f71d90041e12472322319d3dc8553fb46dcf532b2747b68b1d3a5cd46e81bb94fb298cf56c
|
data/CHANGELOG.md
CHANGED
@@ -1,22 +1,101 @@
|
|
1
|
-
|
1
|
+
## 1.0.6 2020-02-10
|
2
|
+
|
3
|
+
|
4
|
+
### Fixed
|
5
|
+
|
6
|
+
- Made the regexp used by `uuid_v4?` more secure (@kml)
|
7
|
+
|
8
|
+
|
9
|
+
[Compare v1.0.5...v1.0.6](https://github.com/dry-rb/dry-logic/compare/v1.0.5...v1.0.6)
|
10
|
+
|
11
|
+
## 1.0.5 2019-11-07
|
12
|
+
|
13
|
+
|
14
|
+
### Fixed
|
15
|
+
|
16
|
+
- Make `format?` tolerant to `nil` values. It already worked like that before, but starting Ruby 2.7 it would produce warnings. Now it won't. Don't rely on this behavior, it's only added to make tests pass in dry-schema. Use explicit type checks instead (@flash-gordon)
|
17
|
+
|
18
|
+
|
19
|
+
[Compare v1.0.4...v1.0.5](https://github.com/dry-rb/dry-logic/compare/v1.0.4...v1.0.5)
|
20
|
+
|
21
|
+
## 1.0.4 2019-11-06
|
22
|
+
|
23
|
+
|
24
|
+
### Fixed
|
25
|
+
|
26
|
+
- Fix keyword warnings (@flash-gordon)
|
27
|
+
|
28
|
+
|
29
|
+
[Compare v1.0.3...v1.0.4](https://github.com/dry-rb/dry-logic/compare/v1.0.3...v1.0.4)
|
30
|
+
|
31
|
+
## 1.0.3 2019-08-01
|
32
|
+
|
33
|
+
|
34
|
+
### Added
|
35
|
+
|
36
|
+
- `bytesize?` predicate (@bmalinconico)
|
37
|
+
- `min_bytesize?` predicate (@bmalinconico)
|
38
|
+
- `max_bytesize? predicate (@bmalinconico)
|
39
|
+
|
40
|
+
### Changed
|
41
|
+
|
42
|
+
- Min ruby version was set to `>= 2.4.0` (@flash-gordon)
|
43
|
+
|
44
|
+
[Compare v1.0.2...v1.0.3](https://github.com/dry-rb/dry-logic/compare/v1.0.2...v1.0.3)
|
45
|
+
|
46
|
+
## 1.0.2 2019-06-14
|
47
|
+
|
48
|
+
Re-pushed 1.0.1 after dry-schema 1.2.0 release.
|
49
|
+
|
50
|
+
|
51
|
+
[Compare v1.0.1...v1.0.2](https://github.com/dry-rb/dry-logic/compare/v1.0.1...v1.0.2)
|
52
|
+
|
53
|
+
## 1.0.1 2019-06-04
|
54
|
+
|
55
|
+
This release was removed from rubygems because it broke dry-schema.
|
56
|
+
|
57
|
+
### Added
|
58
|
+
|
59
|
+
- `uuid_v4?` predicate (radar)
|
60
|
+
- `respond_to?` predicate (waiting-for-dev)
|
61
|
+
|
62
|
+
|
63
|
+
[Compare v1.0.0...v1.0.1](https://github.com/dry-rb/dry-logic/compare/v1.0.0...v1.0.1)
|
64
|
+
|
65
|
+
## 1.0.0 2019-04-23
|
66
|
+
|
67
|
+
|
68
|
+
### Changed
|
69
|
+
|
70
|
+
- Version bump to `1.0.0` (flash-gordon)
|
71
|
+
|
72
|
+
[Compare v0.6.1...v1.0.0](https://github.com/dry-rb/dry-logic/compare/v0.6.1...v1.0.0)
|
73
|
+
|
74
|
+
## 0.6.1 2019-04-18
|
75
|
+
|
76
|
+
|
77
|
+
### Fixed
|
78
|
+
|
79
|
+
- Fix a regression in dry-validation 0.x for argument-less predicates (flash-gordon)
|
2
80
|
|
3
|
-
* Fix a regression in dry-validation 0.x for argument-less predicates (flash-gordon)
|
4
81
|
|
5
82
|
[Compare v0.6.0...v0.6.1](https://github.com/dry-rb/dry-logic/compare/v0.6.0...v0.6.1)
|
6
83
|
|
7
|
-
|
84
|
+
## 0.6.0 2019-04-04
|
85
|
+
|
8
86
|
|
9
87
|
### Added
|
10
88
|
|
11
|
-
|
89
|
+
- Generating hints can be disabled by building `Operations::And` with `hints: false` option set (solnic)
|
12
90
|
|
13
91
|
### Changed
|
14
92
|
|
15
|
-
|
93
|
+
- `Rule` construction has been optimized so that currying and application is multiple-times faster (flash-gordon)
|
16
94
|
|
17
95
|
[Compare v0.5.0...v0.6.0](https://github.com/dry-rb/dry-logic/compare/v0.5.0...v0.6.0)
|
18
96
|
|
19
|
-
|
97
|
+
## 0.5.0 2019-01-29
|
98
|
+
|
20
99
|
|
21
100
|
### Added
|
22
101
|
|
@@ -26,9 +105,11 @@
|
|
26
105
|
|
27
106
|
- `Operation::Key#ast` will now return a correct AST with non-Undefined inputs (solnic)
|
28
107
|
|
108
|
+
|
29
109
|
[Compare v0.4.2...v0.5.0](https://github.com/dry-rb/dry-logic/compare/v0.4.2...v0.5.0)
|
30
110
|
|
31
|
-
|
111
|
+
## 0.4.2 2017-09-15
|
112
|
+
|
32
113
|
|
33
114
|
### Added
|
34
115
|
|
@@ -39,21 +120,23 @@
|
|
39
120
|
|
40
121
|
- A bug with using custom predicates within a standalone module in `dry-validation` (flash-gordon)
|
41
122
|
|
123
|
+
|
42
124
|
[Compare v0.4.1...v0.4.2](https://github.com/dry-rb/dry-logic/compare/v0.4.1...v0.4.2)
|
43
125
|
|
44
|
-
|
126
|
+
## 0.4.1 2017-01-23
|
45
127
|
|
46
|
-
### Changed
|
47
|
-
|
48
|
-
- Predicates simply reuse other predicate methods instead of referring to them via `#[]` (georgemillo)
|
49
128
|
|
50
129
|
### Fixed
|
51
130
|
|
52
131
|
- Warnings on MRI 2.4.0 are gone (jtippett)
|
53
132
|
|
133
|
+
### Changed
|
134
|
+
|
135
|
+
- Predicates simply reuse other predicate methods instead of referring to them via `#[]` (georgemillo)
|
136
|
+
|
54
137
|
[Compare v0.4.0...v0.4.1](https://github.com/dry-rb/dry-logic/compare/v0.4.0...v0.4.1)
|
55
138
|
|
56
|
-
|
139
|
+
## 0.4.0 2016-09-21
|
57
140
|
|
58
141
|
This is a partial rewrite focused on internal clean up and major performance improvements. This is also the beginning of the work to make this library first-class rather than "just" a rule backend for dry-validation and dry-types.
|
59
142
|
|
@@ -81,7 +164,8 @@ This is a partial rewrite focused on internal clean up and major performance imp
|
|
81
164
|
|
82
165
|
[Compare v0.3.0...v0.4.0](https://github.com/dry-rb/dry-logic/compare/v0.3.0...v0.4.0)
|
83
166
|
|
84
|
-
|
167
|
+
## 0.3.0 2016-07-01
|
168
|
+
|
85
169
|
|
86
170
|
### Added
|
87
171
|
|
@@ -96,7 +180,8 @@ This is a partial rewrite focused on internal clean up and major performance imp
|
|
96
180
|
|
97
181
|
[Compare v0.2.3...v0.3.0](https://github.com/dry-rb/dry-logic/compare/v0.2.3...v0.3.0)
|
98
182
|
|
99
|
-
|
183
|
+
## 0.2.3 2016-05-11
|
184
|
+
|
100
185
|
|
101
186
|
### Added
|
102
187
|
|
@@ -109,21 +194,28 @@ This is a partial rewrite focused on internal clean up and major performance imp
|
|
109
194
|
|
110
195
|
[Compare v0.2.2...v0.2.3](https://github.com/dry-rb/dry-logic/compare/v0.2.2...v0.2.3)
|
111
196
|
|
112
|
-
|
197
|
+
## 0.2.2 2016-03-30
|
198
|
+
|
113
199
|
|
114
200
|
### Added
|
115
201
|
|
116
202
|
- `number?`, `odd?`, `even?` predicates (fran-worley)
|
117
203
|
|
204
|
+
|
118
205
|
[Compare v0.2.1...v0.2.2](https://github.com/dry-rb/dry-logic/compare/v0.2.1...v0.2.2)
|
119
206
|
|
120
|
-
|
207
|
+
## 0.2.1 2016-03-20
|
208
|
+
|
121
209
|
|
122
210
|
### Fixed
|
123
211
|
|
124
212
|
- Result AST for `Rule::Each` correctly maps elements with eql inputs (solnic)
|
125
213
|
|
126
|
-
|
214
|
+
|
215
|
+
[Compare v0.2.0...v0.2.1](https://github.com/dry-rb/dry-logic/compare/v0.2.0...v0.2.1)
|
216
|
+
|
217
|
+
## 0.2.0 2016-03-11
|
218
|
+
|
127
219
|
|
128
220
|
### Changed
|
129
221
|
|
@@ -131,16 +223,19 @@ This is a partial rewrite focused on internal clean up and major performance imp
|
|
131
223
|
|
132
224
|
[Compare v0.1.4...v0.2.0](https://github.com/dry-rb/dry-logic/compare/v0.1.4...v0.2.0)
|
133
225
|
|
134
|
-
|
226
|
+
## 0.1.4 2016-01-27
|
227
|
+
|
135
228
|
|
136
229
|
### Added
|
137
230
|
|
138
231
|
- Support for hash-names in `Check` and `Result` which can properly resolve input
|
139
232
|
from nested results (solnic)
|
140
233
|
|
234
|
+
|
141
235
|
[Compare v0.1.3...v0.1.4](https://github.com/dry-rb/dry-logic/compare/v0.1.3...v0.1.4)
|
142
236
|
|
143
|
-
|
237
|
+
## 0.1.3 2016-01-27
|
238
|
+
|
144
239
|
|
145
240
|
### Added
|
146
241
|
|
@@ -152,15 +247,18 @@ This is a partial rewrite focused on internal clean up and major performance imp
|
|
152
247
|
|
153
248
|
[Compare v0.1.2...v0.1.3](https://github.com/dry-rb/dry-logic/compare/v0.1.2...v0.1.3)
|
154
249
|
|
155
|
-
|
250
|
+
## 0.1.2 2016-01-19
|
251
|
+
|
156
252
|
|
157
253
|
### Fixed
|
158
254
|
|
159
255
|
- `xor` returns wrapped results when used against another result-rule (solnic)
|
160
256
|
|
257
|
+
|
161
258
|
[Compare v0.1.1...v0.1.2](https://github.com/dry-rb/dry-logic/compare/v0.1.1...v0.1.2)
|
162
259
|
|
163
|
-
|
260
|
+
## 0.1.1 2016-01-18
|
261
|
+
|
164
262
|
|
165
263
|
### Added
|
166
264
|
|
@@ -168,8 +266,9 @@ This is a partial rewrite focused on internal clean up and major performance imp
|
|
168
266
|
- `Rule::Result` which can be applied to a result object (solnic)
|
169
267
|
- `true?` and `false?` predicates (solnic)
|
170
268
|
|
269
|
+
|
171
270
|
[Compare v0.1.0...v0.1.1](https://github.com/dry-rb/dry-logic/compare/v0.1.0...v0.1.1)
|
172
271
|
|
173
|
-
|
272
|
+
## 0.1.0 2016-01-11
|
174
273
|
|
175
274
|
Code extracted from dry-validation 0.4.1
|
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -1,30 +1,28 @@
|
|
1
1
|
[gem]: https://rubygems.org/gems/dry-logic
|
2
|
-
[
|
3
|
-
[
|
2
|
+
[actions]: https://github.com/dry-rb/dry-logic/actions
|
3
|
+
[codacy]: https://www.codacy.com/gh/dry-rb/dry-logic
|
4
4
|
[chat]: https://dry-rb.zulipchat.com
|
5
5
|
[inchpages]: http://inch-ci.org/github/dry-rb/dry-logic
|
6
6
|
|
7
7
|
# dry-logic [![Join the chat at https://dry-rb.zulipchat.com](https://img.shields.io/badge/dry--rb-join%20chat-%23346b7a.svg)][chat]
|
8
8
|
|
9
9
|
[![Gem Version](https://badge.fury.io/rb/dry-logic.svg)][gem]
|
10
|
-
[![
|
11
|
-
[![
|
12
|
-
[![
|
10
|
+
[![CI Status](https://github.com/dry-rb/dry-logic/workflows/ci/badge.svg)][actions]
|
11
|
+
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/3ac6ea12c2dd42beb36dc3abe63d9606)][codacy]
|
12
|
+
[![Codacy Badge](https://api.codacy.com/project/badge/Coverage/3ac6ea12c2dd42beb36dc3abe63d9606)][codacy]
|
13
13
|
[![Inline docs](http://inch-ci.org/github/dry-rb/dry-logic.svg?branch=master)][inchpages]
|
14
14
|
|
15
|
-
Predicate logic and rule composition used by:
|
16
|
-
|
17
|
-
* [dry-types](https://github.com/dry-rb/dry-types) for constrained types
|
18
|
-
* [dry-schema](https://github.com/dry-rb/dry-schema) and [dry-validation](https://github.com/dry-rb/dry-validation) for composing validation rules
|
19
|
-
* your project...?
|
20
|
-
|
21
15
|
## Links
|
22
16
|
|
23
|
-
* [
|
17
|
+
* [User documentation](http://dry-rb.org/gems/dry-logic)
|
18
|
+
* [API documentation](http://rubydoc.info/gems/dry-logic)
|
19
|
+
|
20
|
+
## Supported Ruby versions
|
24
21
|
|
25
|
-
|
22
|
+
This library officially supports the following Ruby versions:
|
26
23
|
|
27
|
-
|
24
|
+
* MRI >= `2.4`
|
25
|
+
* jruby >= `9.2`
|
28
26
|
|
29
27
|
## License
|
30
28
|
|
data/dry-logic.gemspec
CHANGED
@@ -1,23 +1,38 @@
|
|
1
|
-
|
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/logic/version'
|
2
7
|
|
3
8
|
Gem::Specification.new do |spec|
|
4
9
|
spec.name = 'dry-logic'
|
5
|
-
spec.
|
6
|
-
spec.
|
7
|
-
spec.email = ['piotr.solnica@gmail.com']
|
8
|
-
spec.summary = 'Predicate logic with rule composition'
|
9
|
-
spec.homepage = 'https://github.com/dry-rb/dry-logic'
|
10
|
+
spec.authors = ["Piotr Solnica"]
|
11
|
+
spec.email = ["piotr.solnica@gmail.com"]
|
10
12
|
spec.license = 'MIT'
|
13
|
+
spec.version = Dry::Logic::VERSION.dup
|
11
14
|
|
12
|
-
spec.
|
13
|
-
spec.
|
15
|
+
spec.summary = "Predicate logic with rule composition"
|
16
|
+
spec.description = spec.summary
|
17
|
+
spec.homepage = 'https://dry-rb.org/gems/dry-logic'
|
18
|
+
spec.files = Dir["CHANGELOG.md", "LICENSE", "README.md", "dry-logic.gemspec", "lib/**/*"]
|
19
|
+
spec.bindir = 'bin'
|
20
|
+
spec.executables = []
|
14
21
|
spec.require_paths = ['lib']
|
15
22
|
|
16
|
-
spec.
|
17
|
-
spec.
|
18
|
-
spec.
|
23
|
+
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
|
24
|
+
spec.metadata['changelog_uri'] = 'https://github.com/dry-rb/dry-logic/blob/master/CHANGELOG.md'
|
25
|
+
spec.metadata['source_code_uri'] = 'https://github.com/dry-rb/dry-logic'
|
26
|
+
spec.metadata['bug_tracker_uri'] = 'https://github.com/dry-rb/dry-logic/issues'
|
27
|
+
|
28
|
+
spec.required_ruby_version = ">= 2.4.0"
|
29
|
+
|
30
|
+
# to update dependencies edit project.yml
|
31
|
+
spec.add_runtime_dependency "concurrent-ruby", "~> 1.0"
|
32
|
+
spec.add_runtime_dependency "dry-core", "~> 0.2"
|
33
|
+
spec.add_runtime_dependency "dry-equalizer", "~> 0.2"
|
19
34
|
|
20
|
-
spec.add_development_dependency
|
21
|
-
spec.add_development_dependency
|
22
|
-
spec.add_development_dependency
|
35
|
+
spec.add_development_dependency "bundler"
|
36
|
+
spec.add_development_dependency "rake"
|
37
|
+
spec.add_development_dependency "rspec"
|
23
38
|
end
|
data/lib/dry-logic.rb
CHANGED
data/lib/dry/logic.rb
CHANGED
data/lib/dry/logic/appliable.rb
CHANGED
data/lib/dry/logic/evaluator.rb
CHANGED
data/lib/dry/logic/operations.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'dry/core/constants'
|
2
4
|
require 'dry/equalizer'
|
3
5
|
require 'dry/logic/operators'
|
@@ -24,15 +26,15 @@ module Dry
|
|
24
26
|
end
|
25
27
|
|
26
28
|
def curry(*args)
|
27
|
-
new(rules.map { |rule| rule.curry(*args) }, options)
|
29
|
+
new(rules.map { |rule| rule.curry(*args) }, **options)
|
28
30
|
end
|
29
31
|
|
30
32
|
def new(rules, **new_options)
|
31
|
-
self.class.new(*rules, options
|
33
|
+
self.class.new(*rules, **options, **new_options)
|
32
34
|
end
|
33
35
|
|
34
36
|
def with(new_options)
|
35
|
-
new(rules, options
|
37
|
+
new(rules, **options, **new_options)
|
36
38
|
end
|
37
39
|
|
38
40
|
def to_ast
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'dry/logic/operations/binary'
|
2
4
|
require 'dry/logic/result'
|
3
5
|
|
@@ -7,7 +9,7 @@ module Dry
|
|
7
9
|
class And < Binary
|
8
10
|
attr_reader :hints
|
9
11
|
|
10
|
-
def initialize(
|
12
|
+
def initialize(*, **)
|
11
13
|
super
|
12
14
|
@hints = options.fetch(:hints, true)
|
13
15
|
end
|