shiny_json_logic 0.2.3 → 0.2.4
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 +6 -0
- data/Gemfile.lock +1 -1
- data/badges/compat.json +1 -1
- data/lib/shiny_json_logic/engine.rb +2 -0
- data/lib/shiny_json_logic/operations/addition.rb +20 -1
- data/lib/shiny_json_logic/version.rb +1 -1
- data/results/ruby.json +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e606b70876145a81ca93c1f7368b12dd721482a7307c665b2e30377397c718e9
|
|
4
|
+
data.tar.gz: ac30778c9cff352f359fc2c9d0645114e600d4614e04f62394a76f2557d5386d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3f6628c68886607a5d509de45398483fa2e426e178d591640202f168e099b08ade0ffb635da3ed15ba3b2c5ad09383152c1e82ce50ccda845cb41273497255e3
|
|
7
|
+
data.tar.gz: d37947b228f16f3cf735fd3f8a761d3edb3f35aef5ae8a1a557d3930f1cdb6aa9d3b2f115a351b87fa4e48352127c81d0f70624d24a65e0c50c5a1583c8b89af
|
data/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## [0.2.4] - 2026-02-02
|
|
6
|
+
### Changed
|
|
7
|
+
- Improves compatibility of addition operator
|
|
8
|
+
- Fixed bug when attempting to evaluate empty rules.
|
|
9
|
+
|
|
4
10
|
## [0.2.3] - 2026-02-02
|
|
5
11
|
### Changed
|
|
6
12
|
- Improves compatibility of multiplication operator
|
data/Gemfile.lock
CHANGED
data/badges/compat.json
CHANGED
|
@@ -1,12 +1,31 @@
|
|
|
1
1
|
require "shiny_json_logic/operations/base"
|
|
2
|
+
require "shiny_json_logic/numericals/numerify"
|
|
3
|
+
require "shiny_json_logic/numericals/with_error_handling"
|
|
2
4
|
|
|
3
5
|
module ShinyJsonLogic
|
|
4
6
|
module Operations
|
|
5
7
|
class Addition < Base
|
|
8
|
+
include Numericals::WithErrorHandling
|
|
9
|
+
include Numericals::Numerify
|
|
10
|
+
|
|
6
11
|
protected
|
|
7
12
|
|
|
8
13
|
def run
|
|
9
|
-
|
|
14
|
+
|
|
15
|
+
safe_arithmetic do
|
|
16
|
+
return 0 if numerified.empty?
|
|
17
|
+
|
|
18
|
+
numerified.reduce(:+)
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
private
|
|
23
|
+
|
|
24
|
+
def numerify(value)
|
|
25
|
+
val = super
|
|
26
|
+
return 0 if val.nil?
|
|
27
|
+
|
|
28
|
+
val
|
|
10
29
|
end
|
|
11
30
|
end
|
|
12
31
|
end
|
data/results/ruby.json
CHANGED