omq-cli 0.14.4 → 0.14.5

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: b33018d3cf4cde745e470b76fa4c4037d4731bb821b12f1470c5b7809bc6341d
4
- data.tar.gz: 40df48a916ad574240f49eaf369de8a2b4aeca8f393fbdb2c9e9a9383a7baca9
3
+ metadata.gz: f14ffbc99fefdb889511848a42e32bd4ae40d99c7cce460d258fdb7748957fe9
4
+ data.tar.gz: 96d840a2f4c357a44ca5984a6ec1e25e17f732afdd73336561da1d434c3a5ae0
5
5
  SHA512:
6
- metadata.gz: 5720a069c65ea5edacd840f342f24b984e18a064084b093cba5388f9e9e6e631184cf8382c2bb6e211e944fb66cab98df10e2dab641f44fcc3d461e93113e183
7
- data.tar.gz: 000a989ba96485958d35001c8d0b59c4945cff1e4e3b545d25930f9058fa719cd64699744ec7c792561bd22437533218db9723951d1994240fa8bf9553dd3587
6
+ metadata.gz: 0aff99845b46f61efcd3b1c46a7a3a8de7457a8ff669db1563d2191b086c1cc9344ec1b26937486626d53953e16c5754b8d08dd22f7a44bbe1a0038f0a6aa39a
7
+ data.tar.gz: 23e995ee4b1e8cbbf2ad3389e5d94f5d5d8215eed0e8b73522242c4ac99b2edc7cbc77f39d83fbb07379236ad03f2ecc3a99cecef775d1075d83d471ff06a954
data/CHANGELOG.md CHANGED
@@ -1,10 +1,31 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.14.5 — 2026-04-14
4
+
5
+ ### Fixed
6
+
7
+ - **Blank stdin lines are now a no-op instead of a zero-frame
8
+ "message".** 0.14.3 decoded a blank line to `[""]` so that REQ
9
+ would actually send *something* and not wedge in `recv_msg`.
10
+ That was the wrong shape of fix — on a tty, hitting Enter on an
11
+ empty prompt should behave like a shell's empty prompt and just
12
+ wait for the next line, not fire off an empty ZMTP frame to the
13
+ peer. `BaseRunner#read_stdin_input` now loops past blank lines
14
+ for the ascii/quoted/jsonl paths; decode goes back to returning
15
+ `[]` for a blank line and `Formatter::EMPTY_MSG` is gone. REQ
16
+ still cannot wedge because the blank line is never seen by
17
+ `run_loop` at all. `split("\t", -1)` / trailing-empty-frame
18
+ preservation is kept.
19
+
3
20
  ## 0.14.4 — 2026-04-14
4
21
 
5
22
  ### Fixed
6
23
 
7
- - **`NameError` fixed
24
+ - **`NameError` on load when requiring `omq/cli/formatter` without
25
+ `protocol/zmtp` already loaded.** 0.14.3 introduced
26
+ `Formatter::EMPTY_MSG = [::Protocol::ZMTP::Codec::EMPTY_BINARY]`
27
+ at class-body load time, which blew up with `uninitialized
28
+ constant Protocol` in the release gem.
8
29
 
9
30
  ## 0.14.3 — 2026-04-14
10
31
 
@@ -418,8 +418,17 @@ module OMQ
418
418
  data = $stdin.read
419
419
  data.nil? || data.empty? ? nil : [data]
420
420
  else
421
- line = $stdin.gets
422
- line.nil? ? nil : @fmt.decode(line)
421
+ # Skip blank input lines — they are a no-op "wait for next
422
+ # line" rather than a zero-frame message. Stops REQ from
423
+ # wedging in recv after an accidental Enter on a tty, and
424
+ # stops PUSH/etc. from silently dropping the iteration via
425
+ # send_msg's `return if parts.empty?` guard.
426
+ loop do
427
+ line = $stdin.gets
428
+ return nil if line.nil?
429
+ next if line.chomp.empty?
430
+ return @fmt.decode(line)
431
+ end
423
432
  end
424
433
  end
425
434
 
@@ -7,10 +7,6 @@ module OMQ
7
7
  # (omq-rfc-zstd) once enabled via +socket.compression=+; the
8
8
  # formatter sees plaintext frames in both directions.
9
9
  class Formatter
10
- # Single empty frame — used as the decoded form of a blank input line.
11
- EMPTY_MSG = [''.b.freeze].freeze
12
-
13
-
14
10
  # @param format [Symbol] wire format (:ascii, :quoted, :raw, :jsonl, :msgpack, :marshal)
15
11
  def initialize(format)
16
12
  @format = format
@@ -49,11 +45,9 @@ module OMQ
49
45
  def decode(line)
50
46
  case @format
51
47
  when :ascii, :marshal
52
- parts = line.chomp.split("\t", -1)
53
- parts.empty? ? EMPTY_MSG : parts
48
+ line.chomp.split("\t", -1)
54
49
  when :quoted
55
- parts = line.chomp.split("\t", -1).map { |p| "\"#{p}\"".undump }
56
- parts.empty? ? EMPTY_MSG : parts
50
+ line.chomp.split("\t", -1).map { |p| "\"#{p}\"".undump }
57
51
  when :raw
58
52
  [line]
59
53
  when :jsonl
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OMQ
4
4
  module CLI
5
- VERSION = "0.14.4"
5
+ VERSION = "0.14.5"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omq-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.4
4
+ version: 0.14.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrik Wenger