dry-logic 0.4.2 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +214 -53
- data/LICENSE +1 -1
- data/README.md +14 -18
- data/dry-logic.gemspec +28 -15
- data/lib/dry-logic.rb +3 -1
- data/lib/dry/logic.rb +4 -2
- data/lib/dry/logic/appliable.rb +2 -0
- data/lib/dry/logic/evaluator.rb +3 -1
- data/lib/dry/logic/operations.rb +13 -11
- data/lib/dry/logic/operations/abstract.rb +8 -6
- data/lib/dry/logic/operations/and.rb +15 -3
- data/lib/dry/logic/operations/attr.rb +3 -1
- data/lib/dry/logic/operations/binary.rb +3 -1
- data/lib/dry/logic/operations/check.rb +6 -4
- data/lib/dry/logic/operations/each.rb +4 -2
- data/lib/dry/logic/operations/implication.rb +4 -2
- data/lib/dry/logic/operations/key.rb +11 -9
- data/lib/dry/logic/operations/negation.rb +9 -3
- data/lib/dry/logic/operations/or.rb +4 -2
- data/lib/dry/logic/operations/set.rb +5 -3
- data/lib/dry/logic/operations/unary.rb +3 -1
- data/lib/dry/logic/operations/xor.rb +4 -2
- data/lib/dry/logic/operators.rb +6 -4
- data/lib/dry/logic/predicates.rb +72 -28
- data/lib/dry/logic/result.rb +4 -2
- data/lib/dry/logic/rule.rb +35 -30
- data/lib/dry/logic/rule/interface.rb +141 -0
- data/lib/dry/logic/rule/predicate.rb +9 -3
- data/lib/dry/logic/rule_compiler.rb +7 -3
- data/lib/dry/logic/version.rb +3 -1
- metadata +21 -151
- data/.codeclimate.yml +0 -23
- data/.gitignore +0 -8
- data/.rspec +0 -3
- data/.rubocop.yml +0 -16
- data/.rubocop_todo.yml +0 -7
- data/.travis.yml +0 -31
- data/CONTRIBUTING.md +0 -29
- data/Gemfile +0 -18
- data/Rakefile +0 -12
- 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 -67
- data/spec/spec_helper.rb +0 -34
- data/spec/support/mutant.rb +0 -9
- data/spec/unit/operations/and_spec.rb +0 -64
- 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 -119
- data/spec/unit/operations/negation_spec.rb +0 -40
- 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 -141
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
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,145 +1,306 @@
|
|
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
|
57
|
+
|
58
|
+
- Fix keyword warnings (@flash-gordon)
|
59
|
+
|
60
|
+
|
61
|
+
[Compare v1.0.3...v1.0.4](https://github.com/dry-rb/dry-logic/compare/v1.0.3...v1.0.4)
|
62
|
+
|
63
|
+
## 1.0.3 2019-08-01
|
64
|
+
|
65
|
+
|
66
|
+
### Added
|
67
|
+
|
68
|
+
- `bytesize?` predicate (@bmalinconico)
|
69
|
+
- `min_bytesize?` predicate (@bmalinconico)
|
70
|
+
- `max_bytesize? predicate (@bmalinconico)
|
71
|
+
|
72
|
+
### Changed
|
73
|
+
|
74
|
+
- Min ruby version was set to `>= 2.4.0` (@flash-gordon)
|
75
|
+
|
76
|
+
[Compare v1.0.2...v1.0.3](https://github.com/dry-rb/dry-logic/compare/v1.0.2...v1.0.3)
|
77
|
+
|
78
|
+
## 1.0.2 2019-06-14
|
79
|
+
|
80
|
+
Re-pushed 1.0.1 after dry-schema 1.2.0 release.
|
81
|
+
|
82
|
+
|
83
|
+
[Compare v1.0.1...v1.0.2](https://github.com/dry-rb/dry-logic/compare/v1.0.1...v1.0.2)
|
84
|
+
|
85
|
+
## 1.0.1 2019-06-04
|
86
|
+
|
87
|
+
This release was removed from rubygems because it broke dry-schema.
|
2
88
|
|
3
89
|
### Added
|
4
90
|
|
5
|
-
|
6
|
-
|
91
|
+
- `uuid_v4?` predicate (radar)
|
92
|
+
- `respond_to?` predicate (waiting-for-dev)
|
93
|
+
|
94
|
+
|
95
|
+
[Compare v1.0.0...v1.0.1](https://github.com/dry-rb/dry-logic/compare/v1.0.0...v1.0.1)
|
96
|
+
|
97
|
+
## 1.0.0 2019-04-23
|
98
|
+
|
99
|
+
|
100
|
+
### Changed
|
101
|
+
|
102
|
+
- Version bump to `1.0.0` (flash-gordon)
|
103
|
+
|
104
|
+
[Compare v0.6.1...v1.0.0](https://github.com/dry-rb/dry-logic/compare/v0.6.1...v1.0.0)
|
105
|
+
|
106
|
+
## 0.6.1 2019-04-18
|
107
|
+
|
7
108
|
|
8
109
|
### Fixed
|
9
110
|
|
10
|
-
|
111
|
+
- Fix a regression in dry-validation 0.x for argument-less predicates (flash-gordon)
|
112
|
+
|
113
|
+
|
114
|
+
[Compare v0.6.0...v0.6.1](https://github.com/dry-rb/dry-logic/compare/v0.6.0...v0.6.1)
|
115
|
+
|
116
|
+
## 0.6.0 2019-04-04
|
117
|
+
|
11
118
|
|
12
|
-
|
119
|
+
### Added
|
13
120
|
|
14
|
-
|
121
|
+
- Generating hints can be disabled by building `Operations::And` with `hints: false` option set (solnic)
|
15
122
|
|
16
123
|
### Changed
|
17
124
|
|
18
|
-
|
125
|
+
- `Rule` construction has been optimized so that currying and application is multiple-times faster (flash-gordon)
|
126
|
+
|
127
|
+
[Compare v0.5.0...v0.6.0](https://github.com/dry-rb/dry-logic/compare/v0.5.0...v0.6.0)
|
128
|
+
|
129
|
+
## 0.5.0 2019-01-29
|
130
|
+
|
131
|
+
|
132
|
+
### Added
|
133
|
+
|
134
|
+
- `:nil?` predicate (`none?` is now an alias) (solnic)
|
135
|
+
|
136
|
+
### Fixed
|
137
|
+
|
138
|
+
- `Operation::Key#ast` will now return a correct AST with non-Undefined inputs (solnic)
|
139
|
+
|
140
|
+
|
141
|
+
[Compare v0.4.2...v0.5.0](https://github.com/dry-rb/dry-logic/compare/v0.4.2...v0.5.0)
|
142
|
+
|
143
|
+
## 0.4.2 2017-09-15
|
144
|
+
|
145
|
+
|
146
|
+
### Added
|
147
|
+
|
148
|
+
- New `:case?` predicate matches a value against the given object with `#===` (flash-gordon)
|
149
|
+
- New `:is?` predicate checks objects identity (using `#equal?`) (flash-gordon)
|
150
|
+
|
151
|
+
### Fixed
|
152
|
+
|
153
|
+
- A bug with using custom predicates within a standalone module in `dry-validation` (flash-gordon)
|
154
|
+
|
155
|
+
|
156
|
+
[Compare v0.4.1...v0.4.2](https://github.com/dry-rb/dry-logic/compare/v0.4.1...v0.4.2)
|
157
|
+
|
158
|
+
## 0.4.1 2017-01-23
|
159
|
+
|
19
160
|
|
20
161
|
### Fixed
|
21
162
|
|
22
|
-
|
163
|
+
- Warnings on MRI 2.4.0 are gone (jtippett)
|
164
|
+
|
165
|
+
### Changed
|
166
|
+
|
167
|
+
- Predicates simply reuse other predicate methods instead of referring to them via `#[]` (georgemillo)
|
23
168
|
|
24
169
|
[Compare v0.4.0...v0.4.1](https://github.com/dry-rb/dry-logic/compare/v0.4.0...v0.4.1)
|
25
170
|
|
26
|
-
|
171
|
+
## 0.4.0 2016-09-21
|
27
172
|
|
28
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.
|
29
174
|
|
30
175
|
### Added
|
31
176
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
177
|
+
- `Rule#[]` which applies a rule and always returns `true` or `false` (solnic)
|
178
|
+
- `Rule#bind` which returns a rule with its predicate bound to a given object (solnic)
|
179
|
+
- `Rule#eval_args` which evaluates unbound-methods-args in the context of a given object (solnic)
|
180
|
+
- `Logic.Rule` builder function (solnic)
|
181
|
+
- Nice `#inspect` on rules and operation objects (solnic)
|
37
182
|
|
38
183
|
### Changed
|
39
184
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
185
|
+
- [BRAEKING] New result API (solnic)
|
186
|
+
- [BREAKING] `Predicate` is now `Rule::Predicate` (solnic)
|
187
|
+
- [BREAKING] `Rule::Conjunction` is now `Operation::And` (solnic)
|
188
|
+
- [BREAKING] `Rule::Disjunction` is now `Operation::Or` (solnic)
|
189
|
+
- [BREAKING] `Rule::ExlusiveDisjunction` is now `Operation::Xor` (solnic)
|
190
|
+
- [BREAKING] `Rule::Implication` is now `Operation::Implication` (solnic)
|
191
|
+
- [BREAKING] `Rule::Set` is now `Operation::Set` (solnic)
|
192
|
+
- [BREAKING] `Rule::Each` is now `Operation::Each` (solnic)
|
193
|
+
- [BREAKING] `Rule.new` accepts a predicate function as its first arg now (solnic)
|
194
|
+
- [BREAKING] `Rule#name` is now `Rule#id` (solnic)
|
195
|
+
- `Rule#parameters` is public now (solnic)
|
51
196
|
|
52
197
|
[Compare v0.3.0...v0.4.0](https://github.com/dry-rb/dry-logic/compare/v0.3.0...v0.4.0)
|
53
198
|
|
54
|
-
|
199
|
+
## 0.3.0 2016-07-01
|
200
|
+
|
55
201
|
|
56
202
|
### Added
|
57
203
|
|
58
|
-
|
59
|
-
|
204
|
+
- `:type?` predicate imported from dry-types (solnic)
|
205
|
+
- `Rule#curry` interface (solnic)
|
60
206
|
|
61
207
|
### Changed
|
62
208
|
|
63
|
-
|
64
|
-
|
65
|
-
|
209
|
+
- Predicates AST now includes information about args (names & possible values) (fran-worley + solnic)
|
210
|
+
- Predicates raise errors when they are called with invalid arity (fran-worley + solnic)
|
211
|
+
- Rules no longer evaluate input twice when building result objects (solnic)
|
66
212
|
|
67
213
|
[Compare v0.2.3...v0.3.0](https://github.com/dry-rb/dry-logic/compare/v0.2.3...v0.3.0)
|
68
214
|
|
69
|
-
|
215
|
+
## 0.2.3 2016-05-11
|
216
|
+
|
70
217
|
|
71
218
|
### Added
|
72
219
|
|
73
|
-
|
220
|
+
- `not_eql?`, `includes?`, `excludes?` predicates (fran-worley)
|
74
221
|
|
75
222
|
### Changed
|
76
223
|
|
77
|
-
|
78
|
-
|
224
|
+
- Renamed `inclusion?` to `included_in?` and deprecated `inclusion?` (fran-worley)
|
225
|
+
- Renamed `exclusion?` to `excluded_from?` and deprecated `exclusion?` (fran-worley)
|
79
226
|
|
80
227
|
[Compare v0.2.2...v0.2.3](https://github.com/dry-rb/dry-logic/compare/v0.2.2...v0.2.3)
|
81
228
|
|
82
|
-
|
229
|
+
## 0.2.2 2016-03-30
|
230
|
+
|
83
231
|
|
84
232
|
### Added
|
85
233
|
|
86
|
-
|
234
|
+
- `number?`, `odd?`, `even?` predicates (fran-worley)
|
235
|
+
|
87
236
|
|
88
237
|
[Compare v0.2.1...v0.2.2](https://github.com/dry-rb/dry-logic/compare/v0.2.1...v0.2.2)
|
89
238
|
|
90
|
-
|
239
|
+
## 0.2.1 2016-03-20
|
240
|
+
|
91
241
|
|
92
242
|
### Fixed
|
93
243
|
|
94
|
-
|
244
|
+
- Result AST for `Rule::Each` correctly maps elements with eql inputs (solnic)
|
245
|
+
|
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
|
95
250
|
|
96
|
-
# v0.2.0 2016-03-11
|
97
251
|
|
98
252
|
### Changed
|
99
253
|
|
100
|
-
|
254
|
+
- Entire AST has been redefined (solnic)
|
101
255
|
|
102
256
|
[Compare v0.1.4...v0.2.0](https://github.com/dry-rb/dry-logic/compare/v0.1.4...v0.2.0)
|
103
257
|
|
104
|
-
|
258
|
+
## 0.1.4 2016-01-27
|
259
|
+
|
105
260
|
|
106
261
|
### Added
|
107
262
|
|
108
|
-
|
263
|
+
- Support for hash-names in `Check` and `Result` which can properly resolve input
|
109
264
|
from nested results (solnic)
|
110
265
|
|
266
|
+
|
111
267
|
[Compare v0.1.3...v0.1.4](https://github.com/dry-rb/dry-logic/compare/v0.1.3...v0.1.4)
|
112
268
|
|
113
|
-
|
269
|
+
## 0.1.3 2016-01-27
|
270
|
+
|
114
271
|
|
115
272
|
### Added
|
116
273
|
|
117
|
-
|
274
|
+
- Support for resolving input from `Rule::Result` (solnic)
|
118
275
|
|
119
276
|
### Changed
|
120
277
|
|
121
|
-
|
278
|
+
- `Check` and `Result` carry original input(s) (solnic)
|
122
279
|
|
123
280
|
[Compare v0.1.2...v0.1.3](https://github.com/dry-rb/dry-logic/compare/v0.1.2...v0.1.3)
|
124
281
|
|
125
|
-
|
282
|
+
## 0.1.2 2016-01-19
|
283
|
+
|
126
284
|
|
127
285
|
### Fixed
|
128
286
|
|
129
|
-
|
287
|
+
- `xor` returns wrapped results when used against another result-rule (solnic)
|
288
|
+
|
130
289
|
|
131
290
|
[Compare v0.1.1...v0.1.2](https://github.com/dry-rb/dry-logic/compare/v0.1.1...v0.1.2)
|
132
291
|
|
133
|
-
|
292
|
+
## 0.1.1 2016-01-18
|
293
|
+
|
134
294
|
|
135
295
|
### Added
|
136
296
|
|
137
|
-
|
138
|
-
|
139
|
-
|
297
|
+
- `Rule::Attr` which can be applied to a data object with attr readers (SunnyMagadan)
|
298
|
+
- `Rule::Result` which can be applied to a result object (solnic)
|
299
|
+
- `true?` and `false?` predicates (solnic)
|
300
|
+
|
140
301
|
|
141
302
|
[Compare v0.1.0...v0.1.1](https://github.com/dry-rb/dry-logic/compare/v0.1.0...v0.1.1)
|
142
303
|
|
143
|
-
|
304
|
+
## 0.1.0 2016-01-11
|
144
305
|
|
145
306
|
Code extracted from dry-validation 0.4.1
|
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -1,32 +1,28 @@
|
|
1
1
|
[gem]: https://rubygems.org/gems/dry-logic
|
2
|
-
[
|
3
|
-
[
|
4
|
-
[
|
5
|
-
[coveralls]: https://coveralls.io/r/dry-rb/dry-logic
|
2
|
+
[actions]: https://github.com/dry-rb/dry-logic/actions
|
3
|
+
[codacy]: https://www.codacy.com/gh/dry-rb/dry-logic
|
4
|
+
[chat]: https://dry-rb.zulipchat.com
|
6
5
|
[inchpages]: http://inch-ci.org/github/dry-rb/dry-logic
|
7
6
|
|
8
|
-
# dry-logic [![Join the chat at https://
|
7
|
+
# dry-logic [![Join the chat at https://dry-rb.zulipchat.com](https://img.shields.io/badge/dry--rb-join%20chat-%23346b7a.svg)][chat]
|
9
8
|
|
10
9
|
[![Gem Version](https://badge.fury.io/rb/dry-logic.svg)][gem]
|
11
|
-
[![
|
12
|
-
[![
|
13
|
-
[![
|
14
|
-
[![Test Coverage](https://codeclimate.com/github/dry-rb/dry-logic/badges/coverage.svg)][codeclimate]
|
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]
|
15
13
|
[![Inline docs](http://inch-ci.org/github/dry-rb/dry-logic.svg?branch=master)][inchpages]
|
16
14
|
|
17
|
-
Predicate logic and rule composition used by:
|
18
|
-
|
19
|
-
* [dry-types](https://github.com/dry-rb/dry-types) for constrained types
|
20
|
-
* [dry-validation](https://github.com/dry-rb/dry-validation) for composing validation rules
|
21
|
-
* your project...?
|
22
|
-
|
23
15
|
## Links
|
24
16
|
|
25
|
-
* [
|
17
|
+
* [User documentation](http://dry-rb.org/gems/dry-logic)
|
18
|
+
* [API documentation](http://rubydoc.info/gems/dry-logic)
|
19
|
+
|
20
|
+
## Supported Ruby versions
|
26
21
|
|
27
|
-
|
22
|
+
This library officially supports the following Ruby versions:
|
28
23
|
|
29
|
-
|
24
|
+
* MRI >= `2.5`
|
25
|
+
* jruby >= `9.2`
|
30
26
|
|
31
27
|
## License
|
32
28
|
|
data/dry-logic.gemspec
CHANGED
@@ -1,24 +1,37 @@
|
|
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.
|
14
|
-
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 = []
|
15
21
|
spec.require_paths = ['lib']
|
16
22
|
|
17
|
-
spec.
|
18
|
-
spec.
|
19
|
-
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.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"
|
20
33
|
|
21
|
-
spec.add_development_dependency
|
22
|
-
spec.add_development_dependency
|
23
|
-
spec.add_development_dependency
|
34
|
+
spec.add_development_dependency "bundler"
|
35
|
+
spec.add_development_dependency "rake"
|
36
|
+
spec.add_development_dependency "rspec"
|
24
37
|
end
|