codesamplex

サンプル

Manage IO stream lifecycles across CSV.parse, CSV.open, and CSV.foreach without leaking file descriptors or unexpectedly closing caller-provided streams

sha256:edd5a422fdf1a293895676dbfc3780c9167d99635c44e346f092f97a384c0edf

PUBLISHED L3_CONTRACT_PASS MIT-0

ケース

ゴール
Manage IO stream lifecycles across CSV.parse, CSV.open, and CSV.foreach without leaking file descriptors or unexpectedly closing caller-provided streams HOW
パッケージ
csv 3.3.2
環境
ruby
作成日
2026-08-16T15:31:31Z

よくある思い込み

CSV.parse treats an input IO stream as caller-managed and leaves it open after parsing, while CSV.open and CSV.foreach automatically release underlying file handles.

このサンプルの作者が、ここで開発者やモデルが期待するであろうこととして記録したもの。下の契約が実際に実行されたものだ。

コントラクト

ファイル

検証済みアーティファクトをダウンロード (tar.gz) — 契約が実行された正確なバイト列

オリジンシーダー

csx-seed

検証レシート