サンプル
json 2.9.1: Manage IO stream lifecycles, EOF positions, and monolithic buffer allocations in JSON.dump and JSON.load
検証済みサンプル — gem json 2.9.1: Manage IO stream lifecycles, EOF positions, and monolithic buffer allocations in JSON.dump and JSON.load. ruby 3 · linux…
sha256:ab7ff319b674d45bcbd2a67d43b257f7a387c8b14d38d85018607794429d5106
このネットワークが提供するのは一つだけです。ビルドされるサンプル。サンドボックスで実行し、署名済みの受領証を保管します。等級はつけず、何も保証しません — 同じコードがあなたの環境でビルドされるかは測定していません。
合格した契約受領証を提出した異なる署名鍵の数です。1 なら作者だけ、2 以上なら他の誰かもビルドしています。鍵は自己生成で背後に登録された身元がないため、数えているのは人ではなく鍵です。
MIT-0
実行証拠
宣言された環境と署名済みの実行を分けてあります。このサンプルが何をどこで実行したかをそのまま確認できます。
- 証拠の基準
- 署名済みコントラクト合格
- 検証レシート
- 2
- ビルドした署名鍵
- 2
宣言された環境
ruby linux x64 ruby ruby rubygems
検証実行環境
| 環境 | コントラクト | ステージ | 実行日 |
|---|---|---|---|
| ruby 3 · linux debian/x64 · docker ed25519:d91480838ac982c9 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · rubygems@1 |
2026-08-17 |
| ruby 3 · linux debian/x64 · docker ed25519:2175b912ea1c23b1 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · rubygems@1 |
2026-08-18 |
ケース
HOW- ゴール
- Manage IO stream lifecycles, EOF positions, and monolithic buffer allocations in JSON.dump and JSON.load
- パッケージ
- シンボル
-
- JSON.dump
- JSON.load
- JSON.parse
- JSON::Parser
- JSON::State
- 環境
- ruby
- 作成日
- 2026-08-17T02:43:58Z
コントラクト
- assert JSON.dump and JSON.load leave passed IO streams open at EOF rather than closing or rewinding them, dump returns the IO object instead of the JSON string, and both operations buffer the entire payload in memory in a single monolithic read or write rather than streaming chunks
- assert JSON.dump and JSON.load leave the stream open and unrewound at EOF even when an error occurs during parsing or generation
- assert JSON.dump returns the IO instance when given a stream but returns a JSON String when the second argument is an integer limit
- assert JSON.parse rejects IO streams with TypeError, requiring explicit conversion to string or use of JSON.load with its unclosed stream caveat
- assert JSON::Parser retains its source string and re-parses from the retained string on subsequent parse calls rather than consuming or discarding it
- assert JSON.dump buffers the complete document before calling IO#write once, so a slow or aborted dump writes zero bytes rather than partial fragments
ファイル
- Gemfile
- Gemfile.lock
- NOTES.md
- csx.json
- src/resource_ops.rb
- test/contract.rb