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

ruby-changes:20839

From: drbrain <ko1@a...>
Date: Tue, 9 Aug 2011 09:18:31 +0900 (JST)
Subject: [ruby-changes:20839] drbrain:r32888 (trunk): * ext/zlib/zlib.c (gzfile_wrap): Document encoding options.

drbrain	2011-08-09 09:18:18 +0900 (Tue, 09 Aug 2011)

  New Revision: 32888

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=32888

  Log:
    * ext/zlib/zlib.c (gzfile_wrap):  Document encoding options.
    * ext/zlib/zlib.c (rb_gzwriter_s_open): ditto
    * ext/zlib/zlib.c (rb_gzreader_s_open): ditto

  Modified files:
    trunk/ChangeLog
    trunk/ext/zlib/zlib.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 32887)
+++ ChangeLog	(revision 32888)
@@ -1,3 +1,9 @@
+Tue Aug  9 09:18:04 2011  Eric Hodel  <drbrain@s...>
+
+	* ext/zlib/zlib.c (gzfile_wrap):  Document encoding options.
+	* ext/zlib/zlib.c (rb_gzwriter_s_open): ditto
+	* ext/zlib/zlib.c (rb_gzreader_s_open): ditto
+
 Sun Aug  7 23:31:32 2011  KOSAKI Motohiro  <kosaki.motohiro@g...>
 
 	* time.c (rb_strftime_alloc): raise ERANGE if width is too large.
Index: ext/zlib/zlib.c
===================================================================
--- ext/zlib/zlib.c	(revision 32887)
+++ ext/zlib/zlib.c	(revision 32888)
@@ -2762,14 +2762,17 @@
 /*
  * Document-method: Zlib::GzipFile.wrap
  *
- * call-seq: Zlib::GzipFile.wrap(io) { |gz| ... }
+ * call-seq:
+ *   Zlib::GzipReader.wrap(io, ...) { |gz| ... }
+ *   Zlib::GzipWriter.wrap(io, ...) { |gz| ... }
  *
- * Creates a GzipFile object associated with +io+, and
- * executes the block with the newly created GzipFile object,
- * just like File.open. The GzipFile object will be closed
- * automatically after executing the block. If you want to keep
- * the associated IO object opening, you may call
- * +Zlib::GzipFile#finish+ method in the block.
+ * Creates a GzipReader or GzipWriter associated with +io+, passing in any
+ * necessary extra options, and executes the block with the newly created
+ * object just like File.open.
+ *
+ * The GzipFile object will be closed automatically after executing the block.
+ * If you want to keep the associated IO object open, you may call
+ * Zlib::GzipFile#finish method in the block.
  */
 static VALUE
 rb_gzfile_s_wrap(int argc, VALUE *argv, VALUE klass)
@@ -3187,12 +3190,17 @@
 }
 
 /*
- * call-seq: Zlib::GzipWriter.new(io, level, strategy)
+ * call-seq:
+ *   Zlib::GzipWriter.new(io, level = nil, strategy = nil, options = {})
  *
  * Creates a GzipWriter object associated with +io+. +level+ and +strategy+
  * should be the same as the arguments of Zlib::Deflate.new.  The GzipWriter
- * object writes gzipped data to +io+.  At least, +io+ must respond to the
- * +write+ method that behaves same as write method in IO class.
+ * object writes gzipped data to +io+.  +io+ must respond to the
+ * +write+ method that behaves the same as IO#write.
+ *
+ * The +options+ hash may be used to set the encoding of the data.
+ * +:external_encoding+, +:internal_encoding+ and +:encoding+ may be set as in
+ * IO::new.
  */
 static VALUE
 rb_gzwriter_initialize(int argc, VALUE *argv, VALUE obj)
@@ -3388,12 +3396,17 @@
 /*
  * Document-method: Zlib::GzipReader.new
  *
- * call-seq: Zlib::GzipReader.new(io)
+ * call-seq:
+ *   Zlib::GzipReader.new(io, options = {})
  *
  * Creates a GzipReader object associated with +io+. The GzipReader object reads
- * gzipped data from +io+, and parses/decompresses them.  At least, +io+ must have
- * a +read+ method that behaves same as the +read+ method in IO class.
+ * gzipped data from +io+, and parses/decompresses it.  The +io+ must
+ * have a +read+ method that behaves same as the IO#read.
  *
+ * The +options+ hash may be used to set the encoding of the data.
+ * +:external_encoding+, +:internal_encoding+ and +:encoding+ may be set as in
+ * IO::new.
+ *
  * If the gzip file header is incorrect, raises an Zlib::GzipFile::Error
  * exception.
  */

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

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