omq 0.6.2 → 0.6.3
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 +12 -0
- data/lib/omq/cli/base_runner.rb +3 -0
- data/lib/omq/cli/pipe.rb +1 -1
- data/lib/omq/cli/req_rep.rb +4 -2
- data/lib/omq/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: 6a43ed94bf4595d9388897a74f6e642a865ec98a66c0cf64db084d6cb714705e
|
|
4
|
+
data.tar.gz: feb63595995ac894ea816e44f9ebf01d3bacf756cdb8c55b6f5438f00a6aab96
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9bbe45d76566342849dcc59a8a334cf98c4f79b56392c0031e2491d4a0d3fb45d9ce7c0a9235c7138f2dd483b40721baa7fd9ce3d189c3230757f30a9c9e57f4
|
|
7
|
+
data.tar.gz: 1b7eccb931b57458c6cec4321fa3b4ee1de34314de7855aa3772affc434fb32561cf18e4365ab17ef5af6d5dbad62e24e7eba57d1e166d279a2b519fcfbfcf0f
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.6.3 — 2026-03-30
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- **`self << msg` in REP `-e` caused double-send** — `self << $F`
|
|
8
|
+
returns the socket, which `eval_expr` tried to coerce via `to_str`.
|
|
9
|
+
Now detected via `result.equal?(@sock)` and returned as a `SENT`
|
|
10
|
+
sentinel. REP skips the auto-send when the eval already sent the reply.
|
|
11
|
+
- **`eval_expr` called `to_str` on non-string results** — non-string,
|
|
12
|
+
non-array return values from `-e` now fail with a clear `NoMethodError`
|
|
13
|
+
on `to_str` (unchanged), but socket self-references are handled first.
|
|
14
|
+
|
|
3
15
|
## 0.6.2 — 2026-03-30
|
|
4
16
|
|
|
5
17
|
### Improved
|
data/lib/omq/cli/base_runner.rb
CHANGED
|
@@ -396,11 +396,14 @@ module OMQ
|
|
|
396
396
|
end
|
|
397
397
|
|
|
398
398
|
|
|
399
|
+
SENT = Object.new.freeze # sentinel: eval already sent the reply
|
|
400
|
+
|
|
399
401
|
def eval_expr(parts)
|
|
400
402
|
return parts unless @eval_proc
|
|
401
403
|
$F = parts
|
|
402
404
|
result = @sock.instance_exec(&@eval_proc)
|
|
403
405
|
return nil if result.nil?
|
|
406
|
+
return SENT if result.equal?(@sock)
|
|
404
407
|
return [result] if config.format == :marshal
|
|
405
408
|
case result
|
|
406
409
|
when Array then result
|
data/lib/omq/cli/pipe.rb
CHANGED
|
@@ -228,7 +228,7 @@ module OMQ
|
|
|
228
228
|
return parts unless @eval_proc
|
|
229
229
|
$F = parts
|
|
230
230
|
result = @sock.instance_exec(&@eval_proc)
|
|
231
|
-
return nil if result.nil?
|
|
231
|
+
return nil if result.nil? || result.equal?(@sock)
|
|
232
232
|
return [result] if config.format == :marshal
|
|
233
233
|
case result
|
|
234
234
|
when Array then result
|
data/lib/omq/cli/req_rep.rb
CHANGED
|
@@ -55,8 +55,10 @@ module OMQ
|
|
|
55
55
|
break if msg.nil?
|
|
56
56
|
if config.expr
|
|
57
57
|
reply = eval_expr(msg)
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
unless reply.equal?(SENT)
|
|
59
|
+
output(reply)
|
|
60
|
+
send_msg(reply || [""])
|
|
61
|
+
end
|
|
60
62
|
elsif config.echo
|
|
61
63
|
output(msg)
|
|
62
64
|
send_msg(msg)
|
data/lib/omq/version.rb
CHANGED