dry-logic 1.6.0 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +162 -174
- data/LICENSE +1 -1
- data/README.md +13 -13
- data/dry-logic.gemspec +17 -13
- data/lib/dry/logic/predicates.rb +4 -3
- data/lib/dry/logic/version.rb +1 -1
- metadata +54 -13
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 92f4229d57362a22f58cce16cf8b0f14199367c38d22941b83c0be0570b3369a
|
|
4
|
+
data.tar.gz: adfc35267a0567f76dc63d8f0a8909de82421a3d1d51d0c4f7a9cc21ef228cc4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 05b5f61f82fbac6bd701dafb2f3f13730223801764041fbb0a1deb8b9f73bb8517cc24cbf7bb234d2179fb766a3c02799b6384b41efcc2ff4d4bc03af48f8f82
|
|
7
|
+
data.tar.gz: e5bbc3b729c76d9dfcc4324c21c99c993d4c7aa4563b21314d928cadc2b4bf777fd3605abd64771d9b7f5576a845457254b4bbc69eb02db3adeea0711e6f7bc9
|
data/CHANGELOG.md
CHANGED
|
@@ -1,375 +1,363 @@
|
|
|
1
|
-
|
|
1
|
+
# Changelog
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Break Versioning](https://www.taoensso.com/break-versioning).
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
## [Unreleased]
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
### Added
|
|
9
10
|
|
|
10
11
|
### Changed
|
|
11
12
|
|
|
12
|
-
- Set
|
|
13
|
+
- Set minimum Ruby version to 3.3.
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
### Deprecated
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
### Removed
|
|
17
18
|
|
|
19
|
+
### Fixed
|
|
18
20
|
|
|
19
|
-
###
|
|
20
|
-
|
|
21
|
-
- `uri_rfc3986?` predicate that uses a better regexp than `uri?` (see #94 for more details) (@hieuk09)
|
|
22
|
-
|
|
23
|
-
### Changed
|
|
24
|
-
|
|
25
|
-
- Made `Predicates.respond_to?` compatible with `Object#respond_to?` (via #105) (@solnic)
|
|
26
|
-
- Made `Predicates.eql?` compatible with `Object#eql?` (via #106) (@solnic)
|
|
21
|
+
### Security
|
|
27
22
|
|
|
28
|
-
[
|
|
23
|
+
[Unreleased]: https://github.com/dry-rb/dry-logic/compare/v1.6.1...main
|
|
29
24
|
|
|
30
|
-
## 1.
|
|
25
|
+
## [1.6.1] - 2026-11-24
|
|
31
26
|
|
|
27
|
+
### Security
|
|
32
28
|
|
|
33
|
-
|
|
29
|
+
- Make the `uri?` predicate match only when the whole input is a URI with a permitted scheme. Previously it matched any input that contained one, such as `javascript:alert(1)//https://example.com`. (@parndt in GHSA-88x6-8wr7-j6gp)
|
|
34
30
|
|
|
35
|
-
|
|
31
|
+
[1.6.1]: https://github.com/dry-rb/dry-logic/compare/v1.6.0...v1.6.1
|
|
36
32
|
|
|
37
|
-
[
|
|
33
|
+
## [1.6.0] - 2025-01-04
|
|
38
34
|
|
|
39
|
-
|
|
35
|
+
### Added
|
|
40
36
|
|
|
37
|
+
- Support for more UUID formats. (@Ptico in #110)
|
|
41
38
|
|
|
42
39
|
### Changed
|
|
43
40
|
|
|
44
|
-
-
|
|
41
|
+
- Set 3.1 as minimum ruby version. (@flash-gordon)
|
|
45
42
|
|
|
46
|
-
|
|
43
|
+
### Fixed
|
|
47
44
|
|
|
48
|
-
|
|
45
|
+
- Fix NoMethodError when trying to get AST of a Builder's result. (@estum in #107)
|
|
49
46
|
|
|
47
|
+
[1.6.0]: https://github.com/dry-rb/dry-logic/compare/v1.5.0...v1.6.0
|
|
50
48
|
|
|
51
|
-
|
|
49
|
+
## [1.5.0] - 2022-11-24
|
|
52
50
|
|
|
53
|
-
|
|
51
|
+
### Added
|
|
54
52
|
|
|
53
|
+
- `uri_rfc3986?` predicate that uses a better regexp than `uri?`. (@hieuk09 in #94)
|
|
55
54
|
|
|
56
|
-
|
|
55
|
+
### Changed
|
|
57
56
|
|
|
58
|
-
|
|
57
|
+
- Made `Predicates.respond_to?` compatible with `Object#respond_to?`. (@solnic in #105)
|
|
58
|
+
- Made `Predicates.eql?` compatible with `Object#eql?`. (@solnic in #106)
|
|
59
59
|
|
|
60
|
+
[1.5.0]: https://github.com/dry-rb/dry-logic/compare/v1.4.0...v1.5.0
|
|
60
61
|
|
|
61
|
-
|
|
62
|
+
## [1.4.0] - 2022-11-04
|
|
62
63
|
|
|
63
|
-
|
|
64
|
+
### Changed
|
|
64
65
|
|
|
66
|
+
- Updated to dry-core 1.0. (@flash-gordon and @solnic)
|
|
65
67
|
|
|
66
|
-
[
|
|
68
|
+
[1.4.0]: https://github.com/dry-rb/dry-logic/compare/v1.3.0...v1.4.0
|
|
67
69
|
|
|
68
|
-
## 1.
|
|
70
|
+
## [1.3.0] - 2022-10-15
|
|
69
71
|
|
|
72
|
+
### Changed
|
|
70
73
|
|
|
71
|
-
|
|
74
|
+
- Use zeitwerk for auto-loading. (@solnic and @flash-gordon)
|
|
72
75
|
|
|
73
|
-
-
|
|
76
|
+
[1.3.0]: https://github.com/dry-rb/dry-logic/compare/v1.2.0...v1.3.0
|
|
74
77
|
|
|
75
|
-
|
|
78
|
+
## [1.2.0] - 2021-04-26
|
|
76
79
|
|
|
77
|
-
|
|
80
|
+
### Added
|
|
78
81
|
|
|
79
|
-
|
|
82
|
+
- Add predicate and operation builder DSL. (@oleander)
|
|
80
83
|
|
|
81
|
-
|
|
84
|
+
[1.2.0]: https://github.com/dry-rb/dry-logic/compare/v1.1.1...v1.2.0
|
|
82
85
|
|
|
86
|
+
## [1.1.1] - 2021-04-14
|
|
83
87
|
|
|
84
88
|
### Fixed
|
|
85
89
|
|
|
86
|
-
-
|
|
90
|
+
- Fixed a crash under jruby caused by arg splatting in Binary operations. (@flash-gordon)
|
|
87
91
|
|
|
92
|
+
[1.1.1]: https://github.com/dry-rb/dry-logic/compare/v1.1.0...v1.1.1
|
|
88
93
|
|
|
89
|
-
[
|
|
94
|
+
## [1.1.0] - 2020-12-26
|
|
90
95
|
|
|
91
|
-
|
|
96
|
+
### Changed
|
|
92
97
|
|
|
98
|
+
- Switched to equalizer from dry-core. (@solnic)
|
|
93
99
|
|
|
94
|
-
###
|
|
100
|
+
### Fixed
|
|
95
101
|
|
|
96
|
-
-
|
|
97
|
-
- New predicates: `uuid_v1?`, `uuid_v2?`, `uuid_v3?` and `uuid_v5?` (via #75) (@jamesbrauman)
|
|
102
|
+
- Nested `Check` operations no longer crash under MRI 3.0. (@oleander)
|
|
98
103
|
|
|
104
|
+
[1.1.0]: https://github.com/dry-rb/dry-logic/compare/v1.0.8...v1.1.0
|
|
99
105
|
|
|
100
|
-
[
|
|
106
|
+
## [1.0.8] - 2020-09-28
|
|
101
107
|
|
|
102
|
-
|
|
108
|
+
### Fixed
|
|
103
109
|
|
|
110
|
+
- Better Ruby 3 support with fixed specialization for rules of negative arity. (@flash-gordon)
|
|
104
111
|
|
|
105
|
-
|
|
112
|
+
[1.0.8]: https://github.com/dry-rb/dry-logic/compare/v1.0.7...v1.0.8
|
|
106
113
|
|
|
107
|
-
|
|
114
|
+
## [1.0.7] - 2020-08-13
|
|
108
115
|
|
|
116
|
+
### Added
|
|
109
117
|
|
|
110
|
-
|
|
118
|
+
- A new `uri?` predicate that you can use to verify `URI` strings, ie `uri?("https", "https://dry-rb.org")`. (@nerburish)
|
|
119
|
+
- New predicates: `uuid_v1?`, `uuid_v2?`, `uuid_v3?` and `uuid_v5?`. (@jamesbrauman in #75)
|
|
111
120
|
|
|
112
|
-
|
|
121
|
+
[1.0.7]: https://github.com/dry-rb/dry-logic/compare/v1.0.6...v1.0.7
|
|
113
122
|
|
|
123
|
+
## [1.0.6] - 2020-02-10
|
|
114
124
|
|
|
115
125
|
### Fixed
|
|
116
126
|
|
|
117
|
-
-
|
|
127
|
+
- Made the regexp used by `uuid_v4?` more secure. (@kml)
|
|
118
128
|
|
|
129
|
+
[1.0.6]: https://github.com/dry-rb/dry-logic/compare/v1.0.5...v1.0.6
|
|
119
130
|
|
|
120
|
-
[
|
|
131
|
+
## [1.0.5] - 2019-11-07
|
|
121
132
|
|
|
122
|
-
|
|
133
|
+
### Fixed
|
|
123
134
|
|
|
135
|
+
- 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)
|
|
124
136
|
|
|
125
|
-
|
|
137
|
+
[1.0.5]: https://github.com/dry-rb/dry-logic/compare/v1.0.4...v1.0.5
|
|
126
138
|
|
|
127
|
-
|
|
139
|
+
## [1.0.4] - 2019-11-06
|
|
128
140
|
|
|
141
|
+
### Fixed
|
|
129
142
|
|
|
130
|
-
|
|
143
|
+
- Fix keyword warnings. (@flash-gordon)
|
|
131
144
|
|
|
132
|
-
|
|
145
|
+
[1.0.4]: https://github.com/dry-rb/dry-logic/compare/v1.0.3...v1.0.4
|
|
133
146
|
|
|
147
|
+
## [1.0.3] - 2019-08-01
|
|
134
148
|
|
|
135
149
|
### Added
|
|
136
150
|
|
|
137
|
-
- `bytesize?` predicate (@bmalinconico)
|
|
138
|
-
- `min_bytesize?` predicate (@bmalinconico)
|
|
139
|
-
- `max_bytesize
|
|
151
|
+
- `bytesize?` predicate. (@bmalinconico)
|
|
152
|
+
- `min_bytesize?` predicate. (@bmalinconico)
|
|
153
|
+
- `max_bytesize?` predicate. (@bmalinconico)
|
|
140
154
|
|
|
141
155
|
### Changed
|
|
142
156
|
|
|
143
|
-
- Min ruby version was set to `>= 2.4.0
|
|
157
|
+
- Min ruby version was set to `>= 2.4.0`. (@flash-gordon)
|
|
144
158
|
|
|
145
|
-
[
|
|
159
|
+
[1.0.3]: https://github.com/dry-rb/dry-logic/compare/v1.0.2...v1.0.3
|
|
146
160
|
|
|
147
|
-
## 1.0.2 2019-06-14
|
|
161
|
+
## [1.0.2] - 2019-06-14
|
|
148
162
|
|
|
149
163
|
Re-pushed 1.0.1 after dry-schema 1.2.0 release.
|
|
150
164
|
|
|
165
|
+
[1.0.2]: https://github.com/dry-rb/dry-logic/compare/v1.0.1...v1.0.2
|
|
151
166
|
|
|
152
|
-
[
|
|
153
|
-
|
|
154
|
-
## 1.0.1 2019-06-04
|
|
167
|
+
## [1.0.1] - 2019-06-04
|
|
155
168
|
|
|
156
169
|
This release was removed from rubygems because it broke dry-schema.
|
|
157
170
|
|
|
158
171
|
### Added
|
|
159
172
|
|
|
160
|
-
- `uuid_v4?` predicate (radar)
|
|
161
|
-
- `respond_to?` predicate (waiting-for-dev)
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
[Compare v1.0.0...v1.0.1](https://github.com/dry-rb/dry-logic/compare/v1.0.0...v1.0.1)
|
|
173
|
+
- `uuid_v4?` predicate. (@radar)
|
|
174
|
+
- `respond_to?` predicate. (@waiting-for-dev)
|
|
165
175
|
|
|
166
|
-
|
|
176
|
+
[1.0.1]: https://github.com/dry-rb/dry-logic/compare/v1.0.0...v1.0.1
|
|
167
177
|
|
|
178
|
+
## [1.0.0] - 2019-04-23
|
|
168
179
|
|
|
169
180
|
### Changed
|
|
170
181
|
|
|
171
|
-
- Version bump to `1.0.0
|
|
182
|
+
- Version bump to `1.0.0`. (@flash-gordon)
|
|
172
183
|
|
|
173
|
-
[
|
|
174
|
-
|
|
175
|
-
## 0.6.1 2019-04-18
|
|
184
|
+
[1.0.0]: https://github.com/dry-rb/dry-logic/compare/v0.6.1...v1.0.0
|
|
176
185
|
|
|
186
|
+
## [0.6.1] - 2019-04-18
|
|
177
187
|
|
|
178
188
|
### Fixed
|
|
179
189
|
|
|
180
|
-
- Fix a regression in dry-validation 0.x for argument-less predicates (flash-gordon)
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
[Compare v0.6.0...v0.6.1](https://github.com/dry-rb/dry-logic/compare/v0.6.0...v0.6.1)
|
|
190
|
+
- Fix a regression in dry-validation 0.x for argument-less predicates. (@flash-gordon)
|
|
184
191
|
|
|
185
|
-
|
|
192
|
+
[0.6.1]: https://github.com/dry-rb/dry-logic/compare/v0.6.0...v0.6.1
|
|
186
193
|
|
|
194
|
+
## [0.6.0] - 2019-04-04
|
|
187
195
|
|
|
188
196
|
### Added
|
|
189
197
|
|
|
190
|
-
- Generating hints can be disabled by building `Operations::And` with `hints: false` option set (solnic)
|
|
198
|
+
- Generating hints can be disabled by building `Operations::And` with `hints: false` option set. (@solnic)
|
|
191
199
|
|
|
192
200
|
### Changed
|
|
193
201
|
|
|
194
|
-
- `Rule` construction has been optimized so that currying and application is multiple-times faster (flash-gordon)
|
|
202
|
+
- `Rule` construction has been optimized so that currying and application is multiple-times faster. (@flash-gordon)
|
|
195
203
|
|
|
196
|
-
[
|
|
197
|
-
|
|
198
|
-
## 0.5.0 2019-01-29
|
|
204
|
+
[0.6.0]: https://github.com/dry-rb/dry-logic/compare/v0.5.0...v0.6.0
|
|
199
205
|
|
|
206
|
+
## [0.5.0] - 2019-01-29
|
|
200
207
|
|
|
201
208
|
### Added
|
|
202
209
|
|
|
203
|
-
- `:nil?` predicate (`none?` is now an alias) (solnic)
|
|
210
|
+
- `:nil?` predicate (`none?` is now an alias). (@solnic)
|
|
204
211
|
|
|
205
212
|
### Fixed
|
|
206
213
|
|
|
207
|
-
- `Operation::Key#ast` will now return a correct AST with non-Undefined inputs (solnic)
|
|
208
|
-
|
|
214
|
+
- `Operation::Key#ast` will now return a correct AST with non-Undefined inputs. (@solnic)
|
|
209
215
|
|
|
210
|
-
[
|
|
211
|
-
|
|
212
|
-
## 0.4.2 2017-09-15
|
|
216
|
+
[0.5.0]: https://github.com/dry-rb/dry-logic/compare/v0.4.2...v0.5.0
|
|
213
217
|
|
|
218
|
+
## [0.4.2] - 2017-09-15
|
|
214
219
|
|
|
215
220
|
### Added
|
|
216
221
|
|
|
217
|
-
- New `:case?` predicate matches a value against the given object with
|
|
218
|
-
- New `:is?` predicate checks objects identity (using `#equal?`) (flash-gordon)
|
|
222
|
+
- New `:case?` predicate matches a value against the given object with `#===`. (@flash-gordon)
|
|
223
|
+
- New `:is?` predicate checks objects identity (using `#equal?`). (@flash-gordon)
|
|
219
224
|
|
|
220
225
|
### Fixed
|
|
221
226
|
|
|
222
|
-
- A bug with using custom predicates within a standalone module in `dry-validation
|
|
227
|
+
- A bug with using custom predicates within a standalone module in `dry-validation`. (@flash-gordon)
|
|
223
228
|
|
|
229
|
+
[0.4.2]: https://github.com/dry-rb/dry-logic/compare/v0.4.1...v0.4.2
|
|
224
230
|
|
|
225
|
-
[
|
|
231
|
+
## [0.4.1] - 2017-01-23
|
|
226
232
|
|
|
227
|
-
|
|
233
|
+
### Changed
|
|
228
234
|
|
|
235
|
+
- Predicates simply reuse other predicate methods instead of referring to them via `#[]`. (@georgemillo)
|
|
229
236
|
|
|
230
237
|
### Fixed
|
|
231
238
|
|
|
232
|
-
- Warnings on MRI 2.4.0 are gone (jtippett)
|
|
233
|
-
|
|
234
|
-
### Changed
|
|
235
|
-
|
|
236
|
-
- Predicates simply reuse other predicate methods instead of referring to them via `#[]` (georgemillo)
|
|
239
|
+
- Warnings on MRI 2.4.0 are gone. (@jtippett)
|
|
237
240
|
|
|
238
|
-
[
|
|
241
|
+
[0.4.1]: https://github.com/dry-rb/dry-logic/compare/v0.4.0...v0.4.1
|
|
239
242
|
|
|
240
|
-
## 0.4.0 2016-09-21
|
|
243
|
+
## [0.4.0] - 2016-09-21
|
|
241
244
|
|
|
242
245
|
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.
|
|
243
246
|
|
|
244
247
|
### Added
|
|
245
248
|
|
|
246
|
-
- `Rule#[]` which applies a rule and always returns `true` or `false
|
|
247
|
-
- `Rule#bind` which returns a rule with its predicate bound to a given object (solnic)
|
|
248
|
-
- `Rule#eval_args` which evaluates unbound-methods-args in the context of a given object (solnic)
|
|
249
|
-
- `Logic.Rule` builder function (solnic)
|
|
250
|
-
- Nice `#inspect` on rules and operation objects (solnic)
|
|
249
|
+
- `Rule#[]` which applies a rule and always returns `true` or `false`. (@solnic)
|
|
250
|
+
- `Rule#bind` which returns a rule with its predicate bound to a given object. (@solnic)
|
|
251
|
+
- `Rule#eval_args` which evaluates unbound-methods-args in the context of a given object. (@solnic)
|
|
252
|
+
- `Logic.Rule` builder function. (@solnic)
|
|
253
|
+
- Nice `#inspect` on rules and operation objects. (@solnic)
|
|
251
254
|
|
|
252
255
|
### Changed
|
|
253
256
|
|
|
254
|
-
- [
|
|
255
|
-
- [BREAKING] `Predicate` is now `Rule::Predicate
|
|
256
|
-
- [BREAKING] `Rule::Conjunction` is now `Operation::And
|
|
257
|
-
- [BREAKING] `Rule::Disjunction` is now `Operation::Or
|
|
258
|
-
- [BREAKING] `Rule::ExlusiveDisjunction` is now `Operation::Xor
|
|
259
|
-
- [BREAKING] `Rule::Implication` is now `Operation::Implication
|
|
260
|
-
- [BREAKING] `Rule::Set` is now `Operation::Set
|
|
261
|
-
- [BREAKING] `Rule::Each` is now `Operation::Each
|
|
262
|
-
- [BREAKING] `Rule.new` accepts a predicate function as its first arg now (solnic)
|
|
263
|
-
- [BREAKING] `Rule#name` is now `Rule#id
|
|
264
|
-
- `Rule#parameters` is public now (solnic)
|
|
257
|
+
- [BREAKING] New result API. (@solnic)
|
|
258
|
+
- [BREAKING] `Predicate` is now `Rule::Predicate`. (@solnic)
|
|
259
|
+
- [BREAKING] `Rule::Conjunction` is now `Operation::And`. (@solnic)
|
|
260
|
+
- [BREAKING] `Rule::Disjunction` is now `Operation::Or`. (@solnic)
|
|
261
|
+
- [BREAKING] `Rule::ExlusiveDisjunction` is now `Operation::Xor`. (@solnic)
|
|
262
|
+
- [BREAKING] `Rule::Implication` is now `Operation::Implication`. (@solnic)
|
|
263
|
+
- [BREAKING] `Rule::Set` is now `Operation::Set`. (@solnic)
|
|
264
|
+
- [BREAKING] `Rule::Each` is now `Operation::Each`. (@solnic)
|
|
265
|
+
- [BREAKING] `Rule.new` accepts a predicate function as its first arg now. (@solnic)
|
|
266
|
+
- [BREAKING] `Rule#name` is now `Rule#id`. (@solnic)
|
|
267
|
+
- `Rule#parameters` is public now. (@solnic)
|
|
265
268
|
|
|
266
|
-
[
|
|
267
|
-
|
|
268
|
-
## 0.3.0 2016-07-01
|
|
269
|
+
[0.4.0]: https://github.com/dry-rb/dry-logic/compare/v0.3.0...v0.4.0
|
|
269
270
|
|
|
271
|
+
## [0.3.0] - 2016-07-01
|
|
270
272
|
|
|
271
273
|
### Added
|
|
272
274
|
|
|
273
|
-
- `:type?` predicate imported from dry-types (solnic)
|
|
274
|
-
- `Rule#curry` interface (solnic)
|
|
275
|
+
- `:type?` predicate imported from dry-types. (@solnic)
|
|
276
|
+
- `Rule#curry` interface. (@solnic)
|
|
275
277
|
|
|
276
278
|
### Changed
|
|
277
279
|
|
|
278
|
-
- Predicates AST now includes information about args (names & possible values) (fran-worley
|
|
279
|
-
- Predicates raise errors when they are called with invalid arity (fran-worley
|
|
280
|
-
- Rules no longer evaluate input twice when building result objects (solnic)
|
|
281
|
-
|
|
282
|
-
[Compare v0.2.3...v0.3.0](https://github.com/dry-rb/dry-logic/compare/v0.2.3...v0.3.0)
|
|
280
|
+
- Predicates AST now includes information about args (names & possible values). (@fran-worley and @solnic)
|
|
281
|
+
- Predicates raise errors when they are called with invalid arity. (@fran-worley and @solnic)
|
|
282
|
+
- Rules no longer evaluate input twice when building result objects. (@solnic)
|
|
283
283
|
|
|
284
|
-
|
|
284
|
+
[0.3.0]: https://github.com/dry-rb/dry-logic/compare/v0.2.3...v0.3.0
|
|
285
285
|
|
|
286
|
+
## [0.2.3] - 2016-05-11
|
|
286
287
|
|
|
287
288
|
### Added
|
|
288
289
|
|
|
289
|
-
- `not_eql?`, `includes?`, `excludes?` predicates (fran-worley)
|
|
290
|
+
- `not_eql?`, `includes?`, `excludes?` predicates. (@fran-worley)
|
|
290
291
|
|
|
291
292
|
### Changed
|
|
292
293
|
|
|
293
|
-
- Renamed `inclusion?` to `included_in?` and deprecated `inclusion
|
|
294
|
-
- Renamed `exclusion?` to `excluded_from?` and deprecated `exclusion
|
|
294
|
+
- Renamed `inclusion?` to `included_in?` and deprecated `inclusion?`. (@fran-worley)
|
|
295
|
+
- Renamed `exclusion?` to `excluded_from?` and deprecated `exclusion?`. (@fran-worley)
|
|
295
296
|
|
|
296
|
-
[
|
|
297
|
-
|
|
298
|
-
## 0.2.2 2016-03-30
|
|
297
|
+
[0.2.3]: https://github.com/dry-rb/dry-logic/compare/v0.2.2...v0.2.3
|
|
299
298
|
|
|
299
|
+
## [0.2.2] - 2016-03-30
|
|
300
300
|
|
|
301
301
|
### Added
|
|
302
302
|
|
|
303
|
-
- `number?`, `odd?`, `even?` predicates (fran-worley)
|
|
304
|
-
|
|
303
|
+
- `number?`, `odd?`, `even?` predicates. (@fran-worley)
|
|
305
304
|
|
|
306
|
-
[
|
|
307
|
-
|
|
308
|
-
## 0.2.1 2016-03-20
|
|
305
|
+
[0.2.2]: https://github.com/dry-rb/dry-logic/compare/v0.2.1...v0.2.2
|
|
309
306
|
|
|
307
|
+
## [0.2.1] - 2016-03-20
|
|
310
308
|
|
|
311
309
|
### Fixed
|
|
312
310
|
|
|
313
|
-
- Result AST for `Rule::Each` correctly maps elements with eql inputs (solnic)
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
[Compare v0.2.0...v0.2.1](https://github.com/dry-rb/dry-logic/compare/v0.2.0...v0.2.1)
|
|
311
|
+
- Result AST for `Rule::Each` correctly maps elements with eql inputs. (@solnic)
|
|
317
312
|
|
|
318
|
-
|
|
313
|
+
[0.2.1]: https://github.com/dry-rb/dry-logic/compare/v0.2.0...v0.2.1
|
|
319
314
|
|
|
315
|
+
## [0.2.0] - 2016-03-11
|
|
320
316
|
|
|
321
317
|
### Changed
|
|
322
318
|
|
|
323
|
-
- Entire AST has been redefined (solnic)
|
|
319
|
+
- Entire AST has been redefined. (@solnic)
|
|
324
320
|
|
|
325
|
-
[
|
|
326
|
-
|
|
327
|
-
## 0.1.4 2016-01-27
|
|
321
|
+
[0.2.0]: https://github.com/dry-rb/dry-logic/compare/v0.1.4...v0.2.0
|
|
328
322
|
|
|
323
|
+
## [0.1.4] - 2016-01-27
|
|
329
324
|
|
|
330
325
|
### Added
|
|
331
326
|
|
|
332
|
-
- Support for hash-names in `Check` and `Result` which can properly resolve input
|
|
333
|
-
from nested results (solnic)
|
|
334
|
-
|
|
327
|
+
- Support for hash-names in `Check` and `Result` which can properly resolve input from nested results. (@solnic)
|
|
335
328
|
|
|
336
|
-
[
|
|
337
|
-
|
|
338
|
-
## 0.1.3 2016-01-27
|
|
329
|
+
[0.1.4]: https://github.com/dry-rb/dry-logic/compare/v0.1.3...v0.1.4
|
|
339
330
|
|
|
331
|
+
## [0.1.3] - 2016-01-27
|
|
340
332
|
|
|
341
333
|
### Added
|
|
342
334
|
|
|
343
|
-
- Support for resolving input from `Rule::Result
|
|
335
|
+
- Support for resolving input from `Rule::Result`. (@solnic)
|
|
344
336
|
|
|
345
337
|
### Changed
|
|
346
338
|
|
|
347
|
-
- `Check` and `Result` carry original input(s) (solnic)
|
|
348
|
-
|
|
349
|
-
[Compare v0.1.2...v0.1.3](https://github.com/dry-rb/dry-logic/compare/v0.1.2...v0.1.3)
|
|
339
|
+
- `Check` and `Result` carry original input(s). (@solnic)
|
|
350
340
|
|
|
351
|
-
|
|
341
|
+
[0.1.3]: https://github.com/dry-rb/dry-logic/compare/v0.1.2...v0.1.3
|
|
352
342
|
|
|
343
|
+
## [0.1.2] - 2016-01-19
|
|
353
344
|
|
|
354
345
|
### Fixed
|
|
355
346
|
|
|
356
|
-
- `xor` returns wrapped results when used against another result-rule (solnic)
|
|
347
|
+
- `xor` returns wrapped results when used against another result-rule. (@solnic)
|
|
357
348
|
|
|
349
|
+
[0.1.2]: https://github.com/dry-rb/dry-logic/compare/v0.1.1...v0.1.2
|
|
358
350
|
|
|
359
|
-
[
|
|
360
|
-
|
|
361
|
-
## 0.1.1 2016-01-18
|
|
362
|
-
|
|
351
|
+
## [0.1.1] - 2016-01-18
|
|
363
352
|
|
|
364
353
|
### Added
|
|
365
354
|
|
|
366
|
-
- `Rule::Attr` which can be applied to a data object with attr readers (SunnyMagadan)
|
|
367
|
-
- `Rule::Result` which can be applied to a result object (solnic)
|
|
368
|
-
- `true?` and `false?` predicates (solnic)
|
|
369
|
-
|
|
355
|
+
- `Rule::Attr` which can be applied to a data object with attr readers. (@SunnyMagadan)
|
|
356
|
+
- `Rule::Result` which can be applied to a result object. (@solnic)
|
|
357
|
+
- `true?` and `false?` predicates. (@solnic)
|
|
370
358
|
|
|
371
|
-
[
|
|
359
|
+
[0.1.1]: https://github.com/dry-rb/dry-logic/compare/v0.1.0...v0.1.1
|
|
372
360
|
|
|
373
|
-
## 0.1.0 2016-01-11
|
|
361
|
+
## 0.1.0 - 2016-01-11
|
|
374
362
|
|
|
375
|
-
Code extracted from dry-validation 0.4.1
|
|
363
|
+
Code extracted from dry-validation 0.4.1.
|
data/LICENSE
CHANGED
data/README.md
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
<!---
|
|
2
|
-
[gem]: https://rubygems.org/gems/dry-logic
|
|
3
|
-
[actions]: https://github.com/dry-rb/dry-logic/actions
|
|
4
|
-
|
|
5
|
-
# dry-logic [][gem] [][actions]
|
|
1
|
+
<!--- This file is synced from hanakai-rb/repo-sync -->
|
|
6
2
|
|
|
7
|
-
|
|
3
|
+
[actions]: https://github.com/dry-rb/dry-logic/actions
|
|
4
|
+
[chat]: https://discord.gg/naQApPAsZB
|
|
5
|
+
[forum]: https://discourse.hanakai.org
|
|
6
|
+
[rubygem]: https://rubygems.org/gems/dry-logic
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
* [API documentation](http://rubydoc.info/gems/dry-logic)
|
|
11
|
-
* [Forum](https://discourse.dry-rb.org)
|
|
8
|
+
# dry-logic [][rubygem] [][actions]
|
|
12
9
|
|
|
13
|
-
|
|
10
|
+
[][forum]
|
|
11
|
+
[][chat]
|
|
14
12
|
|
|
15
|
-
|
|
13
|
+
## Links
|
|
16
14
|
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
- [User documentation](https://dry-rb.org/gems/dry-logic)
|
|
16
|
+
- [API documentation](http://rubydoc.info/gems/dry-logic)
|
|
17
|
+
- [Forum](https://discourse.dry-rb.org)
|
|
19
18
|
|
|
20
19
|
## License
|
|
21
20
|
|
|
22
21
|
See `LICENSE` file.
|
|
22
|
+
|
data/dry-logic.gemspec
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
#
|
|
3
|
+
# This file is synced from hanakai-rb/repo-sync. To update it, edit repo-sync.yml.
|
|
4
4
|
|
|
5
5
|
lib = File.expand_path("lib", __dir__)
|
|
6
6
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
@@ -8,8 +8,8 @@ require "dry/logic/version"
|
|
|
8
8
|
|
|
9
9
|
Gem::Specification.new do |spec|
|
|
10
10
|
spec.name = "dry-logic"
|
|
11
|
-
spec.authors = ["
|
|
12
|
-
spec.email = ["
|
|
11
|
+
spec.authors = ["Hanakai team"]
|
|
12
|
+
spec.email = ["info@hanakai.org"]
|
|
13
13
|
spec.license = "MIT"
|
|
14
14
|
spec.version = Dry::Logic::VERSION.dup
|
|
15
15
|
|
|
@@ -17,21 +17,25 @@ Gem::Specification.new do |spec|
|
|
|
17
17
|
spec.description = spec.summary
|
|
18
18
|
spec.homepage = "https://dry-rb.org/gems/dry-logic"
|
|
19
19
|
spec.files = Dir["CHANGELOG.md", "LICENSE", "README.md", "dry-logic.gemspec", "lib/**/*"]
|
|
20
|
-
spec.bindir = "
|
|
21
|
-
spec.executables = []
|
|
20
|
+
spec.bindir = "exe"
|
|
21
|
+
spec.executables = Dir["exe/*"].map { |f| File.basename(f) }
|
|
22
22
|
spec.require_paths = ["lib"]
|
|
23
23
|
|
|
24
|
-
spec.
|
|
24
|
+
spec.extra_rdoc_files = ["README.md", "CHANGELOG.md", "LICENSE"]
|
|
25
|
+
|
|
25
26
|
spec.metadata["changelog_uri"] = "https://github.com/dry-rb/dry-logic/blob/main/CHANGELOG.md"
|
|
26
27
|
spec.metadata["source_code_uri"] = "https://github.com/dry-rb/dry-logic"
|
|
27
28
|
spec.metadata["bug_tracker_uri"] = "https://github.com/dry-rb/dry-logic/issues"
|
|
28
|
-
spec.metadata["
|
|
29
|
+
spec.metadata["funding_uri"] = "https://github.com/sponsors/hanami"
|
|
29
30
|
|
|
30
|
-
spec.required_ruby_version = ">= 3.1
|
|
31
|
+
spec.required_ruby_version = ">= 3.1"
|
|
31
32
|
|
|
32
|
-
|
|
33
|
-
spec.
|
|
34
|
-
spec.
|
|
35
|
-
spec.
|
|
36
|
-
spec.
|
|
33
|
+
spec.add_runtime_dependency "bigdecimal"
|
|
34
|
+
spec.add_runtime_dependency "concurrent-ruby", "~> 1.0"
|
|
35
|
+
spec.add_runtime_dependency "dry-core", "~> 1.1"
|
|
36
|
+
spec.add_runtime_dependency "zeitwerk", "~> 2.6"
|
|
37
|
+
spec.add_development_dependency "bundler"
|
|
38
|
+
spec.add_development_dependency "rake"
|
|
39
|
+
spec.add_development_dependency "rspec"
|
|
37
40
|
end
|
|
41
|
+
|
data/lib/dry/logic/predicates.rb
CHANGED
|
@@ -12,7 +12,6 @@ module Dry
|
|
|
12
12
|
module Predicates
|
|
13
13
|
include ::Dry::Core::Constants
|
|
14
14
|
|
|
15
|
-
# rubocop:disable Metrics/ModuleLength
|
|
16
15
|
module Methods
|
|
17
16
|
def self.uuid_format(version)
|
|
18
17
|
::Regexp.new(<<~FORMAT.chomp, ::Regexp::IGNORECASE)
|
|
@@ -185,15 +184,17 @@ module Dry
|
|
|
185
184
|
|
|
186
185
|
def uuid_v8?(input) = format?(UUIDv8, input)
|
|
187
186
|
|
|
187
|
+
# `make_regexp` builds an unanchored pattern meant for extracting URIs from text, so it is
|
|
188
|
+
# anchored here to require the whole input to be a URI with a permitted scheme.
|
|
188
189
|
if defined?(::URI::RFC2396_PARSER)
|
|
189
190
|
def uri?(schemes, input)
|
|
190
191
|
uri_format = ::URI::RFC2396_PARSER.make_regexp(schemes)
|
|
191
|
-
format?(uri_format
|
|
192
|
+
format?(/\A(?:#{uri_format})\z/, input)
|
|
192
193
|
end
|
|
193
194
|
else
|
|
194
195
|
def uri?(schemes, input)
|
|
195
196
|
uri_format = ::URI::DEFAULT_PARSER.make_regexp(schemes)
|
|
196
|
-
format?(uri_format
|
|
197
|
+
format?(/\A(?:#{uri_format})\z/, input)
|
|
197
198
|
end
|
|
198
199
|
end
|
|
199
200
|
|
data/lib/dry/logic/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dry-logic
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.6.
|
|
4
|
+
version: 1.6.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
bindir: bin
|
|
7
|
+
- Hanakai team
|
|
8
|
+
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: bigdecimal
|
|
@@ -66,12 +65,57 @@ dependencies:
|
|
|
66
65
|
- - "~>"
|
|
67
66
|
- !ruby/object:Gem::Version
|
|
68
67
|
version: '2.6'
|
|
68
|
+
- !ruby/object:Gem::Dependency
|
|
69
|
+
name: bundler
|
|
70
|
+
requirement: !ruby/object:Gem::Requirement
|
|
71
|
+
requirements:
|
|
72
|
+
- - ">="
|
|
73
|
+
- !ruby/object:Gem::Version
|
|
74
|
+
version: '0'
|
|
75
|
+
type: :development
|
|
76
|
+
prerelease: false
|
|
77
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
78
|
+
requirements:
|
|
79
|
+
- - ">="
|
|
80
|
+
- !ruby/object:Gem::Version
|
|
81
|
+
version: '0'
|
|
82
|
+
- !ruby/object:Gem::Dependency
|
|
83
|
+
name: rake
|
|
84
|
+
requirement: !ruby/object:Gem::Requirement
|
|
85
|
+
requirements:
|
|
86
|
+
- - ">="
|
|
87
|
+
- !ruby/object:Gem::Version
|
|
88
|
+
version: '0'
|
|
89
|
+
type: :development
|
|
90
|
+
prerelease: false
|
|
91
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
92
|
+
requirements:
|
|
93
|
+
- - ">="
|
|
94
|
+
- !ruby/object:Gem::Version
|
|
95
|
+
version: '0'
|
|
96
|
+
- !ruby/object:Gem::Dependency
|
|
97
|
+
name: rspec
|
|
98
|
+
requirement: !ruby/object:Gem::Requirement
|
|
99
|
+
requirements:
|
|
100
|
+
- - ">="
|
|
101
|
+
- !ruby/object:Gem::Version
|
|
102
|
+
version: '0'
|
|
103
|
+
type: :development
|
|
104
|
+
prerelease: false
|
|
105
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
106
|
+
requirements:
|
|
107
|
+
- - ">="
|
|
108
|
+
- !ruby/object:Gem::Version
|
|
109
|
+
version: '0'
|
|
69
110
|
description: Predicate logic with rule composition
|
|
70
111
|
email:
|
|
71
|
-
-
|
|
112
|
+
- info@hanakai.org
|
|
72
113
|
executables: []
|
|
73
114
|
extensions: []
|
|
74
|
-
extra_rdoc_files:
|
|
115
|
+
extra_rdoc_files:
|
|
116
|
+
- CHANGELOG.md
|
|
117
|
+
- LICENSE
|
|
118
|
+
- README.md
|
|
75
119
|
files:
|
|
76
120
|
- CHANGELOG.md
|
|
77
121
|
- LICENSE
|
|
@@ -107,12 +151,10 @@ homepage: https://dry-rb.org/gems/dry-logic
|
|
|
107
151
|
licenses:
|
|
108
152
|
- MIT
|
|
109
153
|
metadata:
|
|
110
|
-
allowed_push_host: https://rubygems.org
|
|
111
154
|
changelog_uri: https://github.com/dry-rb/dry-logic/blob/main/CHANGELOG.md
|
|
112
155
|
source_code_uri: https://github.com/dry-rb/dry-logic
|
|
113
156
|
bug_tracker_uri: https://github.com/dry-rb/dry-logic/issues
|
|
114
|
-
|
|
115
|
-
post_install_message:
|
|
157
|
+
funding_uri: https://github.com/sponsors/hanami
|
|
116
158
|
rdoc_options: []
|
|
117
159
|
require_paths:
|
|
118
160
|
- lib
|
|
@@ -120,15 +162,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
120
162
|
requirements:
|
|
121
163
|
- - ">="
|
|
122
164
|
- !ruby/object:Gem::Version
|
|
123
|
-
version: 3.1
|
|
165
|
+
version: '3.1'
|
|
124
166
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
125
167
|
requirements:
|
|
126
168
|
- - ">="
|
|
127
169
|
- !ruby/object:Gem::Version
|
|
128
170
|
version: '0'
|
|
129
171
|
requirements: []
|
|
130
|
-
rubygems_version: 3.
|
|
131
|
-
signing_key:
|
|
172
|
+
rubygems_version: 3.6.9
|
|
132
173
|
specification_version: 4
|
|
133
174
|
summary: Predicate logic with rule composition
|
|
134
175
|
test_files: []
|