Skip to content

Commit

Permalink
Fix document of gunzip and gzip [ci skip]
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
znz committed Dec 10, 2016
1 parent 5ae717f commit adc9c71
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ext/zlib/zlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit adc9c71

Please sign in to comment.