Skip to content

Match IO puts value conversion semantics - #164

Open
OskarEichler wants to merge 2 commits into
net-ssh:masterfrom
OskarEichler:codex/puts-value-conversion
Open

Match IO puts value conversion semantics#164
OskarEichler wants to merge 2 commits into
net-ssh:masterfrom
OskarEichler:codex/puts-value-conversion

Conversation

@OskarEichler

@OskarEichler OskarEichler commented Aug 28, 2026

Copy link
Copy Markdown

Problem: Net::SFTP file puts raised for nil/false values, emitted nothing with no arguments, ignored to_ary conversion, and could recurse forever on recursive arrays.

Fix: Match Ruby IO behavior: emit a newline with no arguments, convert scalar values once, honor to_ary, flatten arrays, preserve empty-array suppression, and terminate recursive arrays with the conventional [...] marker.

Regression coverage: Focused upstream file tests cover nil/false, no arguments, to_ary, nested arrays, empty arrays, and recursive arrays: 35 runs / 114 assertions. Full suite: 436 runs / 1,204 assertions with only the pre-existing Ruby 4 StartTest positional-hash/keyword expectation failure.

@OskarEichler OskarEichler changed the title Handle non-string values and empty argument lists in puts Match IO puts value conversion semantics Aug 30, 2026
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