Skip to content

DOC-7014 Standardize dt_*.rb output comments to # >>> value - #3898

Merged
andy-stark-redis merged 1 commit into
mainfrom
DOC-7014-dt-rb-comment-style
Aug 28, 2026
Merged

DOC-7014 Standardize dt_*.rb output comments to # >>> value#3898
andy-stark-redis merged 1 commit into
mainfrom
DOC-7014-dt-rb-comment-style

Conversation

@andy-stark-redis

@andy-stark-redis andy-stark-redis commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

DOC-7014

What

All seven Ruby data-type tutorial files under local_examples/ruby/ used plain # value output comments where every other client file in their sets uses # >>> value. dt_hash.rb was internally mixed — DOC-6967 added two >>> -prefixed steps (hexpire, hpexpire) while the rest of the file kept the older plain style.

Converted every comment that documents a printed/inspected return value across dt_hash.rb, dt_hyperloglog.rb, dt_list.rb, dt_sets.rb, dt_sorted_sets.rb, dt_stream.rb and dt_string.rb. Left untouched:

  • Narrative comments (# Recreate the ... so this example runs on its own.)
  • Caveats already correctly excluded by DOC-6967 (# (your actual value may vary))
  • Multi-line output blocks' continuation lines — only the first line of a multi-line value gets >>> , matching the convention already used elsewhere (e.g. ioredis's cmds_stream example)

Text is otherwise byte-identical; this is a marker change, not a rewrite.

Verification

  • ss_tutorial, set_tutorial, hash_tutorial, sets_tutorialPASS via build/example-test-harness/run.sh ... ruby (against Redis 8.8.0 in Docker — hash_tutorial needs HEXPIRE, which the ambient local Redis 7.2.7 lacks).
  • hll_tutorial, list_tutorial, stream_tutorial aren't wired into the harness's src_path mapping, so ran them directly (ruby -I <redis-rb-6.0.0> <file>) — all exit 0, no raised assertion, and printed values match the new >>> comments exactly.
  • Local Redis was restored to its original 7.2.7 state afterward.

Found but not fixed (out of scope for this ticket)

dt_hash.rb:33 and 26 lines in dt_stream.rb document Hash#inspect output as "key"=>"value" (no spaces), but Ruby 4.0 / redis-rb 6.0.0 actually prints "key" => "value" (spaces around the hash rocket) — confirmed by running both files live. This is pre-existing and unrelated to comment style; flagging rather than fixing it here, since this ticket is about the >>> marker, not content accuracy.

🤖 Generated with Claude Code


Note

Low Risk
Comment-only documentation formatting in example scripts; no runtime, API, or build logic changes.

Overview
Aligns Ruby data-type tutorial examples with the cross-client convention where documented puts / inspect results use # >>> instead of plain # value.

The change is comment-only across dt_hash.rb, dt_hyperloglog.rb, dt_list.rb, dt_sets.rb, dt_sorted_sets.rb, dt_stream.rb, and dt_string.rb. Inline output comments and the first line of multi-line expected-output blocks now prefix with >>> ; continuation lines of multi-line values stay unprefixed. Narrative setup comments and existing caveat lines (e.g. TTL “may vary”) are unchanged. dt_hash.rb steps that already used >>> (hexpire / hpexpire) were left as-is; the rest of that file was brought in line.

Reviewed by Cursor Bugbot for commit 43499f9. Bugbot is set up for automated code reviews on this repo. Configure here.

All seven Ruby data-type tutorial files under local_examples/ruby/ used
plain `# value` output comments where every other client file in their sets
uses `# >>> value`. dt_hash.rb was internally mixed — DOC-6967 added two
`>>> `-prefixed steps (hexpire, hpexpire) while the rest of the file kept
the older plain style.

Converted every comment that documents a printed/inspected return value,
across dt_hash.rb, dt_hyperloglog.rb, dt_list.rb, dt_sets.rb,
dt_sorted_sets.rb, dt_stream.rb and dt_string.rb. Left untouched: narrative
comments (`# Recreate the ... so this example runs on its own.`), caveats
already correctly excluded by DOC-6967 (`# (your actual value may vary)`),
and multi-line output blocks' continuation lines, which stay unprefixed —
only the first line of a multi-line value gets `>>> `, matching the
convention already used elsewhere (e.g. ioredis's cmds_stream example).

Text is otherwise byte-identical; this is a marker change, not a rewrite.

Verified every file runs clean against Redis 8.8.0 (Docker, since IDMP/HSCAN
concerns aside, hash_tutorial needs HEXPIRE which the ambient local Redis
7.2.7 lacks): ss_tutorial, set_tutorial, hash_tutorial and sets_tutorial pass
via the test harness; hll_tutorial, list_tutorial and stream_tutorial (not
wired into run.sh's src_path mapping) run directly with exit 0 and no
raised assertion. Printed values match the new `>>> ` comments exactly.

Found but did not fix, since it's a content-accuracy issue and this ticket
is comment-style only: dt_hash.rb line 33 and 26 lines in dt_stream.rb
document Ruby hash#inspect output as `"key"=>"value"` (no spaces), but
Ruby 4.0/redis-rb 6.0.0 actually prints `"key" => "value"` (spaces around
the hash rocket) — confirmed by running both files live. Pre-existing,
not introduced by this change; flagged to the user rather than silently
corrected.

Learned: Ruby's Hash#inspect format has drifted since these tutorials were written — older Ruby prints `"key"=>"value"`, current Ruby (4.0, tested here) prints `"key" => "value"` with spaces — so any `>>> ` comment showing a hash literal is suspect and worth re-verifying against a live run, not just trusted at face value
Gaps: dt_hash.rb:33 and 26 lines in dt_stream.rb carry the stale no-space hash-rocket format; a content-accuracy pass (not a style pass) should re-verify and fix these
Ticket: DOC-7014
@github-actions

github-actions Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

DOC-7014

@github-actions

Copy link
Copy Markdown
Contributor

🧠 Redis Memory

Found 5 related items from repository history (5 new this commit):

Memory updated at 43499f9

@dwdougherty dwdougherty left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@andy-stark-redis
andy-stark-redis merged commit 11db9b5 into main Aug 28, 2026
93 checks passed
@andy-stark-redis
andy-stark-redis deleted the DOC-7014-dt-rb-comment-style branch August 28, 2026 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clients Client library docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants