[前][次][番号順一覧][スレッド一覧]

ruby-changes:44964

From: kazu <ko1@a...>
Date: Sat, 10 Dec 2016 11:17:01 +0900 (JST)
Subject: [ruby-changes:44964] kazu:r57037 (trunk): Fix document of gunzip and gzip [ci skip]

kazu	2016-12-10 11:16:55 +0900 (Sat, 10 Dec 2016)

  New Revision: 57037

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=57037

  Log:
    Fix document of gunzip and gzip [ci skip]
    
    - fix a typo (`GzipReadr` -> `GzipReader`)
    - `Zlib::GzipReader.new` does not take block
    - fix encoding

  Modified files:
    trunk/ext/zlib/zlib.c
Index: ext/zlib/zlib.c
===================================================================
--- ext/zlib/zlib.c	(revision 57036)
+++ ext/zlib/zlib.c	(revision 57037)
@@ -4289,7 +4289,10 @@ zlib_gzip_end(struct gzfile *gz) https://github.com/ruby/ruby/blob/trunk/ext/zlib/zlib.c#L4289
  *
  *   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) https://github.com/ruby/ruby/blob/trunk/ext/zlib/zlib.c#L4347
  *
  *   def gzip(string, level=nil, strategy=nil)
  *     sio = StringIO.new
+ *     sio.binmode
  *     gz = Zlib::GzipWriter.new(sio, level, strategy)
  *     gz.write(string)
  *     gz.close

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]