shiny_json_logic 0.2.1 → 0.2.2

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: 29b936cfc360867d9ba05f4dbc9f0c8b952f17c6932a02b4db123fb8f9621f0b
4
- data.tar.gz: 7e8d052e9dc1b88cd5fd7e76d8a87c6554d51fd611c204877617268179984d6e
3
+ metadata.gz: ff4b2cb52b4896163788f2bb7b463a8d56df09f962be45a98264e3944ca4f505
4
+ data.tar.gz: b77fd0016b591540e980bc28f5887a89f07b8d2b232d3485bf20c20a4ccd19a3
5
5
  SHA512:
6
- metadata.gz: 4afa245d28e2a10f11d26a3a136316389c85c90517d169598cc8be61a11a77164b68a88818dd90c47e1d8767ea2449dfa1a17946cefdc52943b47696ea51b800
7
- data.tar.gz: a77c9185c0f452e8f0c76e78c351150a7975b78dda73532e458bc94ad78b479ddef26e019528f0cf4c7db01c53072f392675f8506929950a02c9f6faefff819b
6
+ metadata.gz: 59d457440b77bcd7a02ed0fbd4bd8f147e14537b0308e29ff299a8875706eb6764152eeb247f4eb947033cc18adfca88b542817e72df1f0e8b2333272a899dd2
7
+ data.tar.gz: c153f940a1f9b99e329b51215ba62563bc6ac6191bc80175a84d262e63c531dcf32bfb9488008e52af5a6ac3398710ea7b66042f0e34bdcc476bff5b63c0db15
data/CHANGELOG.md CHANGED
@@ -1,6 +1,10 @@
1
1
  # Changelog
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
+ ## [0.2.2] - 2026-02-02
5
+ ### Changed
6
+ - Improves compatibility of modulo operator
7
+
4
8
  ## [0.2.1] - 2026-02-02
5
9
  ### Changed
6
10
  - Improves compatibility of subtraction operator
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shiny_json_logic (0.2.1)
4
+ shiny_json_logic (0.2.2)
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": "78.8% (887/1126)",
4
+ "message": "80.7% (909/1126)",
5
5
  "color": "red"
6
6
  }
@@ -16,6 +16,13 @@ module ShinyJsonLogic
16
16
  errors.push error
17
17
  return error.id
18
18
  end
19
+
20
+ def handle_no_operators
21
+ error = Errors::Base.new(type: "Invalid Arguments")
22
+ self.errors << error
23
+
24
+ error.id
25
+ end
19
26
  end
20
27
  end
21
28
  end
@@ -29,13 +29,6 @@ module ShinyJsonLogic
29
29
 
30
30
  error.id
31
31
  end
32
-
33
- def handle_no_operators
34
- error = Errors::Base.new(type: "Invalid Arguments")
35
- self.errors << error
36
-
37
- error.id
38
- end
39
32
  end
40
33
  end
41
34
  end
@@ -1,17 +1,21 @@
1
1
  require "shiny_json_logic/operations/base"
2
2
  require "shiny_json_logic/numericals/with_error_handling"
3
+ require "shiny_json_logic/numericals/numerify"
3
4
 
4
5
 
5
6
  module ShinyJsonLogic
6
7
  module Operations
7
8
  class Modulo < Base
8
9
  include Numericals::WithErrorHandling
10
+ include Numericals::Numerify
9
11
 
10
12
  protected
11
13
 
12
14
  def run
15
+ return handle_no_operators if rules.size < 2
16
+
13
17
  safe_arithmetic do
14
- rules.reduce(:%)
18
+ numerified.reduce { |a, b| a.remainder(b) }
15
19
  end
16
20
  end
17
21
  end
@@ -1,3 +1,3 @@
1
1
  module ShinyJsonLogic
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
data/results/ruby.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "totals": {
3
3
  "shiny_json_logic": {
4
- "passed": 887,
4
+ "passed": 909,
5
5
  "total": 1126
6
6
  }
7
7
  }
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.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luis Moyano