From 1d51f427ff22e9fa9adfea9855c8344f493a3b95 Mon Sep 17 00:00:00 2001 From: naruse Date: Sun, 11 Dec 2016 06:13:02 +0000 Subject: fix Zlib.gzip/gunzip document git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57049 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/zlib/zlib.c | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'ext/zlib') diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index 232ad0b13b..4052e49b4b 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) -- cgit v1.2.3