exis_ray 0.5.0 → 0.5.1
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 +5 -0
- data/lib/exis_ray/json_formatter.rb +11 -3
- data/lib/exis_ray/version.rb +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: de4cf609747379030a7d49bf06aea93efbe9d60490eb3d9bfe4af3fec0fe1bd4
|
|
4
|
+
data.tar.gz: 0f3cbba6bf49ffec549c1cc7a306b9c018c12196f4a60afd62769268c5f964bf
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5e9532985f27d6ccb4efe76be22b3ff580eb60169e7f7c4a6a9db4ae19ac05a41489d43635f754deb6effd7732c97203ab0e28c19ae845f41f1a284ed79231ec
|
|
7
|
+
data.tar.gz: 40796e0043612a9636e212ae4ced8e096a984144e35f4d1e4baa9a1216514f8916ad9f3b2c054852861157015b4d37e9987da5e6b335a34254d0e5b5b8327468
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
## [0.5.1] - 2026-03-24
|
|
2
|
+
|
|
3
|
+
### Fixed
|
|
4
|
+
- **Type-Aware KV Parser:** The `JsonFormatter` now automatically casts numeric strings to `Integer` or `Float` when parsing KV messages. This ensures compliance with the Wispro standard where `duration_s` and `count` must be numeric types in the final JSON, not strings.
|
|
5
|
+
|
|
1
6
|
## [0.5.0] - 2026-03-23
|
|
2
7
|
|
|
3
8
|
### Changed
|
|
@@ -127,6 +127,7 @@ module ExisRay
|
|
|
127
127
|
|
|
128
128
|
# Parsea un string con formato key=value y retorna un Hash.
|
|
129
129
|
# Soporta valores con espacios si están entre comillas dobles (ej: message="algo salió mal").
|
|
130
|
+
# Intenta convertir valores numéricos a Float o Integer automáticamente.
|
|
130
131
|
#
|
|
131
132
|
# @param str [String]
|
|
132
133
|
# @return [Hash]
|
|
@@ -134,18 +135,25 @@ module ExisRay
|
|
|
134
135
|
result = {}
|
|
135
136
|
str.scan(KV_PARSE_RE) do |key, value|
|
|
136
137
|
val = value.start_with?('"') ? (value[1..-2] || "").gsub('\\"', '"') : value
|
|
137
|
-
result[key.to_sym] =
|
|
138
|
+
result[key.to_sym] = cast_value(key, val)
|
|
138
139
|
end
|
|
139
140
|
result
|
|
140
141
|
end
|
|
141
142
|
|
|
142
143
|
# Filtra un valor si la clave se considera sensible.
|
|
144
|
+
# Si no es sensible, intenta castear el valor a número si corresponde.
|
|
143
145
|
#
|
|
144
146
|
# @param key [String, Symbol]
|
|
145
147
|
# @param value [Object]
|
|
146
148
|
# @return [Object]
|
|
147
|
-
def
|
|
148
|
-
key.to_s.match?(SENSITIVE_KEYS)
|
|
149
|
+
def cast_value(key, value)
|
|
150
|
+
return "[FILTERED]" if key.to_s.match?(SENSITIVE_KEYS)
|
|
151
|
+
|
|
152
|
+
case value
|
|
153
|
+
when /\A\d+\z/ then value.to_i
|
|
154
|
+
when /\A\d+\.\d+\z/ then value.to_f
|
|
155
|
+
else value
|
|
156
|
+
end
|
|
149
157
|
end
|
|
150
158
|
|
|
151
159
|
# Filtra recursivamente un Hash que contenga claves sensibles.
|
data/lib/exis_ray/version.rb
CHANGED