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.
Files changed (113) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +122 -26
  3. data/LICENSE +1 -1
  4. data/README.md +12 -14
  5. data/dry-logic.gemspec +26 -20
  6. data/lib/dry-logic.rb +1 -1
  7. data/lib/dry/logic.rb +2 -2
  8. data/lib/dry/logic/evaluator.rb +1 -1
  9. data/lib/dry/logic/operations.rb +11 -11
  10. data/lib/dry/logic/operations/abstract.rb +3 -3
  11. data/lib/dry/logic/operations/and.rb +3 -3
  12. data/lib/dry/logic/operations/attr.rb +1 -1
  13. data/lib/dry/logic/operations/binary.rb +4 -3
  14. data/lib/dry/logic/operations/check.rb +4 -4
  15. data/lib/dry/logic/operations/each.rb +2 -2
  16. data/lib/dry/logic/operations/implication.rb +2 -2
  17. data/lib/dry/logic/operations/key.rb +3 -3
  18. data/lib/dry/logic/operations/negation.rb +2 -2
  19. data/lib/dry/logic/operations/or.rb +2 -2
  20. data/lib/dry/logic/operations/set.rb +3 -3
  21. data/lib/dry/logic/operations/unary.rb +1 -1
  22. data/lib/dry/logic/operations/xor.rb +2 -2
  23. data/lib/dry/logic/operators.rb +4 -4
  24. data/lib/dry/logic/predicates.rb +32 -7
  25. data/lib/dry/logic/result.rb +2 -2
  26. data/lib/dry/logic/rule.rb +8 -8
  27. data/lib/dry/logic/rule/interface.rb +32 -37
  28. data/lib/dry/logic/rule/predicate.rb +3 -3
  29. data/lib/dry/logic/rule_compiler.rb +3 -3
  30. data/lib/dry/logic/version.rb +1 -1
  31. metadata +17 -166
  32. data/.codeclimate.yml +0 -12
  33. data/.github/ISSUE_TEMPLATE/----please-don-t-ask-for-support-via-issues.md +0 -10
  34. data/.github/ISSUE_TEMPLATE/---bug-report.md +0 -34
  35. data/.github/ISSUE_TEMPLATE/---feature-request.md +0 -18
  36. data/.github/workflows/ci.yml +0 -70
  37. data/.github/workflows/docsite.yml +0 -34
  38. data/.github/workflows/sync_configs.yml +0 -34
  39. data/.gitignore +0 -9
  40. data/.rspec +0 -4
  41. data/.rubocop.yml +0 -89
  42. data/CODE_OF_CONDUCT.md +0 -13
  43. data/CONTRIBUTING.md +0 -29
  44. data/Gemfile +0 -16
  45. data/Rakefile +0 -14
  46. data/benchmarks/rule_application.rb +0 -30
  47. data/benchmarks/setup.rb +0 -13
  48. data/bin/console +0 -11
  49. data/docsite/source/index.html.md +0 -54
  50. data/docsite/source/operations.html.md +0 -62
  51. data/docsite/source/predicates.html.md +0 -102
  52. data/examples/basic.rb +0 -16
  53. data/spec/integration/result_spec.rb +0 -61
  54. data/spec/integration/rule_spec.rb +0 -55
  55. data/spec/shared/predicates.rb +0 -59
  56. data/spec/shared/rule.rb +0 -74
  57. data/spec/spec_helper.rb +0 -30
  58. data/spec/support/mutant.rb +0 -11
  59. data/spec/unit/operations/and_spec.rb +0 -70
  60. data/spec/unit/operations/attr_spec.rb +0 -29
  61. data/spec/unit/operations/check_spec.rb +0 -51
  62. data/spec/unit/operations/each_spec.rb +0 -49
  63. data/spec/unit/operations/implication_spec.rb +0 -32
  64. data/spec/unit/operations/key_spec.rb +0 -135
  65. data/spec/unit/operations/negation_spec.rb +0 -51
  66. data/spec/unit/operations/or_spec.rb +0 -75
  67. data/spec/unit/operations/set_spec.rb +0 -43
  68. data/spec/unit/operations/xor_spec.rb +0 -63
  69. data/spec/unit/predicates/array_spec.rb +0 -43
  70. data/spec/unit/predicates/attr_spec.rb +0 -31
  71. data/spec/unit/predicates/bool_spec.rb +0 -36
  72. data/spec/unit/predicates/bytesize_spec.rb +0 -48
  73. data/spec/unit/predicates/case_spec.rb +0 -35
  74. data/spec/unit/predicates/date_spec.rb +0 -33
  75. data/spec/unit/predicates/date_time_spec.rb +0 -33
  76. data/spec/unit/predicates/decimal_spec.rb +0 -34
  77. data/spec/unit/predicates/empty_spec.rb +0 -40
  78. data/spec/unit/predicates/eql_spec.rb +0 -23
  79. data/spec/unit/predicates/even_spec.rb +0 -33
  80. data/spec/unit/predicates/excluded_from_spec.rb +0 -37
  81. data/spec/unit/predicates/excludes_spec.rb +0 -58
  82. data/spec/unit/predicates/false_spec.rb +0 -37
  83. data/spec/unit/predicates/filled_spec.rb +0 -40
  84. data/spec/unit/predicates/float_spec.rb +0 -33
  85. data/spec/unit/predicates/format_spec.rb +0 -31
  86. data/spec/unit/predicates/gt_spec.rb +0 -42
  87. data/spec/unit/predicates/gteq_spec.rb +0 -42
  88. data/spec/unit/predicates/hash_spec.rb +0 -40
  89. data/spec/unit/predicates/included_in_spec.rb +0 -37
  90. data/spec/unit/predicates/includes_spec.rb +0 -24
  91. data/spec/unit/predicates/int_spec.rb +0 -36
  92. data/spec/unit/predicates/key_spec.rb +0 -31
  93. data/spec/unit/predicates/lt_spec.rb +0 -42
  94. data/spec/unit/predicates/lteq_spec.rb +0 -42
  95. data/spec/unit/predicates/max_bytesize_spec.rb +0 -39
  96. data/spec/unit/predicates/max_size_spec.rb +0 -51
  97. data/spec/unit/predicates/min_bytesize_spec.rb +0 -39
  98. data/spec/unit/predicates/min_size_spec.rb +0 -51
  99. data/spec/unit/predicates/none_spec.rb +0 -30
  100. data/spec/unit/predicates/not_eql_spec.rb +0 -23
  101. data/spec/unit/predicates/number_spec.rb +0 -39
  102. data/spec/unit/predicates/odd_spec.rb +0 -33
  103. data/spec/unit/predicates/respond_to_spec.rb +0 -31
  104. data/spec/unit/predicates/size_spec.rb +0 -57
  105. data/spec/unit/predicates/str_spec.rb +0 -34
  106. data/spec/unit/predicates/time_spec.rb +0 -33
  107. data/spec/unit/predicates/true_spec.rb +0 -37
  108. data/spec/unit/predicates/type_spec.rb +0 -37
  109. data/spec/unit/predicates/uuid_v4_spec.rb +0 -29
  110. data/spec/unit/predicates_spec.rb +0 -25
  111. data/spec/unit/rule/predicate_spec.rb +0 -55
  112. data/spec/unit/rule_compiler_spec.rb +0 -129
  113. data/spec/unit/rule_spec.rb +0 -213
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2eaa5ac48636ac8735eb5acfd455b0a6cc23887730500a3738a0e6b79b105187
4
- data.tar.gz: 98d6ba8d611d80f4a1eb0ef3aa52dfcf976ef46ceabe92040f9090caaa98a4cb
3
+ metadata.gz: 79f9f79ed9b54af39baedaccf40909bc2e126d094481fadef976a41438adbec0
4
+ data.tar.gz: f636b5cbf5737ef5ca7d4452c38748746fa2f55808012b17d13d1d6fff17e940
5
5
  SHA512:
