dry-logic 1.0.2 → 1.0.7

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.
Files changed (99) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +119 -26
  3. data/LICENSE +1 -1
  4. data/README.md +12 -14
  5. data/dry-logic.gemspec +27 -14
  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 +6 -6
  11. data/lib/dry/logic/operations/and.rb +4 -4
  12. data/lib/dry/logic/operations/attr.rb +1 -1
  13. data/lib/dry/logic/operations/binary.rb +1 -1
  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 +5 -5
  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 +60 -28
  25. data/lib/dry/logic/result.rb +2 -2
  26. data/lib/dry/logic/rule.rb +11 -11
  27. data/lib/dry/logic/rule/interface.rb +8 -8
  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 +12 -133
  32. data/.codeclimate.yml +0 -15
  33. data/.gitignore +0 -9
  34. data/.rspec +0 -3
  35. data/.travis.yml +0 -31
  36. data/CONTRIBUTING.md +0 -29
  37. data/Gemfile +0 -15
  38. data/Rakefile +0 -14
  39. data/benchmarks/rule_application.rb +0 -30
  40. data/benchmarks/setup.rb +0 -13
  41. data/bin/console +0 -11
  42. data/examples/basic.rb +0 -16
  43. data/spec/integration/result_spec.rb +0 -61
  44. data/spec/integration/rule_spec.rb +0 -55
  45. data/spec/shared/predicates.rb +0 -59
  46. data/spec/shared/rule.rb +0 -74
  47. data/spec/spec_helper.rb +0 -36
  48. data/spec/support/mutant.rb +0 -11
  49. data/spec/unit/operations/and_spec.rb +0 -70
  50. data/spec/unit/operations/attr_spec.rb +0 -29
  51. data/spec/unit/operations/check_spec.rb +0 -51
  52. data/spec/unit/operations/each_spec.rb +0 -49
  53. data/spec/unit/operations/implication_spec.rb +0 -32
  54. data/spec/unit/operations/key_spec.rb +0 -135
  55. data/spec/unit/operations/negation_spec.rb +0 -51
  56. data/spec/unit/operations/or_spec.rb +0 -75
  57. data/spec/unit/operations/set_spec.rb +0 -43
  58. data/spec/unit/operations/xor_spec.rb +0 -63
  59. data/spec/unit/predicates/array_spec.rb +0 -43
  60. data/spec/unit/predicates/attr_spec.rb +0 -31
  61. data/spec/unit/predicates/bool_spec.rb +0 -36
  62. data/spec/unit/predicates/case_spec.rb +0 -35
  63. data/spec/unit/predicates/date_spec.rb +0 -33
  64. data/spec/unit/predicates/date_time_spec.rb +0 -33
  65. data/spec/unit/predicates/decimal_spec.rb +0 -34
  66. data/spec/unit/predicates/empty_spec.rb +0 -40
  67. data/spec/unit/predicates/eql_spec.rb +0 -23
  68. data/spec/unit/predicates/even_spec.rb +0 -33
  69. data/spec/unit/predicates/excluded_from_spec.rb +0 -37
  70. data/spec/unit/predicates/excludes_spec.rb +0 -58
  71. data/spec/unit/predicates/false_spec.rb +0 -37
  72. data/spec/unit/predicates/filled_spec.rb +0 -40
  73. data/spec/unit/predicates/float_spec.rb +0 -33
  74. data/spec/unit/predicates/format_spec.rb +0 -23
  75. data/spec/unit/predicates/gt_spec.rb +0 -42
  76. data/spec/unit/predicates/gteq_spec.rb +0 -42
  77. data/spec/unit/predicates/included_in_spec.rb +0 -37
  78. data/spec/unit/predicates/includes_spec.rb +0 -24
  79. data/spec/unit/predicates/int_spec.rb +0 -36
  80. data/spec/unit/predicates/key_spec.rb +0 -31
  81. data/spec/unit/predicates/lt_spec.rb +0 -42
  82. data/spec/unit/predicates/lteq_spec.rb +0 -42
  83. data/spec/unit/predicates/max_size_spec.rb +0 -51
  84. data/spec/unit/predicates/min_size_spec.rb +0 -51
  85. data/spec/unit/predicates/none_spec.rb +0 -30
  86. data/spec/unit/predicates/not_eql_spec.rb +0 -23
  87. data/spec/unit/predicates/number_spec.rb +0 -39
  88. data/spec/unit/predicates/odd_spec.rb +0 -33
  89. data/spec/unit/predicates/respond_to_spec.rb +0 -31
  90. data/spec/unit/predicates/size_spec.rb +0 -57
  91. data/spec/unit/predicates/str_spec.rb +0 -34
  92. data/spec/unit/predicates/time_spec.rb +0 -33
  93. data/spec/unit/predicates/true_spec.rb +0 -37
  94. data/spec/unit/predicates/type_spec.rb +0 -37
  95. data/spec/unit/predicates/uuid_v4_spec.rb +0 -29
  96. data/spec/unit/predicates_spec.rb +0 -25
  97. data/spec/unit/rule/predicate_spec.rb +0 -55
  98. data/spec/unit/rule_compiler_spec.rb +0 -129
  99. data/spec/unit/rule_spec.rb +0 -213
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '092fd6393e21a754ce653a7b24dfdcb2dacb719723b9e3bb6607c2ba73962bde'
4
- data.tar.gz: 3b3a2407f0cdf5f4d17c3bae1888f32d8c63ca666cecc5d6266ee4604ce6f551
3
+ metadata.gz: 828bea190b3733a29b940d0fa6bbb1270bb12ee6bbbef77d1ce6bbfd7ff11a27
4
+ data.tar.gz: 319087e0aa57490d3a0bbff76efd6b01119a55135de7dbe0829d64cfee604d82
5
5
  SHA512:
