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.
- checksums.yaml +5 -5
- data/CHANGELOG.md +214 -53
- data/LICENSE +1 -1
- data/README.md +14 -18
- data/dry-logic.gemspec +28 -15
- data/lib/dry-logic.rb +3 -1
- data/lib/dry/logic.rb +4 -2
- data/lib/dry/logic/appliable.rb +2 -0
- data/lib/dry/logic/evaluator.rb +3 -1
- data/lib/dry/logic/operations.rb +13 -11
- data/lib/dry/logic/operations/abstract.rb +8 -6
- data/lib/dry/logic/operations/and.rb +15 -3
- data/lib/dry/logic/operations/attr.rb +3 -1
- data/lib/dry/logic/operations/binary.rb +3 -1
- data/lib/dry/logic/operations/check.rb +6 -4
- data/lib/dry/logic/operations/each.rb +4 -2
- data/lib/dry/logic/operations/implication.rb +4 -2
- data/lib/dry/logic/operations/key.rb +11 -9
- data/lib/dry/logic/operations/negation.rb +9 -3
- data/lib/dry/logic/operations/or.rb +4 -2
- data/lib/dry/logic/operations/set.rb +5 -3
- data/lib/dry/logic/operations/unary.rb +3 -1
- data/lib/dry/logic/operations/xor.rb +4 -2
- data/lib/dry/logic/operators.rb +6 -4
- data/lib/dry/logic/predicates.rb +72 -28
- data/lib/dry/logic/result.rb +4 -2
- data/lib/dry/logic/rule.rb +35 -30
- data/lib/dry/logic/rule/interface.rb +141 -0
- data/lib/dry/logic/rule/predicate.rb +9 -3
- data/lib/dry/logic/rule_compiler.rb +7 -3
- data/lib/dry/logic/version.rb +3 -1
- metadata +21 -151
- data/.codeclimate.yml +0 -23
- data/.gitignore +0 -8
- data/.rspec +0 -3
- data/.rubocop.yml +0 -16
- data/.rubocop_todo.yml +0 -7
- data/.travis.yml +0 -31
- data/CONTRIBUTING.md +0 -29
- data/Gemfile +0 -18
- data/Rakefile +0 -12
- data/examples/basic.rb +0 -14
- data/spec/integration/result_spec.rb +0 -59
- data/spec/integration/rule_spec.rb +0 -53
- data/spec/shared/predicates.rb +0 -57
- data/spec/shared/rule.rb +0 -67
- data/spec/spec_helper.rb +0 -34
- data/spec/support/mutant.rb +0 -9
- data/spec/unit/operations/and_spec.rb +0 -64
- data/spec/unit/operations/attr_spec.rb +0 -27
- data/spec/unit/operations/check_spec.rb +0 -49
- data/spec/unit/operations/each_spec.rb +0 -47
- data/spec/unit/operations/implication_spec.rb +0 -30
- data/spec/unit/operations/key_spec.rb +0 -119
- data/spec/unit/operations/negation_spec.rb +0 -40
- data/spec/unit/operations/or_spec.rb +0 -73
- data/spec/unit/operations/set_spec.rb +0 -41
- data/spec/unit/operations/xor_spec.rb +0 -61
- data/spec/unit/predicates/array_spec.rb +0 -41
- data/spec/unit/predicates/attr_spec.rb +0 -29
- data/spec/unit/predicates/bool_spec.rb +0 -34
- data/spec/unit/predicates/case_spec.rb +0 -33
- data/spec/unit/predicates/date_spec.rb +0 -31
- data/spec/unit/predicates/date_time_spec.rb +0 -31
- data/spec/unit/predicates/decimal_spec.rb +0 -32
- data/spec/unit/predicates/empty_spec.rb +0 -38
- data/spec/unit/predicates/eql_spec.rb +0 -21
- data/spec/unit/predicates/even_spec.rb +0 -31
- data/spec/unit/predicates/excluded_from_spec.rb +0 -35
- data/spec/unit/predicates/excludes_spec.rb +0 -56
- data/spec/unit/predicates/false_spec.rb +0 -35
- data/spec/unit/predicates/filled_spec.rb +0 -38
- data/spec/unit/predicates/float_spec.rb +0 -31
- data/spec/unit/predicates/format_spec.rb +0 -21
- data/spec/unit/predicates/gt_spec.rb +0 -40
- data/spec/unit/predicates/gteq_spec.rb +0 -40
- data/spec/unit/predicates/included_in_spec.rb +0 -35
- data/spec/unit/predicates/includes_spec.rb +0 -24
- data/spec/unit/predicates/int_spec.rb +0 -34
- data/spec/unit/predicates/key_spec.rb +0 -29
- data/spec/unit/predicates/lt_spec.rb +0 -40
- data/spec/unit/predicates/lteq_spec.rb +0 -40
- data/spec/unit/predicates/max_size_spec.rb +0 -49
- data/spec/unit/predicates/min_size_spec.rb +0 -49
- data/spec/unit/predicates/none_spec.rb +0 -28
- data/spec/unit/predicates/not_eql_spec.rb +0 -21
- data/spec/unit/predicates/number_spec.rb +0 -37
- data/spec/unit/predicates/odd_spec.rb +0 -31
- data/spec/unit/predicates/size_spec.rb +0 -55
- data/spec/unit/predicates/str_spec.rb +0 -32
- data/spec/unit/predicates/time_spec.rb +0 -31
- data/spec/unit/predicates/true_spec.rb +0 -35
- data/spec/unit/predicates/type_spec.rb +0 -35
- data/spec/unit/predicates_spec.rb +0 -23
- data/spec/unit/rule/predicate_spec.rb +0 -53
- data/spec/unit/rule_compiler_spec.rb +0 -127
- data/spec/unit/rule_spec.rb +0 -141
data/lib/dry/logic/result.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "dry/core/constants"
|
2
4
|
|
3
5
|
module Dry
|
4
6
|
module Logic
|
@@ -67,7 +69,7 @@ module Dry
|
|
67
69
|
if args.empty?
|
68
70
|
name.to_s
|
69
71
|
else
|
70
|
-
"#{name}(#{args.map(&:last).map(&:inspect).join(
|
72
|
+
"#{name}(#{args.map(&:last).map(&:inspect).join(", ")})"
|
71
73
|
end
|
72
74
|
end
|
73
75
|
|
data/lib/dry/logic/rule.rb
CHANGED
@@ -1,15 +1,19 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require
|
4
|
-
require
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "concurrent/map"
|
4
|
+
require "dry/core/constants"
|
5
|
+
require "dry/core/equalizer"
|
6
|
+
require "dry/logic/operations"
|
7
|
+
require "dry/logic/result"
|
8
|
+
require "dry/logic/rule/interface"
|
5
9
|
|
6
10
|
module Dry
|
7
11
|
module Logic
|
8
12
|
def self.Rule(*args, **options, &block)
|
9
13
|
if args.any?
|
10
|
-
Rule.
|
14
|
+
Rule.build(*args, **options)
|
11
15
|
elsif block
|
12
|
-
Rule.
|
16
|
+
Rule.build(block, **options)
|
13
17
|
end
|
14
18
|
end
|
15
19
|
|
@@ -18,8 +22,6 @@ module Dry
|
|
18
22
|
include Dry::Equalizer(:predicate, :options)
|
19
23
|
include Operators
|
20
24
|
|
21
|
-
DEFAULT_OPTIONS = { args: [].freeze }.freeze
|
22
|
-
|
23
25
|
attr_reader :predicate
|
24
26
|
|
25
27
|
attr_reader :options
|
@@ -28,10 +30,27 @@ module Dry
|
|
28
30
|
|
29
31
|
attr_reader :arity
|
30
32
|
|
31
|
-
def
|
33
|
+
def self.interfaces
|
34
|
+
@interfaces ||= ::Concurrent::Map.new
|
35
|
+
end
|
36
|
+
|
37
|
+
def self.specialize(arity, curried, base = Rule)
|
38
|
+
base.interfaces.fetch_or_store([arity, curried]) do
|
39
|
+
interface = Interface.new(arity, curried)
|
40
|
+
klass = Class.new(base) { include interface }
|
41
|
+
base.const_set("#{base.name.split("::").last}#{interface.name}", klass)
|
42
|
+
klass
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def self.build(predicate, args: EMPTY_ARRAY, arity: predicate.arity, **options)
|
47
|
+
specialize(arity, args.size).new(predicate, {args: args, arity: arity, **options})
|
48
|
+
end
|
49
|
+
|
50
|
+
def initialize(predicate, options = EMPTY_HASH)
|
32
51
|
@predicate = predicate
|
33
52
|
@options = options
|
34
|
-
@args = options[:args]
|
53
|
+
@args = options[:args] || EMPTY_ARRAY
|
35
54
|
@arity = options[:arity] || predicate.arity
|
36
55
|
end
|
37
56
|
|
@@ -43,31 +62,17 @@ module Dry
|
|
43
62
|
options[:id]
|
44
63
|
end
|
45
64
|
|
46
|
-
def call(*input)
|
47
|
-
Result.new(self[*input], id) { ast(*input) }
|
48
|
-
end
|
49
|
-
|
50
|
-
def [](*input)
|
51
|
-
arity == 0 ? predicate.() : predicate[*args, *input]
|
52
|
-
end
|
53
|
-
|
54
65
|
def curry(*new_args)
|
55
|
-
|
56
|
-
|
57
|
-
if all_args.size > arity
|
58
|
-
raise ArgumentError, "wrong number of arguments (#{all_args.size} for #{arity})"
|
59
|
-
else
|
60
|
-
with(args: all_args)
|
61
|
-
end
|
66
|
+
with(args: args + new_args)
|
62
67
|
end
|
63
68
|
|
64
69
|
def bind(object)
|
65
|
-
if
|
66
|
-
self.class.
|
70
|
+
if predicate.respond_to?(:bind)
|
71
|
+
self.class.build(predicate.bind(object), **options)
|
67
72
|
else
|
68
|
-
self.class.
|
73
|
+
self.class.build(
|
69
74
|
-> *args { object.instance_exec(*args, &predicate) },
|
70
|
-
options
|
75
|
+
**options, arity: arity, parameters: parameters
|
71
76
|
)
|
72
77
|
end
|
73
78
|
end
|
@@ -77,7 +82,7 @@ module Dry
|
|
77
82
|
end
|
78
83
|
|
79
84
|
def with(new_opts)
|
80
|
-
self.class.
|
85
|
+
self.class.build(predicate, **options, **new_opts)
|
81
86
|
end
|
82
87
|
|
83
88
|
def parameters
|
@@ -0,0 +1,141 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Dry
|
4
|
+
module Logic
|
5
|
+
class Rule
|
6
|
+
class Interface < ::Module
|
7
|
+
SPLAT = ["*rest"].freeze
|
8
|
+
|
9
|
+
attr_reader :arity
|
10
|
+
|
11
|
+
attr_reader :curried
|
12
|
+
|
13
|
+
def initialize(arity, curried)
|
14
|
+
@arity = arity
|
15
|
+
@curried = curried
|
16
|
+
|
17
|
+
if !variable_arity? && curried > arity
|
18
|
+
raise ArgumentError, "wrong number of arguments (#{curried} for #{arity})"
|
19
|
+
end
|
20
|
+
|
21
|
+
define_constructor if curried?
|
22
|
+
|
23
|
+
if constant?
|
24
|
+
define_constant_application
|
25
|
+
else
|
26
|
+
define_application
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def constant?
|
31
|
+
arity.zero?
|
32
|
+
end
|
33
|
+
|
34
|
+
def variable_arity?
|
35
|
+
arity.negative?
|
36
|
+
end
|
37
|
+
|
38
|
+
def curried?
|
39
|
+
!curried.zero?
|
40
|
+
end
|
41
|
+
|
42
|
+
def unapplied
|
43
|
+
if variable_arity?
|
44
|
+
unapplied = arity.abs - 1 - curried
|
45
|
+
|
46
|
+
if unapplied.negative?
|
47
|
+
0
|
48
|
+
else
|
49
|
+
unapplied
|
50
|
+
end
|
51
|
+
else
|
52
|
+
arity - curried
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
def name
|
57
|
+
if constant?
|
58
|
+
"Constant"
|
59
|
+
else
|
60
|
+
arity_str =
|
61
|
+
if variable_arity?
|
62
|
+
"Variable#{arity.abs - 1}Arity"
|
63
|
+
else
|
64
|
+
"#{arity}Arity"
|
65
|
+
end
|
66
|
+
|
67
|
+
curried_str =
|
68
|
+
if curried?
|
69
|
+
"#{curried}Curried"
|
70
|
+
else
|
71
|
+
EMPTY_STRING
|
72
|
+
end
|
73
|
+
|
74
|
+
"#{arity_str}#{curried_str}"
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
def define_constructor
|
79
|
+
assignment =
|
80
|
+
if curried.equal?(1)
|
81
|
+
"@arg0 = @args[0]"
|
82
|
+
else
|
83
|
+
"#{curried_args.join(", ")} = @args"
|
84
|
+
end
|
85
|
+
|
86
|
+
module_eval(<<~RUBY, __FILE__, __LINE__ + 1)
|
87
|
+
def initialize(*)
|
88
|
+
super
|
89
|
+
|
90
|
+
#{assignment}
|
91
|
+
end
|
92
|
+
RUBY
|
93
|
+
end
|
94
|
+
|
95
|
+
def define_constant_application
|
96
|
+
module_exec do
|
97
|
+
def call(*)
|
98
|
+
if @predicate[]
|
99
|
+
Result::SUCCESS
|
100
|
+
else
|
101
|
+
Result.new(false, id) { ast }
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
def [](*)
|
106
|
+
@predicate[]
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
def define_application
|
112
|
+
splat = variable_arity? ? SPLAT : EMPTY_ARRAY
|
113
|
+
parameters = (unapplied_args + splat).join(", ")
|
114
|
+
application = "@predicate[#{(curried_args + unapplied_args + splat).join(", ")}]"
|
115
|
+
|
116
|
+
module_eval(<<~RUBY, __FILE__, __LINE__ + 1)
|
117
|
+
def call(#{parameters})
|
118
|
+
if #{application}
|
119
|
+
Result::SUCCESS
|
120
|
+
else
|
121
|
+
Result.new(false, id) { ast(#{parameters}) }
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
def [](#{parameters})
|
126
|
+
#{application}
|
127
|
+
end
|
128
|
+
RUBY
|
129
|
+
end
|
130
|
+
|
131
|
+
def curried_args
|
132
|
+
@curried_args ||= ::Array.new(curried) { |i| "@arg#{i}" }
|
133
|
+
end
|
134
|
+
|
135
|
+
def unapplied_args
|
136
|
+
@unapplied_args ||= ::Array.new(unapplied) { |i| "input#{i}" }
|
137
|
+
end
|
138
|
+
end
|
139
|
+
end
|
140
|
+
end
|
141
|
+
end
|
@@ -1,8 +1,14 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "dry/logic/rule"
|
2
4
|
|
3
5
|
module Dry
|
4
6
|
module Logic
|
5
7
|
class Rule::Predicate < Rule
|
8
|
+
def self.specialize(arity, curried, base = Predicate)
|
9
|
+
super
|
10
|
+
end
|
11
|
+
|
6
12
|
def type
|
7
13
|
:predicate
|
8
14
|
end
|
@@ -13,9 +19,9 @@ module Dry
|
|
13
19
|
|
14
20
|
def to_s
|
15
21
|
if args.size > 0
|
16
|
-
"#{name}(#{args.map(&:inspect).join(
|
22
|
+
"#{name}(#{args.map(&:inspect).join(", ")})"
|
17
23
|
else
|
18
|
-
|
24
|
+
name.to_s
|
19
25
|
end
|
20
26
|
end
|
21
27
|
|
@@ -1,5 +1,9 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "dry/core/constants"
|
4
|
+
|
5
|
+
require "dry/logic/rule"
|
6
|
+
require "dry/logic/rule/predicate"
|
3
7
|
|
4
8
|
module Dry
|
5
9
|
module Logic
|
@@ -50,7 +54,7 @@ module Dry
|
|
50
54
|
|
51
55
|
def visit_predicate(node)
|
52
56
|
name, params = node
|
53
|
-
predicate = Rule::Predicate.
|
57
|
+
predicate = Rule::Predicate.build(predicates[name])
|
54
58
|
|
55
59
|
if params.size > 1
|
56
60
|
args = params.map(&:last).reject { |val| val == Undefined }
|
data/lib/dry/logic/version.rb
CHANGED
metadata
CHANGED
@@ -1,63 +1,49 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dry-logic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Solnica
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-12-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: concurrent-ruby
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0
|
19
|
+
version: '1.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0
|
26
|
+
version: '1.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name: dry-
|
28
|
+
name: dry-core
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0.
|
33
|
+
version: '0.5'
|
34
34
|
- - ">="
|
35
35
|
- !ruby/object:Gem::Version
|
36
|
-
version: 0.
|
36
|
+
version: '0.5'
|
37
37
|
type: :runtime
|
38
38
|
prerelease: false
|
39
39
|
version_requirements: !ruby/object:Gem::Requirement
|
40
40
|
requirements:
|
41
41
|
- - "~>"
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version: '0.
|
43
|
+
version: '0.5'
|
44
44
|
- - ">="
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: 0.
|
47
|
-
- !ruby/object:Gem::Dependency
|
48
|
-
name: dry-equalizer
|
49
|
-
requirement: !ruby/object:Gem::Requirement
|
50
|
-
requirements:
|
51
|
-
- - "~>"
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
version: '0.2'
|
54
|
-
type: :runtime
|
55
|
-
prerelease: false
|
56
|
-
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
requirements:
|
58
|
-
- - "~>"
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
version: '0.2'
|
46
|
+
version: '0.5'
|
61
47
|
- !ruby/object:Gem::Dependency
|
62
48
|
name: bundler
|
63
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -100,27 +86,17 @@ dependencies:
|
|
100
86
|
- - ">="
|
101
87
|
- !ruby/object:Gem::Version
|
102
88
|
version: '0'
|
103
|
-
description:
|
89
|
+
description: Predicate logic with rule composition
|
104
90
|
email:
|
105
91
|
- piotr.solnica@gmail.com
|
106
92
|
executables: []
|
107
93
|
extensions: []
|
108
94
|
extra_rdoc_files: []
|
109
95
|
files:
|
110
|
-
- ".codeclimate.yml"
|
111
|
-
- ".gitignore"
|
112
|
-
- ".rspec"
|
113
|
-
- ".rubocop.yml"
|
114
|
-
- ".rubocop_todo.yml"
|
115
|
-
- ".travis.yml"
|
116
96
|
- CHANGELOG.md
|
117
|
-
- CONTRIBUTING.md
|
118
|
-
- Gemfile
|
119
97
|
- LICENSE
|
120
98
|
- README.md
|
121
|
-
- Rakefile
|
122
99
|
- dry-logic.gemspec
|
123
|
-
- examples/basic.rb
|
124
100
|
- lib/dry-logic.rb
|
125
101
|
- lib/dry/logic.rb
|
126
102
|
- lib/dry/logic/appliable.rb
|
@@ -143,68 +119,18 @@ files:
|
|
143
119
|
- lib/dry/logic/predicates.rb
|
144
120
|
- lib/dry/logic/result.rb
|
145
121
|
- lib/dry/logic/rule.rb
|
122
|
+
- lib/dry/logic/rule/interface.rb
|
146
123
|
- lib/dry/logic/rule/predicate.rb
|
147
124
|
- lib/dry/logic/rule_compiler.rb
|
148
125
|
- lib/dry/logic/version.rb
|
149
|
-
-
|
150
|
-
- spec/integration/rule_spec.rb
|
151
|
-
- spec/shared/predicates.rb
|
152
|
-
- spec/shared/rule.rb
|
153
|
-
- spec/spec_helper.rb
|
154
|
-
- spec/support/mutant.rb
|
155
|
-
- spec/unit/operations/and_spec.rb
|
156
|
-
- spec/unit/operations/attr_spec.rb
|
157
|
-
- spec/unit/operations/check_spec.rb
|
158
|
-
- spec/unit/operations/each_spec.rb
|
159
|
-
- spec/unit/operations/implication_spec.rb
|
160
|
-
- spec/unit/operations/key_spec.rb
|
161
|
-
- spec/unit/operations/negation_spec.rb
|
162
|
-
- spec/unit/operations/or_spec.rb
|
163
|
-
- spec/unit/operations/set_spec.rb
|
164
|
-
- spec/unit/operations/xor_spec.rb
|
165
|
-
- spec/unit/predicates/array_spec.rb
|
166
|
-
- spec/unit/predicates/attr_spec.rb
|
167
|
-
- spec/unit/predicates/bool_spec.rb
|
168
|
-
- spec/unit/predicates/case_spec.rb
|
169
|
-
- spec/unit/predicates/date_spec.rb
|
170
|
-
- spec/unit/predicates/date_time_spec.rb
|
171
|
-
- spec/unit/predicates/decimal_spec.rb
|
172
|
-
- spec/unit/predicates/empty_spec.rb
|
173
|
-
- spec/unit/predicates/eql_spec.rb
|
174
|
-
- spec/unit/predicates/even_spec.rb
|
175
|
-
- spec/unit/predicates/excluded_from_spec.rb
|
176
|
-
- spec/unit/predicates/excludes_spec.rb
|
177
|
-
- spec/unit/predicates/false_spec.rb
|
178
|
-
- spec/unit/predicates/filled_spec.rb
|
179
|
-
- spec/unit/predicates/float_spec.rb
|
180
|
-
- spec/unit/predicates/format_spec.rb
|
181
|
-
- spec/unit/predicates/gt_spec.rb
|
182
|
-
- spec/unit/predicates/gteq_spec.rb
|
183
|
-
- spec/unit/predicates/included_in_spec.rb
|
184
|
-
- spec/unit/predicates/includes_spec.rb
|
185
|
-
- spec/unit/predicates/int_spec.rb
|
186
|
-
- spec/unit/predicates/key_spec.rb
|
187
|
-
- spec/unit/predicates/lt_spec.rb
|
188
|
-
- spec/unit/predicates/lteq_spec.rb
|
189
|
-
- spec/unit/predicates/max_size_spec.rb
|
190
|
-
- spec/unit/predicates/min_size_spec.rb
|
191
|
-
- spec/unit/predicates/none_spec.rb
|
192
|
-
- spec/unit/predicates/not_eql_spec.rb
|
193
|
-
- spec/unit/predicates/number_spec.rb
|
194
|
-
- spec/unit/predicates/odd_spec.rb
|
195
|
-
- spec/unit/predicates/size_spec.rb
|
196
|
-
- spec/unit/predicates/str_spec.rb
|
197
|
-
- spec/unit/predicates/time_spec.rb
|
198
|
-
- spec/unit/predicates/true_spec.rb
|
199
|
-
- spec/unit/predicates/type_spec.rb
|
200
|
-
- spec/unit/predicates_spec.rb
|
201
|
-
- spec/unit/rule/predicate_spec.rb
|
202
|
-
- spec/unit/rule_compiler_spec.rb
|
203
|
-
- spec/unit/rule_spec.rb
|
204
|
-
homepage: https://github.com/dry-rb/dry-logic
|
126
|
+
homepage: https://dry-rb.org/gems/dry-logic
|
205
127
|
licenses:
|
206
128
|
- MIT
|
207
|
-
metadata:
|
129
|
+
metadata:
|
130
|
+
allowed_push_host: https://rubygems.org
|
131
|
+
changelog_uri: https://github.com/dry-rb/dry-logic/blob/master/CHANGELOG.md
|
132
|
+
source_code_uri: https://github.com/dry-rb/dry-logic
|
133
|
+
bug_tracker_uri: https://github.com/dry-rb/dry-logic/issues
|
208
134
|
post_install_message:
|
209
135
|
rdoc_options: []
|
210
136
|
require_paths:
|
@@ -213,71 +139,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
213
139
|
requirements:
|
214
140
|
- - ">="
|
215
141
|
- !ruby/object:Gem::Version
|
216
|
-
version:
|
142
|
+
version: 2.5.0
|
217
143
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
218
144
|
requirements:
|
219
145
|
- - ">="
|
220
146
|
- !ruby/object:Gem::Version
|
221
147
|
version: '0'
|
222
148
|
requirements: []
|
223
|
-
|
224
|
-
rubygems_version: 2.6.11
|
149
|
+
rubygems_version: 3.1.4
|
225
150
|
signing_key:
|
226
151
|
specification_version: 4
|
227
152
|
summary: Predicate logic with rule composition
|
228
|
-
test_files:
|
229
|
-
- spec/integration/result_spec.rb
|
230
|
-
- spec/integration/rule_spec.rb
|
231
|
-
- spec/shared/predicates.rb
|
232
|
-
- spec/shared/rule.rb
|
233
|
-
- spec/spec_helper.rb
|
234
|
-
- spec/support/mutant.rb
|
235
|
-
- spec/unit/operations/and_spec.rb
|
236
|
-
- spec/unit/operations/attr_spec.rb
|
237
|
-
- spec/unit/operations/check_spec.rb
|
238
|
-
- spec/unit/operations/each_spec.rb
|
239
|
-
- spec/unit/operations/implication_spec.rb
|
240
|
-
- spec/unit/operations/key_spec.rb
|
241
|
-
- spec/unit/operations/negation_spec.rb
|
242
|
-
- spec/unit/operations/or_spec.rb
|
243
|
-
- spec/unit/operations/set_spec.rb
|
244
|
-
- spec/unit/operations/xor_spec.rb
|
245
|
-
- spec/unit/predicates/array_spec.rb
|
246
|
-
- spec/unit/predicates/attr_spec.rb
|
247
|
-
- spec/unit/predicates/bool_spec.rb
|
248
|
-
- spec/unit/predicates/case_spec.rb
|
249
|
-
- spec/unit/predicates/date_spec.rb
|
250
|
-
- spec/unit/predicates/date_time_spec.rb
|
251
|
-
- spec/unit/predicates/decimal_spec.rb
|
252
|
-
- spec/unit/predicates/empty_spec.rb
|
253
|
-
- spec/unit/predicates/eql_spec.rb
|
254
|
-
- spec/unit/predicates/even_spec.rb
|
255
|
-
- spec/unit/predicates/excluded_from_spec.rb
|
256
|
-
- spec/unit/predicates/excludes_spec.rb
|
257
|
-
- spec/unit/predicates/false_spec.rb
|
258
|
-
- spec/unit/predicates/filled_spec.rb
|
259
|
-
- spec/unit/predicates/float_spec.rb
|
260
|
-
- spec/unit/predicates/format_spec.rb
|
261
|
-
- spec/unit/predicates/gt_spec.rb
|
262
|
-
- spec/unit/predicates/gteq_spec.rb
|
263
|
-
- spec/unit/predicates/included_in_spec.rb
|
264
|
-
- spec/unit/predicates/includes_spec.rb
|
265
|
-
- spec/unit/predicates/int_spec.rb
|
266
|
-
- spec/unit/predicates/key_spec.rb
|
267
|
-
- spec/unit/predicates/lt_spec.rb
|
268
|
-
- spec/unit/predicates/lteq_spec.rb
|
269
|
-
- spec/unit/predicates/max_size_spec.rb
|
270
|
-
- spec/unit/predicates/min_size_spec.rb
|
271
|
-
- spec/unit/predicates/none_spec.rb
|
272
|
-
- spec/unit/predicates/not_eql_spec.rb
|
273
|
-
- spec/unit/predicates/number_spec.rb
|
274
|
-
- spec/unit/predicates/odd_spec.rb
|
275
|
-
- spec/unit/predicates/size_spec.rb
|
276
|
-
- spec/unit/predicates/str_spec.rb
|
277
|
-
- spec/unit/predicates/time_spec.rb
|
278
|
-
- spec/unit/predicates/true_spec.rb
|
279
|
-
- spec/unit/predicates/type_spec.rb
|
280
|
-
- spec/unit/predicates_spec.rb
|
281
|
-
- spec/unit/rule/predicate_spec.rb
|
282
|
-
- spec/unit/rule_compiler_spec.rb
|
283
|
-
- spec/unit/rule_spec.rb
|
153
|
+
test_files: []
|