6
- metadata.gz: 9de80f29b7ee5b3d8303a6834a94f20442ac3c78d9c90b634c91a7d6d7e620a5c96eea6d7142fbe361561d5076261f8ec54d0cfd6ebbdd05926a4b59d77b1919
7
- data.tar.gz: 56ed2dc66cd66fd80d7437c5f75adee53dcfbb8e721b1d83a87d1e6fca35fab3dd8bb04f7cdb00c35c64d70f8d0685bed2900b2835bc7f710cacda8e034aa0f0
6
+ metadata.gz: 2e821f235ba2e2ab4ab94e24a497bb496da3747f9f07ad4bd435bb90362391e0a0f2f620ca2fed1683e42f5149c2006b629105bbe1ddfc5dc9329099ad21b34f
7
+ data.tar.gz: 0265c634dd84013c9b071258d185dbd52ea8ccdb2960f6db78eaabff6e2c22c08b32dd579217851a4bb130f911db1a882334a765f106e2cf659ff58a3e0ee285
data/CHANGELOG.md CHANGED
@@ -1,16 +1,81 @@
1
- # v1.0.5 2019-11-07
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
- # v1.0.4 2019-11-06
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
- # v1.0.3 2019-08-01
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
- # v1.0.2 2019-06-14
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
- # v1.0.1 2019-06-04 (yanked)
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
- This release was removed from rubygems because it broke dry-schema.
111
+ ## 1.0.0 2019-04-23
43
112
 
