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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c916d765b57e909cd3320e1670623536907d648c360039cbb5cada88b88a86fd
4
- data.tar.gz: cab31ec104f79b58ecbd2ad8a8758f55f767e217f09c2880a3b911972a743112
3
+ metadata.gz: de4cf609747379030a7d49bf06aea93efbe9d60490eb3d9bfe4af3fec0fe1bd4
4
+ data.tar.gz: 0f3cbba6bf49ffec549c1cc7a306b9c018c12196f4a60afd62769268c5f964bf
5
5
  SHA512:
6
- metadata.gz: b428640a4df2e1b64aa798568769c0d9902e503aa59fb14f7d2f34948115883f35e436097504de34a879eeb63890bbb031dc68e9f2adb672fa24c04c6064a47c
7
- data.tar.gz: aa9c8bb741789384b66d1a98b9e5d5008d9e5eeea3802ecde39264c08c8ed95be8114285005c03dfb11d3506c2d4efb65c59336bc582d8b9cc8ccb1cf3bdb577
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] = filter_sensitive_value(key, val)
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 filter_sensitive_value(key, value)
148
- key.to_s.match?(SENSITIVE_KEYS) ? "[FILTERED]" : value
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.
@@ -2,5 +2,5 @@
2
2
 
3
3
  module ExisRay
4
4
  # Versión actual de la gema.
5
- VERSION = "0.5.0"
5
+ VERSION = "0.5.1"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exis_ray
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriel Edera