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.
Files changed (97) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +214 -53
  3. data/LICENSE +1 -1
  4. data/README.md +14 -18
  5. data/dry-logic.gemspec +28 -15
  6. data/lib/dry-logic.rb +3 -1
  7. data/lib/dry/logic.rb +4 -2
  8. data/lib/dry/logic/appliable.rb +2 -0
  9. data/lib/dry/logic/evaluator.rb +3 -1
  10. data/lib/dry/logic/operations.rb +13 -11
  11. data/lib/dry/logic/operations/abstract.rb +8 -6
  12. data/lib/dry/logic/operations/and.rb +15 -3
  13. data/lib/dry/logic/operations/attr.rb +3 -1
  14. data/lib/dry/logic/operations/binary.rb +3 -1
  15. data/lib/dry/logic/operations/check.rb +6 -4
  16. data/lib/dry/logic/operations/each.rb +4 -2
  17. data/lib/dry/logic/operations/implication.rb +4 -2
  18. data/lib/dry/logic/operations/key.rb +11 -9
  19. data/lib/dry/logic/operations/negation.rb +9 -3
  20. data/lib/dry/logic/operations/or.rb +4 -2
  21. data/lib/dry/logic/operations/set.rb +5 -3
  22. data/lib/dry/logic/operations/unary.rb +3 -1
  23. data/lib/dry/logic/operations/xor.rb +4 -2
  24. data/lib/dry/logic/operators.rb +6 -4
  25. data/lib/dry/logic/predicates.rb +72 -28
  26. data/lib/dry/logic/result.rb +4 -2
  27. data/lib/dry/logic/rule.rb +35 -30
  28. data/lib/dry/logic/rule/interface.rb +141 -0
  29. data/lib/dry/logic/rule/predicate.rb +9 -3
  30. data/lib/dry/logic/rule_compiler.rb +7 -3
  31. data/lib/dry/logic/version.rb +3 -1
  32. metadata +21 -151
  33. data/.codeclimate.yml +0 -23
  34. data/.gitignore +0 -8
  35. data/.rspec +0 -3
  36. data/.rubocop.yml +0 -16
  37. data/.rubocop_todo.yml +0 -7
  38. data/.travis.yml +0 -31
  39. data/CONTRIBUTING.md +0 -29
  40. data/Gemfile +0 -18
  41. data/Rakefile +0 -12
  42. data/examples/basic.rb +0 -14
  43. data/spec/integration/result_spec.rb +0 -59
  44. data/spec/integration/rule_spec.rb +0 -53
  45. data/spec/shared/predicates.rb +0 -57
  46. data/spec/shared/rule.rb +0 -67
  47. data/spec/spec_helper.rb +0 -34
  48. data/spec/support/mutant.rb +0 -9
  49. data/spec/unit/operations/and_spec.rb +0 -64
  50. data/spec/unit/operations/attr_spec.rb +0 -27
  51. data/spec/unit/operations/check_spec.rb +0 -49
  52. data/spec/unit/operations/each_spec.rb +0 -47
  53. data/spec/unit/operations/implication_spec.rb +0 -30
  54. data/spec/unit/operations/key_spec.rb +0 -119
  55. data/spec/unit/operations/negation_spec.rb +0 -40
  56. data/spec/unit/operations/or_spec.rb +0 -73
  57. data/spec/unit/operations/set_spec.rb +0 -41
  58. data/spec/unit/operations/xor_spec.rb +0 -61
  59. data/spec/unit/predicates/array_spec.rb +0 -41
  60. data/spec/unit/predicates/attr_spec.rb +0 -29
  61. data/spec/unit/predicates/bool_spec.rb +0 -34
  62. data/spec/unit/predicates/case_spec.rb +0 -33
  63. data/spec/unit/predicates/date_spec.rb +0 -31
  64. data/spec/unit/predicates/date_time_spec.rb +0 -31
  65. data/spec/unit/predicates/decimal_spec.rb +0 -32
  66. data/spec/unit/predicates/empty_spec.rb +0 -38
  67. data/spec/unit/predicates/eql_spec.rb +0 -21
  68. data/spec/unit/predicates/even_spec.rb +0 -31
  69. data/spec/unit/predicates/excluded_from_spec.rb +0 -35
  70. data/spec/unit/predicates/excludes_spec.rb +0 -56
  71. data/spec/unit/predicates/false_spec.rb +0 -35
  72. data/spec/unit/predicates/filled_spec.rb +0 -38
  73. data/spec/unit/predicates/float_spec.rb +0 -31
  74. data/spec/unit/predicates/format_spec.rb +0 -21
  75. data/spec/unit/predicates/gt_spec.rb +0 -40
  76. data/spec/unit/predicates/gteq_spec.rb +0 -40
  77. data/spec/unit/predicates/included_in_spec.rb +0 -35
  78. data/spec/unit/predicates/includes_spec.rb +0 -24
  79. data/spec/unit/predicates/int_spec.rb +0 -34
  80. data/spec/unit/predicates/key_spec.rb +0 -29
  81. data/spec/unit/predicates/lt_spec.rb +0 -40
  82. data/spec/unit/predicates/lteq_spec.rb +0 -40
  83. data/spec/unit/predicates/max_size_spec.rb +0 -49
  84. data/spec/unit/predicates/min_size_spec.rb +0 -49
  85. data/spec/unit/predicates/none_spec.rb +0 -28
  86. data/spec/unit/predicates/not_eql_spec.rb +0 -21
  87. data/spec/unit/predicates/number_spec.rb +0 -37
  88. data/spec/unit/predicates/odd_spec.rb +0 -31
  89. data/spec/unit/predicates/size_spec.rb +0 -55
  90. data/spec/unit/predicates/str_spec.rb +0 -32
  91. data/spec/unit/predicates/time_spec.rb +0 -31
  92. data/spec/unit/predicates/true_spec.rb +0 -35
  93. data/spec/unit/predicates/type_spec.rb +0 -35
  94. data/spec/unit/predicates_spec.rb +0 -23
  95. data/spec/unit/rule/predicate_spec.rb +0 -53
  96. data/spec/unit/rule_compiler_spec.rb +0 -127
  97. data/spec/unit/rule_spec.rb +0 -141
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 554db40a47bc9eaa08659c38fd706fd15317f703
4
- data.tar.gz: cdf04c815e657c282eef1c0d28d8923ba6b4dc12
2
+ SHA256:
3
+ metadata.gz: 35900556fff5ca088cf3f66f319d770c4e15ba1f91a2298a1db096498ea01fb4
4
+ data.tar.gz: 942707a00d2f4424d2cd737e042877af2b15cf8a621564b463c254b98a72f9df
5
5
  SHA512:
