Skip to content

ARGF: pos/tell/seek/rewind, fileno/to_i and the encoding accessors - #484

Merged
tannevaled merged 1 commit into
mainfrom
feat/argf-seek
Aug 29, 2026
Merged

tannevaled merged 1 commit into
mainfrom
feat/argf-seek

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

Now that IO carries a descriptor and encoding, ARGF delegates the positional and
encoding protocol to the file currently being read: pos / tell / pos= /
seek, fileno / to_i, external_encoding / internal_encoding /
set_encoding. rewind returns the current file to its start and resets the
line counter ($.). A call with no current stream (after #close) raises.

Verified against ruby 4.0.6. Whole-package coverage stays at 100%; the ruby/spec
ratchet floor rises 16240 → 16250 (core/argf 60 → 68, zero regressions in a
per-file sweep).

🤖 Generated with Claude Code

Now that IO carries a descriptor and encoding, ARGF delegates the positional and
encoding protocol to the file currently being read: pos / tell / pos= / seek,
fileno / to_i, external_encoding / internal_encoding / set_encoding. rewind
returns the current file to its start and resets the line counter ($.). A call
with no current stream (after #close) raises.

Verified against ruby 4.0.6. Whole-package coverage stays at 100%; the ruby/spec
floor rises 16240 -> 16250 (core/argf 60 -> 68).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit f8cb10f into main Aug 29, 2026
7 checks passed
@tannevaled
tannevaled deleted the feat/argf-seek branch August 29, 2026 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant