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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e606b70876145a81ca93c1f7368b12dd721482a7307c665b2e30377397c718e9
4
- data.tar.gz: ac30778c9cff352f359fc2c9d0645114e600d4614e04f62394a76f2557d5386d
3
+ metadata.gz: fa02c7e8e3cf7d9c5edfef7487f4ec85181a355981c74d888b0d4ced62a6b381
4
+ data.tar.gz: e4f22ac5bb8bc2b0c5954c29899c6b2e4a5e14b93175564412458a24230320c7
5
5
  SHA512:
6
- metadata.gz: 3f6628c68886607a5d509de45398483fa2e426e178d591640202f168e099b08ade0ffb635da3ed15ba3b2c5ad09383152c1e82ce50ccda845cb41273497255e3
7
- data.tar.gz: d37947b228f16f3cf735fd3f8a761d3edb3f35aef5ae8a1a557d3930f1cdb6aa9d3b2f115a351b87fa4e48352127c81d0f70624d24a65e0c50c5a1583c8b89af
6
+ metadata.gz: 48a7b514be4161b49a8f80a5e21ad974f53c4676a12e4326a8749c2c2652a8522be6f5d7f6b096baae5d2f09782560d5ac42e4b887dabf49c35e141cc11f3822
7
+ data.tar.gz: 5bfaba3d70512fba0a56486292c38ad5836c2d62d8d532b124c96ddfdf8faaa46fb7f0761fdd678bd7c0eb2b2fa9e5dbd846ab919fdfb2e02351800ee8fe45e9
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [0.2.5] - 2026-02-02
6
+ ### Changed
7
+ - Improves compatibility of Iterative operations
8
+
5
9
  ## [0.2.4] - 2026-02-02
6
10
  ### Changed
7
11
  - Improves compatibility of addition operator
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shiny_json_logic (0.2.4)
4
+ shiny_json_logic (0.2.5)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/badges/compat.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "label": "compat",
4
- "message": "81.5% (918/1126)",
4
+ "message": "83.3% (938/1126)",
5
5
  "color": "red"
6
6
  }
@@ -6,13 +6,28 @@ module ShinyJsonLogic
6
6
  class Base < Operations::Base
7
7
  def initialize(context)
8
8
  super
9
- Engine.new(context.dig("rules", 0), data).tap do |engine|
10
- @collection = Array.wrap(engine.call) || []
11
- self.errors = [*self.errors, *engine.errors]
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
@@ -1,3 +1,3 @@
1
1
  module ShinyJsonLogic
2
- VERSION = "0.2.4"
2
+ VERSION = "0.2.5"
3
3
  end
data/results/ruby.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "totals": {
3
3
  "shiny_json_logic": {
4
- "passed": 938,
4
+ "passed": 945,
5
5
  "total": 1126
6
6
  }
7
7
  }
@@ -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
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, test-driven,
99
- and designed for strict spec alignment and predictable behavior. It currently offers
100
- the highest support for JSON Logic operations in the Ruby ecosystem.\n "
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, Ruby 2.7+,
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: []