6
- metadata.gz: fa2ff6136f6407d523dcb8f5dee97c7f01da3aa71ebde81ce05ac92ab1408db9909d9e997cf81b46ad2bb8120000cdbe84c456b3866f22d37259674883445721
7
- data.tar.gz: 3b6148d888eb2fb6ab6c8e87f3dedbee81feb13a310c7256abc06de9e8643555bf671b9d215045fc00db5c8a09e1b35f6ac1e57e57a6f91d09ca509eee14aa7a
6
+ metadata.gz: 37f3b82b384a0b34b51f966665e5b74c7b9834e25a02ca6f096d7bfac4b0de100d023341aeba212ddee1c8b9a1e5a2281c25db6ba66058b9884cc926f95520e1
7
+ data.tar.gz: 174ec949de041f18c8a8b95b2e8db5c483e949e30be69da09f02032a29d2ee7ff3f823d44269e63b45c8ac201f75c4c1b520a02f2c6fbf6435dd725c729eba72
data/CHANGELOG.md CHANGED
@@ -1,145 +1,306 @@
1
- # v0.4.2 2017-09-15
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
- * New `:case?` predicate matches a value against the given object with `#===` (flash-gordon)
6
- * New `:is?` predicate checks objects identity (using `#equal?`) (flash-gordon)
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
- * A bug with using custom predicates within a standalone module in `dry-validation` (flash-gordon)
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
- [Compare v0.4.1...v0.4.2(https://github.com/dry-rb/dry-logic/compare/v0.4.1...v0.4.2)
119
+ ### Added
13
120
 
14
- # v0.4.1 2017-01-23
121
+ - Generating hints can be disabled by building `Operations::And` with `hints: false` option set (solnic)
15
122
 
16
123
  ### Changed
17
124
 
18
- * Predicates simply reuse other predicate methods instead of referring to them via `#[]` (georgemillo)
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
- * Warnings on MRI 2.4.0 are gone (jtippett)
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
- # v0.4.0 2016-09-21
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
- * `Rule#[]` which applies a rule and always returns `true` or `false` (solnic)
33
- * `Rule#bind` which returns a rule with its predicate bound to a given object (solnic)
34
- * `Rule#eval_args` which evaluates unbound-methods-args in the context of a given object (solnic)
35
- * `Logic.Rule` builder function (solnic)
36
- * Nice `#inspect` on rules and operation objects (solnic)
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
- * [BRAEKING] New result API (solnic)
41
- * [BREAKING] `Predicate` is now `Rule::Predicate` (solnic)
42
- * [BREAKING] `Rule::Conjunction` is now `Operation::And` (solnic)
43
- * [BREAKING] `Rule::Disjunction` is now `Operation::Or` (solnic)
44
- * [BREAKING] `Rule::ExlusiveDisjunction` is now `Operation::Xor` (solnic)
45
- * [BREAKING] `Rule::Implication` is now `Operation::Implication` (solnic)
46
- * [BREAKING] `Rule::Set` is now `Operation::Set` (solnic)
47
- * [BREAKING] `Rule::Each` is now `Operation::Each` (solnic)
48
- * [BREAKING] `Rule.new` accepts a predicate function as its first arg now (solnic)
49
- * [BREAKING] `Rule#name` is now `Rule#id` (solnic)
50
- * `Rule#parameters` is public now (solnic)
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
- # v0.3.0 2016-07-01
199
+ ## 0.3.0 2016-07-01
200
+
55
201
 
56
202
  ### Added
57
203
 
58
- * `:type?` predicate imported from dry-types (solnic)
59
- * `Rule#curry` interface (solnic)
204
+ - `:type?` predicate imported from dry-types (solnic)
205
+ - `Rule#curry` interface (solnic)
60
206
 
61
207
  ### Changed
62
208
 
63
- * Predicates AST now includes information about args (names & possible values) (fran-worley + solnic)
64
- * Predicates raise errors when they are called with invalid arity (fran-worley + solnic)
65
- * Rules no longer evaluate input twice when building result objects (solnic)
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
- # v0.2.3 2016-05-11
215
+ ## 0.2.3 2016-05-11
216
+
70
217
 
71
218
  ### Added
72
219
 
73
- * `not_eql?`, `includes?`, `excludes?` predicates (fran-worley)
220
+ - `not_eql?`, `includes?`, `excludes?` predicates (fran-worley)
74
221
 
75
222
  ### Changed
76
223
 
77
- * Renamed `inclusion?` to `included_in?` and deprecated `inclusion?` (fran-worley)
78
- * Renamed `exclusion?` to `excluded_from?` and deprecated `exclusion?` (fran-worley)
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
- # v0.2.2 2016-03-30
229
+ ## 0.2.2 2016-03-30
230
+
83
231
 
84
232
  ### Added
85
233
 
86
- * `number?`, `odd?`, `even?` predicates (fran-worley)
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
- # v0.2.1 2016-03-20
239
+ ## 0.2.1 2016-03-20
240
+
91
241
 
92
242
  ### Fixed
93
243
 
94
- * Result AST for `Rule::Each` correctly maps elements with eql inputs (solnic)
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
- * Entire AST has been redefined (solnic)
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
- # v0.1.4 2016-01-27
258
+ ## 0.1.4 2016-01-27
259
+
105
260
 
106
261
  ### Added
107
262
 
108
- * Support for hash-names in `Check` and `Result` which can properly resolve input
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
- # v0.1.3 2016-01-27
269
+ ## 0.1.3 2016-01-27
270
+
114
271
 
115
272
  ### Added
116
273
 
117
- * Support for resolving input from `Rule::Result` (solnic)
274
+ - Support for resolving input from `Rule::Result` (solnic)
118
275
 
119
276
  ### Changed
120
277
 
121
- * `Check` and `Result` carry original input(s) (solnic)
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
- # v0.1.2 2016-01-19
282
+ ## 0.1.2 2016-01-19
283
+
126
284
 
127
285
  ### Fixed
128
286
 
129
- * `xor` returns wrapped results when used against another result-rule (solnic)
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
- # v0.1.1 2016-01-18
292
+ ## 0.1.1 2016-01-18
293
+
134
294
 
135
295
  ### Added
136
296
 
137
- * `Rule::Attr` which can be applied to a data object with attr readers (SunnyMagadan)
138
- * `Rule::Result` which can be applied to a result object (solnic)
139
- * `true?` and `false?` predicates (solnic)
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
- # v0.1.0 2016-01-11
304
+ ## 0.1.0 2016-01-11
144
305
 
145
306
  Code extracted from dry-validation 0.4.1
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2014 Ruby Object Mapper
3
+ Copyright (c) 2015-2020 dry-rb team
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy of
6
6
  this software and associated documentation files (the "Software"), to deal in
data/README.md CHANGED
@@ -1,32 +1,28 @@
1
1
  [gem]: https://rubygems.org/gems/dry-logic
2
- [travis]: https://travis-ci.org/dry-rb/dry-logic
3
- [gemnasium]: https://gemnasium.com/dry-rb/dry-logic
4
- [codeclimate]: https://codeclimate.com/github/dry-rb/dry-logic
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://gitter.im/dry-rb/chat](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/dry-rb/chat)
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
- [![Build Status](https://travis-ci.org/dry-rb/dry-logic.svg?branch=master)][travis]
12
- [![Dependency Status](https://gemnasium.com/dry-rb/dry-logic.svg)][gemnasium]
13
- [![Code Climate](https://codeclimate.com/github/dry-rb/dry-logic/badges/gpa.svg)][codeclimate]
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
- * [Documentation](http://dry-rb.org/gems/dry-logic)
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
- ## Contributing
22
+ This library officially supports the following Ruby versions:
28
23
 
29
- Bug reports and pull requests are welcome on GitHub at https://github.com/dry-rb/dry-logic.
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
- require File.expand_path('../lib/dry/logic/version', __FILE__)
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.version = Dry::Logic::VERSION
6
- spec.authors = ['Piotr Solnica']
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.files = `git ls-files -z`.split("\x0")
13
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
14
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
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.add_runtime_dependency 'dry-core', '~> 0.2'
18
- spec.add_runtime_dependency 'dry-container', '~> 0.2', '>= 0.2.6'
19
- spec.add_runtime_dependency 'dry-equalizer', '~> 0.2'
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 'bundler'
22
- spec.add_development_dependency 'rake'
23
- spec.add_development_dependency 'rspec'
34
+ spec.add_development_dependency "bundler"
35
+ spec.add_development_dependency "rake"
36
+ spec.add_development_dependency "rspec"
24
37
  end