mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
5ae717f249
commit
adc9c71fbe
1 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue