dry-logic 0.6.1 → 1.0.6

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