shiny_json_logic 0.2.4 → 0.2.5
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/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/badges/compat.json +1 -1
- data/lib/shiny_json_logic/operations/iterable/base.rb +25 -3
- data/lib/shiny_json_logic/version.rb +1 -1
- data/results/ruby.json +1 -1
- data/shiny_json_logic.gemspec +2 -2
- metadata +7 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fa02c7e8e3cf7d9c5edfef7487f4ec85181a355981c74d888b0d4ced62a6b381
|
|
4
|
+
data.tar.gz: e4f22ac5bb8bc2b0c5954c29899c6b2e4a5e14b93175564412458a24230320c7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 48a7b514be4161b49a8f80a5e21ad974f53c4676a12e4326a8749c2c2652a8522be6f5d7f6b096baae5d2f09782560d5ac42e4b887dabf49c35e141cc11f3822
|
|
7
|
+
data.tar.gz: 5bfaba3d70512fba0a56486292c38ad5836c2d62d8d532b124c96ddfdf8faaa46fb7f0761fdd678bd7c0eb2b2fa9e5dbd846ab919fdfb2e02351800ee8fe45e9
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/badges/compat.json
CHANGED
|
@@ -6,13 +6,28 @@ module ShinyJsonLogic
|
|
|
6
6
|
class Base < Operations::Base
|
|
7
7
|
def initialize(context)
|
|
8
8
|
super
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
collection = context.dig("rules", 0)
|
|
10
|
+
return handle_nil_collection if collection.nil?
|
|
11
|
+
|
|
12
|
+
if collection.nil?
|
|
13
|
+
@collection = []
|
|
14
|
+
else
|
|
15
|
+
Engine.new(collection, data).tap do |engine|
|
|
16
|
+
call = engine.call
|
|
17
|
+
@collection = Array.wrap(call)
|
|
18
|
+
self.errors = [*self.errors, *engine.errors]
|
|
19
|
+
end
|
|
12
20
|
end
|
|
21
|
+
|
|
13
22
|
@filter = rules[1]
|
|
14
23
|
end
|
|
15
24
|
|
|
25
|
+
def call
|
|
26
|
+
return deliver(errors) if errors.any?
|
|
27
|
+
|
|
28
|
+
deliver run
|
|
29
|
+
end
|
|
30
|
+
|
|
16
31
|
protected
|
|
17
32
|
|
|
18
33
|
def run
|
|
@@ -57,6 +72,13 @@ module ShinyJsonLogic
|
|
|
57
72
|
""
|
|
58
73
|
end
|
|
59
74
|
|
|
75
|
+
def handle_nil_collection
|
|
76
|
+
error = Errors::Base.new(type: "Invalid Arguments")
|
|
77
|
+
self.errors = [error]
|
|
78
|
+
|
|
79
|
+
error.id
|
|
80
|
+
end
|
|
81
|
+
|
|
60
82
|
attr_reader :collection, :filter
|
|
61
83
|
end
|
|
62
84
|
end
|
data/results/ruby.json
CHANGED
data/shiny_json_logic.gemspec
CHANGED
|
@@ -9,9 +9,9 @@ Gem::Specification.new do |spec|
|
|
|
9
9
|
spec.authors = ["Luis Moyano"]
|
|
10
10
|
spec.email = ["moyano@hey.com"]
|
|
11
11
|
|
|
12
|
-
spec.summary = "Production-ready JSON Logic for Ruby that just works: zero deps, Ruby 2.7+, high spec alignment."
|
|
12
|
+
spec.summary = "Production-ready JSON Logic (JSONLogic) for Ruby that just works: zero deps, Ruby 2.7+, high spec alignment."
|
|
13
13
|
spec.description = %q{
|
|
14
|
-
ShinyJsonLogic is a pure-Ruby, zero-runtime-dependency implementation of the JSON Logic specification. Ruby 2.7+ compatible, actively maintained, test-driven, and designed for strict spec alignment and predictable behavior. It currently offers the highest support for JSON Logic operations in the Ruby ecosystem.
|
|
14
|
+
ShinyJsonLogic is a pure-Ruby, zero-runtime-dependency implementation of the JSON Logic (JSONLogic) specification. Ruby 2.7+ compatible, actively maintained, test-driven, and designed for strict spec alignment and predictable behavior. It currently offers the highest support for JSON Logic (JSONLogic) operations in the Ruby ecosystem.
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
spec.homepage = "https://github.com/luismoyano/shiny-json-logic-ruby"
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: shiny_json_logic
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Luis Moyano
|
|
@@ -95,9 +95,10 @@ dependencies:
|
|
|
95
95
|
- !ruby/object:Gem::Version
|
|
96
96
|
version: '0'
|
|
97
97
|
description: "\n ShinyJsonLogic is a pure-Ruby, zero-runtime-dependency implementation
|
|
98
|
-
of the JSON Logic specification. Ruby 2.7+ compatible, actively maintained,
|
|
99
|
-
and designed for strict spec alignment and predictable behavior. It
|
|
100
|
-
the highest support for JSON Logic operations in the
|
|
98
|
+
of the JSON Logic (JSONLogic) specification. Ruby 2.7+ compatible, actively maintained,
|
|
99
|
+
test-driven, and designed for strict spec alignment and predictable behavior. It
|
|
100
|
+
currently offers the highest support for JSON Logic (JSONLogic) operations in the
|
|
101
|
+
Ruby ecosystem.\n "
|
|
101
102
|
email:
|
|
102
103
|
- moyano@hey.com
|
|
103
104
|
executables: []
|
|
@@ -204,6 +205,6 @@ requirements: []
|
|
|
204
205
|
rubygems_version: 3.1.6
|
|
205
206
|
signing_key:
|
|
206
207
|
specification_version: 4
|
|
207
|
-
summary: 'Production-ready JSON Logic for Ruby that just works: zero deps,
|
|
208
|
-
high spec alignment.'
|
|
208
|
+
summary: 'Production-ready JSON Logic (JSONLogic) for Ruby that just works: zero deps,
|
|
209
|
+
Ruby 2.7+, high spec alignment.'
|
|
209
210
|
test_files: []
|