diff options
author | kazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-12-10 02:16:55 +0000 |
---|---|---|
committer | kazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-12-10 02:16:55 +0000 |
commit | adc9c71fbe473b18ae16b9aa0391fcbc36a39bb0 (patch) | |
tree | bb53ee205f0333a671db5c23fd2067b797f692c1 /ext/zlib/zlib.c | |
parent | 5ae717f249e2eb40165c91c8ef153adbfc0466c4 (diff) | |
download | ruby-adc9c71fbe473b18ae16b9aa0391fcbc36a39bb0.tar.gz |
Fix document of gunzip and gzip [ci skip]
- fix a typo (`GzipReadr` -> `GzipReader`)
- `Zlib::GzipReader.new` does not take block
- fix encoding
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57037 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/zlib/zlib.c')
-rw-r--r-- | ext/zlib/zlib.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index 78860132df..956ff08b53 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -4289,7 +4289,10 @@ zlib_gzip_end(struct gzfile *gz) * * def gunzip(string) * sio = StringIO.new(string) - * Zlib::GzipReadr.new(sio){|f| f.read} + * gz = Zlib::GzipReader.new(sio, encoding: Encoding::ASCII_8BIT) + * gz.read + * ensure + * gz&.close * end * * See also Zlib.gzip @@ -4344,6 +4347,7 @@ zlib_gunzip_end(struct gzfile *gz) * * def gzip(string, level=nil, strategy=nil) * sio = StringIO.new + * sio.binmode * gz = Zlib::GzipWriter.new(sio, level, strategy) * gz.write(string) * gz.close |