dry-logic 1.0.5 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +122 -26
- 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 +4 -3
- data/lib/dry/logic/operations/check.rb +4 -4
- 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 +32 -7
- 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 -31
- 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: 79f9f79ed9b54af39baedaccf40909bc2e126d094481fadef976a41438adbec0
|
4
|
+
data.tar.gz: f636b5cbf5737ef5ca7d4452c38748746fa2f55808012b17d13d1d6fff17e940
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e821f235ba2e2ab4ab94e24a497bb496da3747f9f07ad4bd435bb90362391e0a0f2f620ca2fed1683e42f5149c2006b629105bbe1ddfc5dc9329099ad21b34f
|
7
|
+
data.tar.gz: 0265c634dd84013c9b071258d185dbd52ea8ccdb2960f6db78eaabff6e2c22c08b32dd579217851a4bb130f911db1a882334a765f106e2cf659ff58a3e0ee285
|
data/CHANGELOG.md
CHANGED
@@ -1,16 +1,81 @@
|
|
1
|
-
|
1
|
+
<!--- DO NOT EDIT THIS FILE - IT'S AUTOMATICALLY GENERATED VIA DEVTOOLS --->
|
2
|
+
|
3
|
+
## 1.1.1 2021-04-14
|
4
|
+
|
5
|
+
|
6
|
+
### Fixed
|
7
|
+
|
8
|
+
- Fixed a crash under jruby caused by arg splatting in Binary operations (@flash-gordon)
|
9
|
+
|
10
|
+
|
11
|
+
[Compare v1.1.0...v1.1.1](https://github.com/dry-rb/dry-logic/compare/v1.1.0...v1.1.1)
|
12
|
+
|
13
|
+
## 1.1.0 2020-12-26
|
14
|
+
|
15
|
+
|
16
|
+
### Fixed
|
17
|
+
|
18
|
+
- Nested `Check` operations no longer crash under MRI 3.0 (@oleander)
|
19
|
+
|
20
|
+
### Changed
|
21
|
+
|
22
|
+
- Switched to equalizer from dry-core (@solnic)
|
23
|
+
|
24
|
+
[Compare v1.0.8...v1.1.0](https://github.com/dry-rb/dry-logic/compare/v1.0.8...v1.1.0)
|
25
|
+
|
26
|
+
## 1.0.8 2020-09-28
|
27
|
+
|
28
|
+
|
29
|
+
### Fixed
|
30
|
+
|
31
|
+
- Better Ruby 3 support with fixed specialization for rules of negative arity (@flash-gordon)
|
32
|
+
|
33
|
+
|
34
|
+
[Compare v1.0.7...v1.0.8](https://github.com/dry-rb/dry-logic/compare/v1.0.7...v1.0.8)
|
35
|
+
|
36
|
+
## 1.0.7 2020-08-13
|
37
|
+
|
38
|
+
|
39
|
+
### Added
|
40
|
+
|
41
|
+
- A new `uri?` predicate that you can use to verify `URI` strings, ie `uri?("https", "https://dry-rb.org")` (@nerburish)
|
42
|
+
- New predicates: `uuid_v1?`, `uuid_v2?`, `uuid_v3?` and `uuid_v5?` (via #75) (@jamesbrauman)
|
43
|
+
|
44
|
+
|
45
|
+
[Compare v1.0.6...v1.0.7](https://github.com/dry-rb/dry-logic/compare/v1.0.6...v1.0.7)
|
46
|
+
|
47
|
+
## 1.0.6 2020-02-10
|
48
|
+
|
49
|
+
|
50
|
+
### Fixed
|
51
|
+
|
52
|
+
- Made the regexp used by `uuid_v4?` more secure (@kml)
|
53
|
+
|
54
|
+
|
55
|
+
[Compare v1.0.5...v1.0.6](https://github.com/dry-rb/dry-logic/compare/v1.0.5...v1.0.6)
|
56
|
+
|
57
|
+
## 1.0.5 2019-11-07
|
58
|
+
|
59
|
+
|
60
|
+
### Fixed
|
2
61
|
|
3
62
|
- 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)
|
4
63
|
|
64
|
+
|
5
65
|
[Compare v1.0.4...v1.0.5](https://github.com/dry-rb/dry-logic/compare/v1.0.4...v1.0.5)
|
6
66
|
|
7
|
-
|
67
|
+
## 1.0.4 2019-11-06
|
68
|
+
|
69
|
+
|
70
|
+
### Fixed
|
8
71
|
|
9
72
|
- Fix keyword warnings (@flash-gordon)
|
10
73
|
|
74
|
+
|
11
75
|
[Compare v1.0.3...v1.0.4](https://github.com/dry-rb/dry-logic/compare/v1.0.3...v1.0.4)
|
12
76
|
|
13
|
-
|
77
|
+
## 1.0.3 2019-08-01
|
78
|
+
|
14
79
|
|
15
80
|
### Added
|
16
81
|
|
@@ -24,36 +89,46 @@
|
|
24
89
|
|
25
90
|
[Compare v1.0.2...v1.0.3](https://github.com/dry-rb/dry-logic/compare/v1.0.2...v1.0.3)
|
26
91
|
|
27
|
-
|
92
|
+
## 1.0.2 2019-06-14
|
28
93
|
|
29
94
|
Re-pushed 1.0.1 after dry-schema 1.2.0 release.
|
30
95
|
|
96
|
+
|
31
97
|
[Compare v1.0.1...v1.0.2](https://github.com/dry-rb/dry-logic/compare/v1.0.1...v1.0.2)
|
32
98
|
|
33
|
-
|
99
|
+
## 1.0.1 2019-06-04
|
100
|
+
|
101
|
+
This release was removed from rubygems because it broke dry-schema.
|
34
102
|
|
35
103
|
### Added
|
36
104
|
|
37
105
|
- `uuid_v4?` predicate (radar)
|
38
106
|
- `respond_to?` predicate (waiting-for-dev)
|
39
107
|
|
108
|
+
|
40
109
|
[Compare v1.0.0...v1.0.1](https://github.com/dry-rb/dry-logic/compare/v1.0.0...v1.0.1)
|
41
110
|
|
42
|
-
|
111
|
+
## 1.0.0 2019-04-23
|
43
112
|
|
44
|
-
|
113
|
+
|
114
|
+
### Changed
|
45
115
|
|
46
116
|
- Version bump to `1.0.0` (flash-gordon)
|
47
117
|
|
48
118
|
[Compare v0.6.1...v1.0.0](https://github.com/dry-rb/dry-logic/compare/v0.6.1...v1.0.0)
|
49
119
|
|
50
|
-
|
120
|
+
## 0.6.1 2019-04-18
|
121
|
+
|
122
|
+
|
123
|
+
### Fixed
|
51
124
|
|
52
125
|
- Fix a regression in dry-validation 0.x for argument-less predicates (flash-gordon)
|
53
126
|
|
127
|
+
|
54
128
|
[Compare v0.6.0...v0.6.1](https://github.com/dry-rb/dry-logic/compare/v0.6.0...v0.6.1)
|
55
129
|
|
56
|
-
|
130
|
+
## 0.6.0 2019-04-04
|
131
|
+
|
57
132
|
|
58
133
|
### Added
|
59
134
|
|
@@ -65,7 +140,8 @@ This release was removed from rubygems because it broke dry-schema.
|
|
65
140
|
|
66
141
|
[Compare v0.5.0...v0.6.0](https://github.com/dry-rb/dry-logic/compare/v0.5.0...v0.6.0)
|
67
142
|
|
68
|
-
|
143
|
+
## 0.5.0 2019-01-29
|
144
|
+
|
69
145
|
|
70
146
|
### Added
|
71
147
|
|
@@ -75,9 +151,11 @@ This release was removed from rubygems because it broke dry-schema.
|
|
75
151
|
|
76
152
|
- `Operation::Key#ast` will now return a correct AST with non-Undefined inputs (solnic)
|
77
153
|
|
154
|
+
|
78
155
|
[Compare v0.4.2...v0.5.0](https://github.com/dry-rb/dry-logic/compare/v0.4.2...v0.5.0)
|
79
156
|
|
80
|
-
|
157
|
+
## 0.4.2 2017-09-15
|
158
|
+
|
81
159
|
|
82
160
|
### Added
|
83
161
|
|
@@ -88,21 +166,23 @@ This release was removed from rubygems because it broke dry-schema.
|
|
88
166
|
|
89
167
|
- A bug with using custom predicates within a standalone module in `dry-validation` (flash-gordon)
|
90
168
|
|
91
|
-
[Compare v0.4.1...v0.4.2](https://github.com/dry-rb/dry-logic/compare/v0.4.1...v0.4.2)
|
92
169
|
|
93
|
-
|
170
|
+
[Compare v0.4.1...v0.4.2](https://github.com/dry-rb/dry-logic/compare/v0.4.1...v0.4.2)
|
94
171
|
|
95
|
-
|
172
|
+
## 0.4.1 2017-01-23
|
96
173
|
|
97
|
-
- Predicates simply reuse other predicate methods instead of referring to them via `#[]` (georgemillo)
|
98
174
|
|
99
175
|
### Fixed
|
100
176
|
|
101
177
|
- Warnings on MRI 2.4.0 are gone (jtippett)
|
102
178
|
|
179
|
+
### Changed
|
180
|
+
|
181
|
+
- Predicates simply reuse other predicate methods instead of referring to them via `#[]` (georgemillo)
|
182
|
+
|
103
183
|
[Compare v0.4.0...v0.4.1](https://github.com/dry-rb/dry-logic/compare/v0.4.0...v0.4.1)
|
104
184
|
|
105
|
-
|
185
|
+
## 0.4.0 2016-09-21
|
106
186
|
|
107
187
|
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.
|
108
188
|
|
@@ -130,7 +210,8 @@ This is a partial rewrite focused on internal clean up and major performance imp
|
|
130
210
|
|
131
211
|
[Compare v0.3.0...v0.4.0](https://github.com/dry-rb/dry-logic/compare/v0.3.0...v0.4.0)
|
132
212
|
|
133
|
-
|
213
|
+
## 0.3.0 2016-07-01
|
214
|
+
|
134
215
|
|
135
216
|
### Added
|
136
217
|
|
@@ -145,7 +226,8 @@ This is a partial rewrite focused on internal clean up and major performance imp
|
|
145
226
|
|
146
227
|
[Compare v0.2.3...v0.3.0](https://github.com/dry-rb/dry-logic/compare/v0.2.3...v0.3.0)
|
147
228
|
|
148
|
-
|
229
|
+
## 0.2.3 2016-05-11
|
230
|
+
|
149
231
|
|
150
232
|
### Added
|
151
233
|
|
@@ -158,21 +240,28 @@ This is a partial rewrite focused on internal clean up and major performance imp
|
|
158
240
|
|
159
241
|
[Compare v0.2.2...v0.2.3](https://github.com/dry-rb/dry-logic/compare/v0.2.2...v0.2.3)
|
160
242
|
|
161
|
-
|
243
|
+
## 0.2.2 2016-03-30
|
244
|
+
|
162
245
|
|
163
246
|
### Added
|
164
247
|
|
165
248
|
- `number?`, `odd?`, `even?` predicates (fran-worley)
|
166
249
|
|
250
|
+
|
167
251
|
[Compare v0.2.1...v0.2.2](https://github.com/dry-rb/dry-logic/compare/v0.2.1...v0.2.2)
|
168
252
|
|
169
|
-
|
253
|
+
## 0.2.1 2016-03-20
|
254
|
+
|
170
255
|
|
171
256
|
### Fixed
|
172
257
|
|
173
258
|
- Result AST for `Rule::Each` correctly maps elements with eql inputs (solnic)
|
174
259
|
|
175
|
-
|
260
|
+
|
261
|
+
[Compare v0.2.0...v0.2.1](https://github.com/dry-rb/dry-logic/compare/v0.2.0...v0.2.1)
|
262
|
+
|
263
|
+
## 0.2.0 2016-03-11
|
264
|
+
|
176
265
|
|
177
266
|
### Changed
|
178
267
|
|
@@ -180,16 +269,19 @@ This is a partial rewrite focused on internal clean up and major performance imp
|
|
180
269
|
|
181
270
|
[Compare v0.1.4...v0.2.0](https://github.com/dry-rb/dry-logic/compare/v0.1.4...v0.2.0)
|
182
271
|
|
183
|
-
|
272
|
+
## 0.1.4 2016-01-27
|
273
|
+
|
184
274
|
|
185
275
|
### Added
|
186
276
|
|
187
277
|
- Support for hash-names in `Check` and `Result` which can properly resolve input
|
188
278
|
from nested results (solnic)
|
189
279
|
|
280
|
+
|
190
281
|
[Compare v0.1.3...v0.1.4](https://github.com/dry-rb/dry-logic/compare/v0.1.3...v0.1.4)
|
191
282
|
|
192
|
-
|
283
|
+
## 0.1.3 2016-01-27
|
284
|
+
|
193
285
|
|
194
286
|
### Added
|
195
287
|
|
@@ -201,15 +293,18 @@ This is a partial rewrite focused on internal clean up and major performance imp
|
|
201
293
|
|
202
294
|
[Compare v0.1.2...v0.1.3](https://github.com/dry-rb/dry-logic/compare/v0.1.2...v0.1.3)
|
203
295
|
|
204
|
-
|
296
|
+
## 0.1.2 2016-01-19
|
297
|
+
|
205
298
|
|
206
299
|
### Fixed
|
207
300
|
|
208
301
|
- `xor` returns wrapped results when used against another result-rule (solnic)
|
209
302
|
|
303
|
+
|
210
304
|
[Compare v0.1.1...v0.1.2](https://github.com/dry-rb/dry-logic/compare/v0.1.1...v0.1.2)
|
211
305
|
|
212
|
-
|
306
|
+
## 0.1.1 2016-01-18
|
307
|
+
|
213
308
|
|
214
309
|
### Added
|
215
310
|
|
@@ -217,8 +312,9 @@ This is a partial rewrite focused on internal clean up and major performance imp
|
|
217
312
|
- `Rule::Result` which can be applied to a result object (solnic)
|
218
313
|
- `true?` and `false?` predicates (solnic)
|
219
314
|
|
315
|
+
|
220
316
|
[Compare v0.1.0...v0.1.1](https://github.com/dry-rb/dry-logic/compare/v0.1.0...v0.1.1)
|
221
317
|
|
222
|
-
|
318
|
+
## 0.1.0 2016-01-11
|
223
319
|
|
224
320
|
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"
|