dry-logic 1.0.4 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +113 -25
- data/LICENSE +1 -1
- data/README.md +12 -14
- data/dry-logic.gemspec +26 -20
- data/lib/dry-logic.rb +1 -1
- data/lib/dry/logic.rb +2 -2
- data/lib/dry/logic/evaluator.rb +1 -1
- data/lib/dry/logic/operations.rb +11 -11
- data/lib/dry/logic/operations/abstract.rb +3 -3
- data/lib/dry/logic/operations/and.rb +3 -3
- data/lib/dry/logic/operations/attr.rb +1 -1
- data/lib/dry/logic/operations/binary.rb +1 -1
- data/lib/dry/logic/operations/check.rb +3 -3
- data/lib/dry/logic/operations/each.rb +2 -2
- data/lib/dry/logic/operations/implication.rb +2 -2
- data/lib/dry/logic/operations/key.rb +3 -3
- data/lib/dry/logic/operations/negation.rb +2 -2
- data/lib/dry/logic/operations/or.rb +2 -2
- data/lib/dry/logic/operations/set.rb +3 -3
- data/lib/dry/logic/operations/unary.rb +1 -1
- data/lib/dry/logic/operations/xor.rb +2 -2
- data/lib/dry/logic/operators.rb +4 -4
- data/lib/dry/logic/predicates.rb +33 -8
- data/lib/dry/logic/result.rb +2 -2
- data/lib/dry/logic/rule.rb +8 -8
- data/lib/dry/logic/rule/interface.rb +32 -37
- data/lib/dry/logic/rule/predicate.rb +3 -3
- data/lib/dry/logic/rule_compiler.rb +3 -3
- data/lib/dry/logic/version.rb +1 -1
- metadata +17 -166
- data/.codeclimate.yml +0 -12
- data/.github/ISSUE_TEMPLATE/----please-don-t-ask-for-support-via-issues.md +0 -10
- data/.github/ISSUE_TEMPLATE/---bug-report.md +0 -34
- data/.github/ISSUE_TEMPLATE/---feature-request.md +0 -18
- data/.github/workflows/ci.yml +0 -70
- data/.github/workflows/docsite.yml +0 -34
- data/.github/workflows/sync_configs.yml +0 -34
- data/.gitignore +0 -9
- data/.rspec +0 -4
- data/.rubocop.yml +0 -89
- data/CODE_OF_CONDUCT.md +0 -13
- data/CONTRIBUTING.md +0 -29
- data/Gemfile +0 -16
- data/Rakefile +0 -14
- data/benchmarks/rule_application.rb +0 -30
- data/benchmarks/setup.rb +0 -13
- data/bin/console +0 -11
- data/docsite/source/index.html.md +0 -54
- data/docsite/source/operations.html.md +0 -62
- data/docsite/source/predicates.html.md +0 -102
- data/examples/basic.rb +0 -16
- data/spec/integration/result_spec.rb +0 -61
- data/spec/integration/rule_spec.rb +0 -55
- data/spec/shared/predicates.rb +0 -59
- data/spec/shared/rule.rb +0 -74
- data/spec/spec_helper.rb +0 -30
- data/spec/support/mutant.rb +0 -11
- data/spec/unit/operations/and_spec.rb +0 -70
- data/spec/unit/operations/attr_spec.rb +0 -29
- data/spec/unit/operations/check_spec.rb +0 -51
- data/spec/unit/operations/each_spec.rb +0 -49
- data/spec/unit/operations/implication_spec.rb +0 -32
- data/spec/unit/operations/key_spec.rb +0 -135
- data/spec/unit/operations/negation_spec.rb +0 -51
- data/spec/unit/operations/or_spec.rb +0 -75
- data/spec/unit/operations/set_spec.rb +0 -43
- data/spec/unit/operations/xor_spec.rb +0 -63
- data/spec/unit/predicates/array_spec.rb +0 -43
- data/spec/unit/predicates/attr_spec.rb +0 -31
- data/spec/unit/predicates/bool_spec.rb +0 -36
- data/spec/unit/predicates/bytesize_spec.rb +0 -48
- data/spec/unit/predicates/case_spec.rb +0 -35
- data/spec/unit/predicates/date_spec.rb +0 -33
- data/spec/unit/predicates/date_time_spec.rb +0 -33
- data/spec/unit/predicates/decimal_spec.rb +0 -34
- data/spec/unit/predicates/empty_spec.rb +0 -40
- data/spec/unit/predicates/eql_spec.rb +0 -23
- data/spec/unit/predicates/even_spec.rb +0 -33
- data/spec/unit/predicates/excluded_from_spec.rb +0 -37
- data/spec/unit/predicates/excludes_spec.rb +0 -58
- data/spec/unit/predicates/false_spec.rb +0 -37
- data/spec/unit/predicates/filled_spec.rb +0 -40
- data/spec/unit/predicates/float_spec.rb +0 -33
- data/spec/unit/predicates/format_spec.rb +0 -23
- data/spec/unit/predicates/gt_spec.rb +0 -42
- data/spec/unit/predicates/gteq_spec.rb +0 -42
- data/spec/unit/predicates/hash_spec.rb +0 -40
- data/spec/unit/predicates/included_in_spec.rb +0 -37
- data/spec/unit/predicates/includes_spec.rb +0 -24
- data/spec/unit/predicates/int_spec.rb +0 -36
- data/spec/unit/predicates/key_spec.rb +0 -31
- data/spec/unit/predicates/lt_spec.rb +0 -42
- data/spec/unit/predicates/lteq_spec.rb +0 -42
- data/spec/unit/predicates/max_bytesize_spec.rb +0 -39
- data/spec/unit/predicates/max_size_spec.rb +0 -51
- data/spec/unit/predicates/min_bytesize_spec.rb +0 -39
- data/spec/unit/predicates/min_size_spec.rb +0 -51
- data/spec/unit/predicates/none_spec.rb +0 -30
- data/spec/unit/predicates/not_eql_spec.rb +0 -23
- data/spec/unit/predicates/number_spec.rb +0 -39
- data/spec/unit/predicates/odd_spec.rb +0 -33
- data/spec/unit/predicates/respond_to_spec.rb +0 -31
- data/spec/unit/predicates/size_spec.rb +0 -57
- data/spec/unit/predicates/str_spec.rb +0 -34
- data/spec/unit/predicates/time_spec.rb +0 -33
- data/spec/unit/predicates/true_spec.rb +0 -37
- data/spec/unit/predicates/type_spec.rb +0 -37
- data/spec/unit/predicates/uuid_v4_spec.rb +0 -29
- data/spec/unit/predicates_spec.rb +0 -25
- data/spec/unit/rule/predicate_spec.rb +0 -55
- data/spec/unit/rule_compiler_spec.rb +0 -129
- data/spec/unit/rule_spec.rb +0 -213
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35900556fff5ca088cf3f66f319d770c4e15ba1f91a2298a1db096498ea01fb4
|
4
|
+
data.tar.gz: 942707a00d2f4424d2cd737e042877af2b15cf8a621564b463c254b98a72f9df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 37f3b82b384a0b34b51f966665e5b74c7b9834e25a02ca6f096d7bfac4b0de100d023341aeba212ddee1c8b9a1e5a2281c25db6ba66058b9884cc926f95520e1
|
7
|
+
data.tar.gz: 174ec949de041f18c8a8b95b2e8db5c483e949e30be69da09f02032a29d2ee7ff3f823d44269e63b45c8ac201f75c4c1b520a02f2c6fbf6435dd725c729eba72
|
data/CHANGELOG.md
CHANGED
@@ -1,10 +1,67 @@
|
|
1
|
-
|
1
|
+
<!--- DO NOT EDIT THIS FILE - IT'S AUTOMATICALLY GENERATED VIA DEVTOOLS --->
|
2
|
+
|
3
|
+
## 1.1.0 2020-12-26
|
4
|
+
|
5
|
+
|
6
|
+
### Changed
|
7
|
+
|
8
|
+
- Switched to equalizer from dry-core (@solnic)
|
9
|
+
|
10
|
+
[Compare v1.0.8...v1.1.0](https://github.com/dry-rb/dry-logic/compare/v1.0.8...v1.1.0)
|
11
|
+
|
12
|
+
## 1.0.8 2020-09-28
|
13
|
+
|
14
|
+
|
15
|
+
### Fixed
|
16
|
+
|
17
|
+
- Better Ruby 3 support with fixed specialization for rules of negative arity (@flash-gordon)
|
18
|
+
|
19
|
+
|
20
|
+
[Compare v1.0.7...v1.0.8](https://github.com/dry-rb/dry-logic/compare/v1.0.7...v1.0.8)
|
21
|
+
|
22
|
+
## 1.0.7 2020-08-13
|
23
|
+
|
24
|
+
|
25
|
+
### Added
|
26
|
+
|
27
|
+
- A new `uri?` predicate that you can use to verify `URI` strings, ie `uri?("https", "https://dry-rb.org")` (@nerburish)
|
28
|
+
- New predicates: `uuid_v1?`, `uuid_v2?`, `uuid_v3?` and `uuid_v5?` (via #75) (@jamesbrauman)
|
29
|
+
|
30
|
+
|
31
|
+
[Compare v1.0.6...v1.0.7](https://github.com/dry-rb/dry-logic/compare/v1.0.6...v1.0.7)
|
32
|
+
|
33
|
+
## 1.0.6 2020-02-10
|
34
|
+
|
35
|
+
|
36
|
+
### Fixed
|
37
|
+
|
38
|
+
- Made the regexp used by `uuid_v4?` more secure (@kml)
|
39
|
+
|
40
|
+
|
41
|
+
[Compare v1.0.5...v1.0.6](https://github.com/dry-rb/dry-logic/compare/v1.0.5...v1.0.6)
|
42
|
+
|
43
|
+
## 1.0.5 2019-11-07
|
44
|
+
|
45
|
+
|
46
|
+
### Fixed
|
47
|
+
|
48
|
+
- 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)
|
49
|
+
|
50
|
+
|
51
|
+
[Compare v1.0.4...v1.0.5](https://github.com/dry-rb/dry-logic/compare/v1.0.4...v1.0.5)
|
52
|
+
|
53
|
+
## 1.0.4 2019-11-06
|
54
|
+
|
55
|
+
|
56
|
+
### Fixed
|
2
57
|
|
3
58
|
- Fix keyword warnings (@flash-gordon)
|
4
59
|
|
60
|
+
|
5
61
|
[Compare v1.0.3...v1.0.4](https://github.com/dry-rb/dry-logic/compare/v1.0.3...v1.0.4)
|
6
62
|
|
7
|
-
|
63
|
+
## 1.0.3 2019-08-01
|
64
|
+
|
8
65
|
|
9
66
|
### Added
|
10
67
|
|
@@ -18,36 +75,46 @@
|
|
18
75
|
|
19
76
|
[Compare v1.0.2...v1.0.3](https://github.com/dry-rb/dry-logic/compare/v1.0.2...v1.0.3)
|
20
77
|
|
21
|
-
|
78
|
+
## 1.0.2 2019-06-14
|
22
79
|
|
23
80
|
Re-pushed 1.0.1 after dry-schema 1.2.0 release.
|
24
81
|
|
82
|
+
|
25
83
|
[Compare v1.0.1...v1.0.2](https://github.com/dry-rb/dry-logic/compare/v1.0.1...v1.0.2)
|
26
84
|
|
27
|
-
|
85
|
+
## 1.0.1 2019-06-04
|
86
|
+
|
87
|
+
This release was removed from rubygems because it broke dry-schema.
|
28
88
|
|
29
89
|
### Added
|
30
90
|
|
31
91
|
- `uuid_v4?` predicate (radar)
|
32
92
|
- `respond_to?` predicate (waiting-for-dev)
|
33
93
|
|
94
|
+
|
34
95
|
[Compare v1.0.0...v1.0.1](https://github.com/dry-rb/dry-logic/compare/v1.0.0...v1.0.1)
|
35
96
|
|
36
|
-
|
97
|
+
## 1.0.0 2019-04-23
|
98
|
+
|
37
99
|
|
38
|
-
|
100
|
+
### Changed
|
39
101
|
|
40
102
|
- Version bump to `1.0.0` (flash-gordon)
|
41
103
|
|
42
104
|
[Compare v0.6.1...v1.0.0](https://github.com/dry-rb/dry-logic/compare/v0.6.1...v1.0.0)
|
43
105
|
|
44
|
-
|
106
|
+
## 0.6.1 2019-04-18
|
107
|
+
|
108
|
+
|
109
|
+
### Fixed
|
45
110
|
|
46
111
|
- Fix a regression in dry-validation 0.x for argument-less predicates (flash-gordon)
|
47
112
|
|
113
|
+
|
48
114
|
[Compare v0.6.0...v0.6.1](https://github.com/dry-rb/dry-logic/compare/v0.6.0...v0.6.1)
|
49
115
|
|
50
|
-
|
116
|
+
## 0.6.0 2019-04-04
|
117
|
+
|
51
118
|
|
52
119
|
### Added
|
53
120
|
|
@@ -59,7 +126,8 @@ This release was removed from rubygems because it broke dry-schema.
|
|
59
126
|
|
60
127
|
[Compare v0.5.0...v0.6.0](https://github.com/dry-rb/dry-logic/compare/v0.5.0...v0.6.0)
|
61
128
|
|
62
|
-
|
129
|
+
## 0.5.0 2019-01-29
|
130
|
+
|
63
131
|
|
64
132
|
### Added
|
65
133
|
|
@@ -69,9 +137,11 @@ This release was removed from rubygems because it broke dry-schema.
|
|
69
137
|
|
70
138
|
- `Operation::Key#ast` will now return a correct AST with non-Undefined inputs (solnic)
|
71
139
|
|
140
|
+
|
72
141
|
[Compare v0.4.2...v0.5.0](https://github.com/dry-rb/dry-logic/compare/v0.4.2...v0.5.0)
|
73
142
|
|
74
|
-
|
143
|
+
## 0.4.2 2017-09-15
|
144
|
+
|
75
145
|
|
76
146
|
### Added
|
77
147
|
|
@@ -82,21 +152,23 @@ This release was removed from rubygems because it broke dry-schema.
|
|
82
152
|
|
83
153
|
- A bug with using custom predicates within a standalone module in `dry-validation` (flash-gordon)
|
84
154
|
|
155
|
+
|
85
156
|
[Compare v0.4.1...v0.4.2](https://github.com/dry-rb/dry-logic/compare/v0.4.1...v0.4.2)
|
86
157
|
|
87
|
-
|
158
|
+
## 0.4.1 2017-01-23
|
88
159
|
|
89
|
-
### Changed
|
90
|
-
|
91
|
-
- Predicates simply reuse other predicate methods instead of referring to them via `#[]` (georgemillo)
|
92
160
|
|
93
161
|
### Fixed
|
94
162
|
|
95
163
|
- Warnings on MRI 2.4.0 are gone (jtippett)
|
96
164
|
|
165
|
+
### Changed
|
166
|
+
|
167
|
+
- Predicates simply reuse other predicate methods instead of referring to them via `#[]` (georgemillo)
|
168
|
+
|
97
169
|
[Compare v0.4.0...v0.4.1](https://github.com/dry-rb/dry-logic/compare/v0.4.0...v0.4.1)
|
98
170
|
|
99
|
-
|
171
|
+
## 0.4.0 2016-09-21
|
100
172
|
|
101
173
|
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.
|
102
174
|
|
@@ -124,7 +196,8 @@ This is a partial rewrite focused on internal clean up and major performance imp
|
|
124
196
|
|
125
197
|
[Compare v0.3.0...v0.4.0](https://github.com/dry-rb/dry-logic/compare/v0.3.0...v0.4.0)
|
126
198
|
|
127
|
-
|
199
|
+
## 0.3.0 2016-07-01
|
200
|
+
|
128
201
|
|
129
202
|
### Added
|
130
203
|
|
@@ -139,7 +212,8 @@ This is a partial rewrite focused on internal clean up and major performance imp
|
|
139
212
|
|
140
213
|
[Compare v0.2.3...v0.3.0](https://github.com/dry-rb/dry-logic/compare/v0.2.3...v0.3.0)
|
141
214
|
|
142
|
-
|
215
|
+
## 0.2.3 2016-05-11
|
216
|
+
|
143
217
|
|
144
218
|
### Added
|
145
219
|
|
@@ -152,21 +226,28 @@ This is a partial rewrite focused on internal clean up and major performance imp
|
|
152
226
|
|
153
227
|
[Compare v0.2.2...v0.2.3](https://github.com/dry-rb/dry-logic/compare/v0.2.2...v0.2.3)
|
154
228
|
|
155
|
-
|
229
|
+
## 0.2.2 2016-03-30
|
230
|
+
|
156
231
|
|
157
232
|
### Added
|
158
233
|
|
159
234
|
- `number?`, `odd?`, `even?` predicates (fran-worley)
|
160
235
|
|
236
|
+
|
161
237
|
[Compare v0.2.1...v0.2.2](https://github.com/dry-rb/dry-logic/compare/v0.2.1...v0.2.2)
|
162
238
|
|
163
|
-
|
239
|
+
## 0.2.1 2016-03-20
|
240
|
+
|
164
241
|
|
165
242
|
### Fixed
|
166
243
|
|
167
244
|
- Result AST for `Rule::Each` correctly maps elements with eql inputs (solnic)
|
168
245
|
|
169
|
-
|
246
|
+
|
247
|
+
[Compare v0.2.0...v0.2.1](https://github.com/dry-rb/dry-logic/compare/v0.2.0...v0.2.1)
|
248
|
+
|
249
|
+
## 0.2.0 2016-03-11
|
250
|
+
|
170
251
|
|
171
252
|
### Changed
|
172
253
|
|
@@ -174,16 +255,19 @@ This is a partial rewrite focused on internal clean up and major performance imp
|
|
174
255
|
|
175
256
|
[Compare v0.1.4...v0.2.0](https://github.com/dry-rb/dry-logic/compare/v0.1.4...v0.2.0)
|
176
257
|
|
177
|
-
|
258
|
+
## 0.1.4 2016-01-27
|
259
|
+
|
178
260
|
|
179
261
|
### Added
|
180
262
|
|
181
263
|
- Support for hash-names in `Check` and `Result` which can properly resolve input
|
182
264
|
from nested results (solnic)
|
183
265
|
|
266
|
+
|
184
267
|
[Compare v0.1.3...v0.1.4](https://github.com/dry-rb/dry-logic/compare/v0.1.3...v0.1.4)
|
185
268
|
|
186
|
-
|
269
|
+
## 0.1.3 2016-01-27
|
270
|
+
|
187
271
|
|
188
272
|
### Added
|
189
273
|
|
@@ -195,15 +279,18 @@ This is a partial rewrite focused on internal clean up and major performance imp
|
|
195
279
|
|
196
280
|
[Compare v0.1.2...v0.1.3](https://github.com/dry-rb/dry-logic/compare/v0.1.2...v0.1.3)
|
197
281
|
|
198
|
-
|
282
|
+
## 0.1.2 2016-01-19
|
283
|
+
|
199
284
|
|
200
285
|
### Fixed
|
201
286
|
|
202
287
|
- `xor` returns wrapped results when used against another result-rule (solnic)
|
203
288
|
|
289
|
+
|
204
290
|
[Compare v0.1.1...v0.1.2](https://github.com/dry-rb/dry-logic/compare/v0.1.1...v0.1.2)
|
205
291
|
|
206
|
-
|
292
|
+
## 0.1.1 2016-01-18
|
293
|
+
|
207
294
|
|
208
295
|
### Added
|
209
296
|
|
@@ -211,8 +298,9 @@ This is a partial rewrite focused on internal clean up and major performance imp
|
|
211
298
|
- `Rule::Result` which can be applied to a result object (solnic)
|
212
299
|
- `true?` and `false?` predicates (solnic)
|
213
300
|
|
301
|
+
|
214
302
|
[Compare v0.1.0...v0.1.1](https://github.com/dry-rb/dry-logic/compare/v0.1.0...v0.1.1)
|
215
303
|
|
216
|
-
|
304
|
+
## 0.1.0 2016-01-11
|
217
305
|
|
218
306
|
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.5`
|
25
|
+
* jruby >= `9.2`
|
28
26
|
|
29
27
|
## License
|
30
28
|
|
data/dry-logic.gemspec
CHANGED
@@ -1,31 +1,37 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
# this file is managed by dry-rb/devtools project
|
2
3
|
|
3
|
-
|
4
|
+
lib = File.expand_path('lib', __dir__)
|
5
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
6
|
+
require 'dry/logic/version'
|
4
7
|
|
5
8
|
Gem::Specification.new do |spec|
|
6
9
|
spec.name = 'dry-logic'
|
7
|
-
spec.
|
8
|
-
spec.
|
9
|
-
spec.email = ['piotr.solnica@gmail.com']
|
10
|
-
spec.summary = 'Predicate logic with rule composition'
|
11
|
-
spec.homepage = 'https://github.com/dry-rb/dry-logic'
|
10
|
+
spec.authors = ["Piotr Solnica"]
|
11
|
+
spec.email = ["piotr.solnica@gmail.com"]
|
12
12
|
spec.license = 'MIT'
|
13
|
+
spec.version = Dry::Logic::VERSION.dup
|
13
14
|
|
14
|
-
spec.
|
15
|
-
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 = []
|
16
21
|
spec.require_paths = ['lib']
|
17
|
-
spec.required_ruby_version = '>= 2.4.0'
|
18
|
-
|
19
|
-
spec.metadata = {
|
20
|
-
'source_code_uri' => 'https://github.com/dry-rb/dry-logic',
|
21
|
-
'changelog_uri' => 'https://github.com/dry-rb/dry-logic/blob/master/CHANGELOG.md'
|
22
|
-
}
|
23
22
|
|
24
|
-
spec.
|
25
|
-
spec.
|
26
|
-
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
27
|
|
28
|
-
spec.
|
29
|
-
|
30
|
-
|
28
|
+
spec.required_ruby_version = ">= 2.5.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.5", ">= 0.5"
|
33
|
+
|
34
|
+
spec.add_development_dependency "bundler"
|
35
|
+
spec.add_development_dependency "rake"
|
36
|
+
spec.add_development_dependency "rspec"
|
31
37
|
end
|
data/lib/dry-logic.rb
CHANGED
data/lib/dry/logic.rb
CHANGED
data/lib/dry/logic/evaluator.rb
CHANGED
data/lib/dry/logic/operations.rb
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
5
|
-
require
|
6
|
-
require
|
7
|
-
require
|
3
|
+
require "dry/logic/operations/and"
|
4
|
+
require "dry/logic/operations/or"
|
5
|
+
require "dry/logic/operations/xor"
|
6
|
+
require "dry/logic/operations/implication"
|
7
|
+
require "dry/logic/operations/negation"
|
8
8
|
|
9
|
-
require
|
10
|
-
require
|
11
|
-
require
|
12
|
-
require
|
13
|
-
require
|
9
|
+
require "dry/logic/operations/key"
|
10
|
+
require "dry/logic/operations/attr"
|
11
|
+
require "dry/logic/operations/each"
|
12
|
+
require "dry/logic/operations/set"
|
13
|
+
require "dry/logic/operations/check"
|
14
14
|
|
15
|
-
require
|
15
|
+
require "dry/logic/operators"
|