ruby-changes:18374
From: naruse <ko1@a...>
Date: Mon, 27 Dec 2010 10:36:26 +0900 (JST)
Subject: [ruby-changes:18374] Ruby:r30397 (trunk): * ext/zlib/zlib.c (Init_zlib): Add Zlib.defale and Zlib.inflate.
naruse 2010-12-27 10:36:19 +0900 (Mon, 27 Dec 2010) New Revision: 30397 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=30397 Log: * ext/zlib/zlib.c (Init_zlib): Add Zlib.defale and Zlib.inflate. [ruby-dev:42833] Modified files: trunk/ChangeLog trunk/ext/zlib/zlib.c Index: ChangeLog =================================================================== --- ChangeLog (revision 30396) +++ ChangeLog (revision 30397) @@ -1,3 +1,8 @@ +Mon Dec 27 10:33:43 2010 NARUSE, Yui <naruse@r...> + + * ext/zlib/zlib.c (Init_zlib): Add Zlib.defale and Zlib.inflate. + [ruby-dev:42833] + Mon Dec 27 07:38:07 2010 Kazuhiro NISHIYAMA <zn@m...> * misc/rb_optparse.zsh: add compdef for generator. Index: ext/zlib/zlib.c =================================================================== --- ext/zlib/zlib.c (revision 30396) +++ ext/zlib/zlib.c (revision 30397) @@ -1227,12 +1227,13 @@ } /* - * call-seq: Zlib::Deflate.deflate(string[, level]) + * call-seq: Zlib.deflate(string[, level]) + * Zlib::Deflate.deflate(string[, level]) * * Compresses the given +string+. Valid values of level are * <tt>Zlib::NO_COMPRESSION</tt>, <tt>Zlib::BEST_SPEED</tt>, * <tt>Zlib::BEST_COMPRESSION</tt>, <tt>Zlib::DEFAULT_COMPRESSION</tt>, and an - * integer from 0 to 9. + * integer from 0 to 9 (the default is 6). * * This method is almost equivalent to the following code: * @@ -1243,7 +1244,7 @@ * dst * end * - * TODO: what's default value of +level+? + * See also Zlib.inflate * */ static VALUE @@ -1478,7 +1479,8 @@ } /* - * call-seq: Zlib::Inflate.inflate(string) + * call-seq: Zlib.inflate(string) + * Zlib::Inflate.inflate(string) * * Decompresses +string+. Raises a Zlib::NeedDict exception if a preset * dictionary is needed for decompression. @@ -1493,6 +1495,8 @@ * buf * end * + * See also Zlib.deflate + * */ static VALUE rb_inflate_s_inflate(VALUE obj, VALUE src) @@ -3705,6 +3709,7 @@ cDeflate = rb_define_class_under(mZlib, "Deflate", cZStream); rb_define_singleton_method(cDeflate, "deflate", rb_deflate_s_deflate, -1); + rb_define_singleton_method(mZlib, "deflate", rb_deflate_s_deflate, -1); rb_define_alloc_func(cDeflate, rb_deflate_s_allocate); rb_define_method(cDeflate, "initialize", rb_deflate_initialize, -1); rb_define_method(cDeflate, "initialize_copy", rb_deflate_init_copy, 1); @@ -3716,6 +3721,7 @@ cInflate = rb_define_class_under(mZlib, "Inflate", cZStream); rb_define_singleton_method(cInflate, "inflate", rb_inflate_s_inflate, 1); + rb_define_singleton_method(mZlib, "inflate", rb_inflate_s_inflate, 1); rb_define_alloc_func(cInflate, rb_inflate_s_allocate); rb_define_method(cInflate, "initialize", rb_inflate_initialize, -1); rb_define_method(cInflate, "inflate", rb_inflate_inflate, 1); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/