DOC-7014 Standardize dt_*.rb output comments to # >>> value - #3898
Merged
Conversation
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
Contributor
Contributor
🧠 Redis MemoryFound 5 related items from repository history (5 new this commit):
Memory updated at 43499f9 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DOC-7014
What
All seven Ruby data-type tutorial files under
local_examples/ruby/used plain# valueoutput comments where every other client file in their sets uses# >>> value.dt_hash.rbwas 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.rbanddt_string.rb. Left untouched:# Recreate the ... so this example runs on its own.)# (your actual value may vary))>>>, matching the convention already used elsewhere (e.g. ioredis'scmds_streamexample)Text is otherwise byte-identical; this is a marker change, not a rewrite.
Verification
ss_tutorial,set_tutorial,hash_tutorial,sets_tutorial→ PASS viabuild/example-test-harness/run.sh ... ruby(against Redis 8.8.0 in Docker —hash_tutorialneedsHEXPIRE, which the ambient local Redis 7.2.7 lacks).hll_tutorial,list_tutorial,stream_tutorialaren't wired into the harness'ssrc_pathmapping, 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.Found but not fixed (out of scope for this ticket)
dt_hash.rb:33and 26 lines indt_stream.rbdocumentHash#inspectoutput 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/inspectresults 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, anddt_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.rbsteps 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.