44
- # v1.0.0 2019-04-23
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
- # v0.6.1 2019-04-18
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
- # v0.6.0 2019-04-04
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
- # v0.5.0 2019-01-29
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
- # v0.4.2 2017-09-15
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
- # v0.4.1 2017-01-23
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
- ### Changed
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
- # v0.4.0 2016-09-21
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
- # v0.3.0 2016-07-01
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
- # v0.2.3 2016-05-11
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
- # v0.2.2 2016-03-30
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
- # v0.2.1 2016-03-20
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
- # v0.2.0 2016-03-11
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
- # v0.1.4 2016-01-27
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
- # v0.1.3 2016-01-27
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
- # v0.1.2 2016-01-19
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
- # v0.1.1 2016-01-18
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
- # v0.1.0 2016-01-11
318
+ ## 0.1.0 2016-01-11
223
319
 
224
320
  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) 2015-2019 dry-rb team
3
+ Copyright (c) 2015-2021 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,30 +1,28 @@
1
1
  [gem]: https://rubygems.org/gems/dry-logic
2
- [ci]: https://github.com/dry-rb/dry-logic/actions?query=workflow%3Aci
3
- [codeclimate]: https://codeclimate.com/github/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
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
- [![Build Status](https://github.com/dry-rb/dry-logic/workflows/ci/badge.svg)][ci]
11
- [![Code Climate](https://codeclimate.com/github/dry-rb/dry-logic/badges/gpa.svg)][codeclimate]
12
- [![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]
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
- - [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
24
21
 
25
- ## Contributing
22
+ This library officially supports the following Ruby versions:
26
23
 
27
- 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`
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
- require File.expand_path('../lib/dry/logic/version', __FILE__)
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.version = Dry::Logic::VERSION
8
- spec.authors = ['Piotr Solnica']
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.files = `git ls-files -z`.split("\x0")
15
- 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 = []
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.add_runtime_dependency 'concurrent-ruby', '~> 1.0'
25
- spec.add_runtime_dependency 'dry-core', '~> 0.2'
26
- 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
27
 
28
- spec.add_development_dependency 'bundler'
29
- spec.add_development_dependency 'rake'
30
- spec.add_development_dependency 'rspec'
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
@@ -1,3 +1,3 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'dry/logic'
3
+ require "dry/logic"
data/lib/dry/logic.rb CHANGED
@@ -7,5 +7,5 @@ module Dry
7
7
  end
8
8
  end
9
9
 
10
- require 'dry/logic/rule/predicate'
11
- require 'dry/logic/operations'
10
+ require "dry/logic/rule/predicate"
11
+ require "dry/logic/operations"
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'dry/equalizer'
3
+ require "dry/core/equalizer"
4
4
 
5
5
  module Dry
6
6
  module Logic
@@ -1,15 +1,15 @@
1
1
  # frozen_string_literal: true
2
2
 
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'
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 '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'
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 'dry/logic/operators'
15
+ require "dry/logic/operators"