summaryrefslogtreecommitdiff
path: root/ext/zlib/zlib.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-12-11 06:13:02 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-12-11 06:13:02 +0000
commit1d51f427ff22e9fa9adfea9855c8344f493a3b95 (patch)
treea6936fdb83df3abd6e665cedec2c705391f955ed /ext/zlib/zlib.c
parent5ec23b5222811bcbce0b3049d53f89311f6e43b5 (diff)
fix Zlib.gzip/gunzip document
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57049 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/zlib/zlib.c')
-rw-r--r--ext/zlib/zlib.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index 232ad0b..4052e49 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -4278,21 +4278,25 @@ zlib_gzip_end(struct gzfile *gz)
/*
* call-seq:
- * Zlib.gunzip(src) -> String
+ * Zlib.gzip(src, level=nil, strategy=nil) -> String
*
- * Decode the given gzipped +string+.
+ * Gzip the given +string+. Valid values of level are
+ * Zlib::NO_COMPRESSION, Zlib::BEST_SPEED, Zlib::BEST_COMPRESSION,
+ * Zlib::DEFAULT_COMPRESSION (default), or an integer from 0 to 9.
*
* This method is almost equivalent to the following code:
*
- * def gunzip(string)
- * sio = StringIO.new(string)
- * gz = Zlib::GzipReader.new(sio, encoding: Encoding::ASCII_8BIT)
- * gz.read
- * ensure
- * gz&.close
+ * def gzip(string, level=nil, strategy=nil)
+ * sio = StringIO.new
+ * sio.binmode
+ * gz = Zlib::GzipWriter.new(sio, level, strategy)
+ * gz.write(string)
+ * gz.close
+ * sio.string
* end
*
- * See also Zlib.gzip
+ * See also Zlib.gunzip
+ *
*/
static VALUE
zlib_s_gzip(int argc, VALUE *argv, VALUE klass)
@@ -4334,25 +4338,21 @@ zlib_gunzip_end(struct gzfile *gz)
/*
* call-seq:
- * Zlib.gunzip(src, level=nil, strategy=nil) -> String
+ * Zlib.gunzip(src) -> String
*
- * Gzip the given +string+. Valid values of level are
- * Zlib::NO_COMPRESSION, Zlib::BEST_SPEED, Zlib::BEST_COMPRESSION,
- * Zlib::DEFAULT_COMPRESSION (default), or an integer from 0 to 9.
+ * Decode the given gzipped +string+.
*
* This method is almost equivalent to the following code:
*
- * def gzip(string, level=nil, strategy=nil)
- * sio = StringIO.new
- * sio.binmode
- * gz = Zlib::GzipWriter.new(sio, level, strategy)
- * gz.write(string)
- * gz.close
- * sio.string
+ * def gunzip(string)
+ * sio = StringIO.new(string)
+ * gz = Zlib::GzipReader.new(sio, encoding: Encoding::ASCII_8BIT)
+ * gz.read
+ * ensure
+ * gz&.close
* end
*
- * See also Zlib.gunzip
- *
+ * See also Zlib.gzip
*/
static VALUE
zlib_gunzip(VALUE klass, VALUE src)