6
- metadata.gz: a0ddca4a58b60a896077cc5c1d4b66e4c54470fb4182475e343bc90e3cdb6ec0e913784fc0c992c6e247532cfcdd50c2d47f48f467f443b71cab0f92fbf5d6da
7
- data.tar.gz: a164d2b12242437c48d035e0cb139b1a24373d1d79f074d6b718fb81e7a6303f23cfc85c352fbfe8fdd9adf9602e44049d0bdcb15689d376b43a5b56fce549a6
6
+ metadata.gz: 5e3d3d3d7c486aec5e4c01ebc15f90ba485dfe4d10086c11a732ea3ffac5749de02b4ecc0fb0beafe8bcc593fa07286c1c8c30f2973baaf70598a3f212e949eb
7
+ data.tar.gz: beb0445b376e9e8f545615d69af4c7cc1ad76db1ac55de9bd54784d8ff914165afec81ce174843efac5cffeda8bba494bca9e686d75052f00dee87abbfef03b3
@@ -1,39 +1,112 @@
1
- # v1.0.1 2019-06-04 (yanked)
1
+ ## 1.0.7 2020-08-13
2
+
3
+
4
+ ### Added
5
+
6
+ - A new `uri?` predicate that you can use to verify `URI` strings, ie `uri?("https", "https://dry-rb.org")` (@nerburish)
7
+ - New predicates: `uuid_v1?`, `uuid_v2?`, `uuid_v3?` and `uuid_v5?` (via #75) (@jamesbrauman)
8
+
9
+
10
+ [Compare v1.0.6...v1.0.7](https://github.com/dry-rb/dry-logic/compare/v1.0.6...v1.0.7)
11
+
12
+ ## 1.0.6 2020-02-10
13
+
14
+
15
+ ### Fixed
16
+
17
+ - Made the regexp used by `uuid_v4?` more secure (@kml)
18
+
19
+
20
+ [Compare v1.0.5...v1.0.6](https://github.com/dry-rb/dry-logic/compare/v1.0.5...v1.0.6)
21
+
22
+ ## 1.0.5 2019-11-07
23
+
24
+
25
+ ### Fixed
26
+
27
+ - 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)
28
+
29
+
30
+ [Compare v1.0.4...v1.0.5](https://github.com/dry-rb/dry-logic/compare/v1.0.4...v1.0.5)
31
+
32
+ ## 1.0.4 2019-11-06
33
+
34
+
35
+ ### Fixed
36
+
37
+ - Fix keyword warnings (@flash-gordon)
38
+
39
+
40
+ [Compare v1.0.3...v1.0.4](https://github.com/dry-rb/dry-logic/compare/v1.0.3...v1.0.4)
41
+
42
+ ## 1.0.3 2019-08-01
43
+
44
+
45
+ ### Added
46
+
47
+ - `bytesize?` predicate (@bmalinconico)
48
+ - `min_bytesize?` predicate (@bmalinconico)
49
+ - `max_bytesize? predicate (@bmalinconico)
50
+
51
+ ### Changed
52
+
53
+ - Min ruby version was set to `>= 2.4.0` (@flash-gordon)
54
+
55
+ [Compare v1.0.2...v1.0.3](https://github.com/dry-rb/dry-logic/compare/v1.0.2...v1.0.3)
56
+
57
+ ## 1.0.2 2019-06-14
58
+
59
+ Re-pushed 1.0.1 after dry-schema 1.2.0 release.
60
+
61
+
62
+ [Compare v1.0.1...v1.0.2](https://github.com/dry-rb/dry-logic/compare/v1.0.1...v1.0.2)
63
+
64
+ ## 1.0.1 2019-06-04
65
+
66
+ This release was removed from rubygems because it broke dry-schema.
2
67
 
3
68
  ### Added
4
69
 
5
70
  - `uuid_v4?` predicate (radar)
6
71
  - `respond_to?` predicate (waiting-for-dev)
7
72
 
73
+
8
74
  [Compare v1.0.0...v1.0.1](https://github.com/dry-rb/dry-logic/compare/v1.0.0...v1.0.1)
9
75
 
10
- This release was removed from rubygems because it broke dry-schema.
76
+ ## 1.0.0 2019-04-23
77
+
11
78
 
12
- # v1.0.0 2019-04-23
79
+ ### Changed
13
80
 
14
- * Version bump to `1.0.0` (flash-gordon)
81
+ - Version bump to `1.0.0` (flash-gordon)
15
82
 
16
83
  [Compare v0.6.1...v1.0.0](https://github.com/dry-rb/dry-logic/compare/v0.6.1...v1.0.0)
17
84
 
18
- # v0.6.1 2019-04-18
85
+ ## 0.6.1 2019-04-18
86
+
87
+
88
+ ### Fixed
89
+
90
+ - Fix a regression in dry-validation 0.x for argument-less predicates (flash-gordon)
19
91
 
20
- * Fix a regression in dry-validation 0.x for argument-less predicates (flash-gordon)
21
92
 
22
93
  [Compare v0.6.0...v0.6.1](https://github.com/dry-rb/dry-logic/compare/v0.6.0...v0.6.1)
23
94
 
24
- # v0.6.0 2019-04-04
95
+ ## 0.6.0 2019-04-04
96
+
25
97
 
26
98
  ### Added
27
99
 
28
- * Generating hints can be disabled by building `Operations::And` with `hints: false` option set (solnic)
100
+ - Generating hints can be disabled by building `Operations::And` with `hints: false` option set (solnic)
29
101
 
30
102
  ### Changed
31
103
 
32
- * `Rule` construction has been optimized so that currying and application is multiple-times faster (flash-gordon)
104
+ - `Rule` construction has been optimized so that currying and application is multiple-times faster (flash-gordon)
33
105
 
34
106
  [Compare v0.5.0...v0.6.0](https://github.com/dry-rb/dry-logic/compare/v0.5.0...v0.6.0)
35
107
 
36
- # v0.5.0 2019-01-29
108
+ ## 0.5.0 2019-01-29
109
+
37
110
 
38
111
  ### Added
39
112
 
@@ -43,9 +116,11 @@ This release was removed from rubygems because it broke dry-schema.
43
116
 
44
117
  - `Operation::Key#ast` will now return a correct AST with non-Undefined inputs (solnic)
45
118
 
119
+
46
120
  [Compare v0.4.2...v0.5.0](https://github.com/dry-rb/dry-logic/compare/v0.4.2...v0.5.0)
47
121
 
48
- # v0.4.2 2017-09-15
122
+ ## 0.4.2 2017-09-15
123
+
49
124
 
50
125
  ### Added
51
126
 
@@ -56,21 +131,23 @@ This release was removed from rubygems because it broke dry-schema.
56
131
 
57
132
  - A bug with using custom predicates within a standalone module in `dry-validation` (flash-gordon)
58
133
 
134
+
59
135
  [Compare v0.4.1...v0.4.2](https://github.com/dry-rb/dry-logic/compare/v0.4.1...v0.4.2)
60
136
 
61
- # v0.4.1 2017-01-23
137
+ ## 0.4.1 2017-01-23
62
138
 
63
- ### Changed
64
-
65
- - Predicates simply reuse other predicate methods instead of referring to them via `#[]` (georgemillo)
66
139
 
67
140
  ### Fixed
68
141
 
69
142
  - Warnings on MRI 2.4.0 are gone (jtippett)
70
143
 
144
+ ### Changed
145
+
146
+ - Predicates simply reuse other predicate methods instead of referring to them via `#[]` (georgemillo)
147
+
71
148
  [Compare v0.4.0...v0.4.1](https://github.com/dry-rb/dry-logic/compare/v0.4.0...v0.4.1)
72
149
 
73
- # v0.4.0 2016-09-21
150
+ ## 0.4.0 2016-09-21
74
151
 
75
152
  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.
76
153
 
@@ -98,7 +175,8 @@ This is a partial rewrite focused on internal clean up and major performance imp
98
175
 
99
176
  [Compare v0.3.0...v0.4.0](https://github.com/dry-rb/dry-logic/compare/v0.3.0...v0.4.0)
100
177
 
101
- # v0.3.0 2016-07-01
178
+ ## 0.3.0 2016-07-01
179
+
102
180
 
103
181
  ### Added
104
182
 
@@ -113,7 +191,8 @@ This is a partial rewrite focused on internal clean up and major performance imp
113
191
 
114
192
  [Compare v0.2.3...v0.3.0](https://github.com/dry-rb/dry-logic/compare/v0.2.3...v0.3.0)
115
193
 
116
- # v0.2.3 2016-05-11
194
+ ## 0.2.3 2016-05-11
195
+
117
196
 
118
197
  ### Added
119
198
 
@@ -126,21 +205,28 @@ This is a partial rewrite focused on internal clean up and major performance imp
126
205
 
127
206
  [Compare v0.2.2...v0.2.3](https://github.com/dry-rb/dry-logic/compare/v0.2.2...v0.2.3)
128
207
 
129
- # v0.2.2 2016-03-30
208
+ ## 0.2.2 2016-03-30
209
+
130
210
 
131
211
  ### Added
132
212
 
133
213
  - `number?`, `odd?`, `even?` predicates (fran-worley)
134
214
 
215
+
135
216
  [Compare v0.2.1...v0.2.2](https://github.com/dry-rb/dry-logic/compare/v0.2.1...v0.2.2)
136
217
 
137
- # v0.2.1 2016-03-20
218
+ ## 0.2.1 2016-03-20
219
+
138
220
 
139
221
  ### Fixed
140
222
 
141
223
  - Result AST for `Rule::Each` correctly maps elements with eql inputs (solnic)
142
224
 
143
- # v0.2.0 2016-03-11
225
+
226
+ [Compare v0.2.0...v0.2.1](https://github.com/dry-rb/dry-logic/compare/v0.2.0...v0.2.1)
227
+
228
+ ## 0.2.0 2016-03-11
229
+
144
230
 
145
231
  ### Changed
146
232
 
@@ -148,16 +234,19 @@ This is a partial rewrite focused on internal clean up and major performance imp
148
234
 
149
235
  [Compare v0.1.4...v0.2.0](https://github.com/dry-rb/dry-logic/compare/v0.1.4...v0.2.0)
150
236
 
151
- # v0.1.4 2016-01-27
237
+ ## 0.1.4 2016-01-27
238
+
152
239
 
153
240
  ### Added
154
241
 
155
242
  - Support for hash-names in `Check` and `Result` which can properly resolve input
156
243
  from nested results (solnic)
157
244
 
245
+
158
246
  [Compare v0.1.3...v0.1.4](https://github.com/dry-rb/dry-logic/compare/v0.1.3...v0.1.4)
159
247
 
160
- # v0.1.3 2016-01-27
248
+ ## 0.1.3 2016-01-27
249
+
161
250
 
162
251
  ### Added
163
252
 
@@ -169,15 +258,18 @@ This is a partial rewrite focused on internal clean up and major performance imp
169
258
 
170
259
  [Compare v0.1.2...v0.1.3](https://github.com/dry-rb/dry-logic/compare/v0.1.2...v0.1.3)
171
260
 
172
- # v0.1.2 2016-01-19
261
+ ## 0.1.2 2016-01-19
262
+
173
263
 
174
264
  ### Fixed
175
265
 
176
266
  - `xor` returns wrapped results when used against another result-rule (solnic)
177
267
 
268
+
178
269
  [Compare v0.1.1...v0.1.2](https://github.com/dry-rb/dry-logic/compare/v0.1.1...v0.1.2)
179
270
 
180
- # v0.1.1 2016-01-18
271
+ ## 0.1.1 2016-01-18
272
+
181
273
 
182
274
  ### Added
183
275
 
@@ -185,8 +277,9 @@ This is a partial rewrite focused on internal clean up and major performance imp
185
277
  - `Rule::Result` which can be applied to a result object (solnic)
186
278
  - `true?` and `false?` predicates (solnic)
187
279
 
280
+
188
281
  [Compare v0.1.0...v0.1.1](https://github.com/dry-rb/dry-logic/compare/v0.1.0...v0.1.1)
189
282
 
190
- # v0.1.0 2016-01-11
283
+ ## 0.1.0 2016-01-11
191
284
 
192
285
  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,30 +1,28 @@
1
1
  [gem]: https://rubygems.org/gems/dry-logic
2
- [travis]: https://travis-ci.org/dry-rb/dry-logic
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://travis-ci.org/dry-rb/dry-logic.svg?branch=master)][travis]
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.4`
25
+ * jruby >= `9.2`
28
26
 
29
27
  ## License
30
28
 
@@ -1,25 +1,38 @@
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
22
 
18
- spec.add_runtime_dependency 'concurrent-ruby', '~> 1.0'
19
- spec.add_runtime_dependency 'dry-core', '~> 0.2'
20
- 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'
21
27
 
22
- spec.add_development_dependency 'bundler'
23
- spec.add_development_dependency 'rake'
24
- spec.add_development_dependency 'rspec'
28
+ spec.required_ruby_version = ">= 2.4.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.2"
33
+ spec.add_runtime_dependency "dry-equalizer", "~> 0.2"
34
+
35
+ spec.add_development_dependency "bundler"
36
+ spec.add_development_dependency "rake"
37
+ spec.add_development_dependency "rspec"
25
38
  end
@@ -1,3 +1,3 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'dry/logic'
3
+ require "dry/logic"
@@ -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/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"
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'dry/core/constants'
4
- require 'dry/equalizer'
5
- require 'dry/logic/operators'
3
+ require "dry/core/constants"
4
+ require "dry/equalizer"
5
+ require "dry/logic/operators"
6
6
 
7
7
  module Dry
8
8
  module Logic
@@ -26,15 +26,15 @@ module Dry
26
26
  end
27
27
 
28
28
  def curry(*args)
29
- new(rules.map { |rule| rule.curry(*args) }, options)
29
+ new(rules.map { |rule| rule.curry(*args) }, **options)
30
30
  end
31
31
 
32
32
  def new(rules, **new_options)
33
- self.class.new(*rules, options.merge(new_options))
33
+ self.class.new(*rules, **options, **new_options)
34
34
  end
35
35
 
36
36
  def with(new_options)
37
- new(rules, options.merge(new_options))
37
+ new(rules, **options, **new_options)
38
38
  end
39
39
 
40
40
  def to_ast