Skip to content

Conversation

@flori
Copy link

@flori flori commented Jan 17, 2026

  • Added output: parameter to Toon.encode method to allow writing directly to IO objects
  • Modified LineWriter to accept optional output argument and write directly to it instead of collecting lines
  • Updated resolve_options to include output in the options hash
  • Toon.encode now returns nil when output: is specified, otherwise returns the encoded string
  • Added tests for the new output: functionality in spec/toon_spec.rb
  • LineWriter now uses StringIO as default when no output is provided, maintaining backward compatibility
  • Enables memory-efficient streaming of large outputs without keeping entire result in memory

- Added `output:` parameter to `Toon.encode` method to allow writing
  directly to IO objects
- Modified `LineWriter` to accept optional `output` argument and write
  directly to it instead of collecting lines
- Updated `resolve_options` to include `output` in the options hash
- `Toon.encode` now returns `nil` when `output:` is specified, otherwise
  returns the encoded string
- Added tests for the new `output:` functionality in `spec/toon_spec.rb`
- `LineWriter` now uses `StringIO` as default when no `output` is
  provided, maintaining backward compatibility
- Enables memory-efficient streaming of large outputs without keeping
  entire result in memory
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