json-logic-rb 0.1.5 → 0.2.0
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.
- checksums.yaml +4 -4
- data/README.md +197 -197
- data/lib/json_logic/engine.rb +22 -21
- data/lib/json_logic/enumerable_operation.rb +27 -5
- data/lib/json_logic/errors/error.rb +29 -0
- data/lib/json_logic/errors/invalid_arguments_error.rb +7 -0
- data/lib/json_logic/errors/logic_error.rb +7 -0
- data/lib/json_logic/errors/nan_error.rb +7 -0
- data/lib/json_logic/ext/array.rb +5 -0
- data/lib/json_logic/operations/add.rb +3 -3
- data/lib/json_logic/operations/all.rb +3 -6
- data/lib/json_logic/operations/and.rb +6 -5
- data/lib/json_logic/operations/bool_cast.rb +2 -3
- data/lib/json_logic/operations/cat.rb +3 -1
- data/lib/json_logic/operations/coalesce.rb +9 -0
- data/lib/json_logic/operations/div.rb +7 -1
- data/lib/json_logic/operations/equal.rb +12 -3
- data/lib/json_logic/operations/exists.rb +14 -0
- data/lib/json_logic/operations/filter.rb +11 -3
- data/lib/json_logic/operations/gt.rb +12 -4
- data/lib/json_logic/operations/gte.rb +12 -4
- data/lib/json_logic/operations/if.rb +2 -0
- data/lib/json_logic/operations/in.rb +2 -0
- data/lib/json_logic/operations/lt.rb +10 -4
- data/lib/json_logic/operations/lte.rb +12 -4
- data/lib/json_logic/operations/map.rb +14 -2
- data/lib/json_logic/operations/max.rb +3 -1
- data/lib/json_logic/operations/merge.rb +4 -3
- data/lib/json_logic/operations/min.rb +3 -1
- data/lib/json_logic/operations/missing.rb +4 -26
- data/lib/json_logic/operations/missing_some.rb +6 -20
- data/lib/json_logic/operations/mod.rb +9 -1
- data/lib/json_logic/operations/mul.rb +4 -1
- data/lib/json_logic/operations/none.rb +4 -5
- data/lib/json_logic/operations/not_equal.rb +12 -3
- data/lib/json_logic/operations/or.rb +5 -1
- data/lib/json_logic/operations/preserve.rb +9 -0
- data/lib/json_logic/operations/reduce.rb +21 -5
- data/lib/json_logic/operations/some.rb +4 -7
- data/lib/json_logic/operations/strict_equal.rb +26 -3
- data/lib/json_logic/operations/strict_not_equal.rb +24 -3
- data/lib/json_logic/operations/sub.rb +8 -1
- data/lib/json_logic/operations/substr.rb +12 -20
- data/lib/json_logic/operations/ternary.rb +1 -7
- data/lib/json_logic/operations/throw.rb +12 -0
- data/lib/json_logic/operations/try.rb +35 -0
- data/lib/json_logic/operations/val.rb +79 -0
- data/lib/json_logic/operations/var.rb +22 -20
- data/lib/json_logic/scope.rb +67 -0
- data/lib/json_logic/semantics.rb +107 -38
- data/lib/json_logic/tree.rb +97 -0
- data/lib/json_logic/version.rb +1 -1
- data/lib/json_logic.rb +12 -0
- data/script/build_tests_json.rb +26 -0
- data/script/compliance.rb +160 -37
- data/spec/tmp/v2/tests.json +16981 -0
- metadata +24 -13
- /data/spec/tmp/{tests.json → v1/tests.json} +0 -0
metadata
CHANGED
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: json-logic-rb
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tavrel Kate
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 2026-02-18 00:00:00.000000000 Z
|
|
12
11
|
dependencies: []
|
|
13
12
|
description: Ruby implementation of JsonLogic. JsonLogic rules are JSON trees. The
|
|
14
|
-
engine walks that tree and returns a Ruby value.
|
|
15
|
-
|
|
16
|
-
email:
|
|
13
|
+
engine walks that tree and returns a Ruby value. Full compliance with both core
|
|
14
|
+
and community-extended specifications.
|
|
17
15
|
executables: []
|
|
18
16
|
extensions: []
|
|
19
17
|
extra_rdoc_files: []
|
|
@@ -23,6 +21,11 @@ files:
|
|
|
23
21
|
- lib/json_logic.rb
|
|
24
22
|
- lib/json_logic/engine.rb
|
|
25
23
|
- lib/json_logic/enumerable_operation.rb
|
|
24
|
+
- lib/json_logic/errors/error.rb
|
|
25
|
+
- lib/json_logic/errors/invalid_arguments_error.rb
|
|
26
|
+
- lib/json_logic/errors/logic_error.rb
|
|
27
|
+
- lib/json_logic/errors/nan_error.rb
|
|
28
|
+
- lib/json_logic/ext/array.rb
|
|
26
29
|
- lib/json_logic/lazy_operation.rb
|
|
27
30
|
- lib/json_logic/operation.rb
|
|
28
31
|
- lib/json_logic/operations/add.rb
|
|
@@ -30,8 +33,10 @@ files:
|
|
|
30
33
|
- lib/json_logic/operations/and.rb
|
|
31
34
|
- lib/json_logic/operations/bool_cast.rb
|
|
32
35
|
- lib/json_logic/operations/cat.rb
|
|
36
|
+
- lib/json_logic/operations/coalesce.rb
|
|
33
37
|
- lib/json_logic/operations/div.rb
|
|
34
38
|
- lib/json_logic/operations/equal.rb
|
|
39
|
+
- lib/json_logic/operations/exists.rb
|
|
35
40
|
- lib/json_logic/operations/filter.rb
|
|
36
41
|
- lib/json_logic/operations/gt.rb
|
|
37
42
|
- lib/json_logic/operations/gte.rb
|
|
@@ -51,6 +56,7 @@ files:
|
|
|
51
56
|
- lib/json_logic/operations/not.rb
|
|
52
57
|
- lib/json_logic/operations/not_equal.rb
|
|
53
58
|
- lib/json_logic/operations/or.rb
|
|
59
|
+
- lib/json_logic/operations/preserve.rb
|
|
54
60
|
- lib/json_logic/operations/reduce.rb
|
|
55
61
|
- lib/json_logic/operations/some.rb
|
|
56
62
|
- lib/json_logic/operations/strict_equal.rb
|
|
@@ -58,22 +64,28 @@ files:
|
|
|
58
64
|
- lib/json_logic/operations/sub.rb
|
|
59
65
|
- lib/json_logic/operations/substr.rb
|
|
60
66
|
- lib/json_logic/operations/ternary.rb
|
|
67
|
+
- lib/json_logic/operations/throw.rb
|
|
68
|
+
- lib/json_logic/operations/try.rb
|
|
69
|
+
- lib/json_logic/operations/val.rb
|
|
61
70
|
- lib/json_logic/operations/var.rb
|
|
62
71
|
- lib/json_logic/registry.rb
|
|
72
|
+
- lib/json_logic/scope.rb
|
|
63
73
|
- lib/json_logic/semantics.rb
|
|
74
|
+
- lib/json_logic/tree.rb
|
|
64
75
|
- lib/json_logic/version.rb
|
|
76
|
+
- script/build_tests_json.rb
|
|
65
77
|
- script/compliance.rb
|
|
66
|
-
- spec/tmp/tests.json
|
|
78
|
+
- spec/tmp/v1/tests.json
|
|
79
|
+
- spec/tmp/v2/tests.json
|
|
67
80
|
- test/selftest.rb
|
|
68
|
-
homepage: https://
|
|
81
|
+
homepage: https://jsonlogic.com
|
|
69
82
|
licenses:
|
|
70
83
|
- MIT
|
|
71
84
|
metadata:
|
|
72
|
-
homepage_uri: https://
|
|
85
|
+
homepage_uri: https://jsonlogic.com
|
|
73
86
|
source_code_uri: https://github.com/tavrelkate/json-logic-rb
|
|
74
87
|
documentation_uri: https://github.com/tavrelkate/json-logic-rb
|
|
75
88
|
changelog_uri: https://github.com/tavrelkate/json-logic-rb/blob/main/CHANGELOG.md
|
|
76
|
-
post_install_message:
|
|
77
89
|
rdoc_options: []
|
|
78
90
|
require_paths:
|
|
79
91
|
- lib
|
|
@@ -88,8 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
88
100
|
- !ruby/object:Gem::Version
|
|
89
101
|
version: '0'
|
|
90
102
|
requirements: []
|
|
91
|
-
rubygems_version: 3.
|
|
92
|
-
signing_key:
|
|
103
|
+
rubygems_version: 3.6.2
|
|
93
104
|
specification_version: 4
|
|
94
|
-
summary: Ruby implementation of JsonLogic
|
|
105
|
+
summary: Ruby implementation of JsonLogic. Pure and extensible. Full compliance.
|
|
95
106
|
test_files: []
|
|
File without changes
|