(path)
| 19 | class FileSystem |
| 20 | alias_method :open_output_stream_raw, :open_output_stream |
| 21 | def open_output_stream(path) |
| 22 | stream = open_output_stream_raw(path) |
| 23 | if block_given? |
| 24 | begin |
| 25 | yield(stream) |
| 26 | ensure |
| 27 | stream.close |
| 28 | end |
| 29 | else |
| 30 | stream |
| 31 | end |
| 32 | end |
| 33 | end |
| 34 | end |