zlib 1.1.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -3
- data/ext/zlib/extconf.rb +5 -1
- data/ext/zlib/zlib.c +146 -47
- data/zlib.gemspec +2 -2
- metadata +8 -8
- data/.travis.yml +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d957237b697d574370dfb66644eb7912b53f2466929d8ff3ce8690105c99352
|
4
|
+
data.tar.gz: 0e12da7b6b66a599f03288bddbed187ee5c565dc5a21934576b23a6248014e42
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32b7d6ac7abb5e69c8d9d5dcdf0e9da27147cae4c54e56b147f58174dc44527d17b257faeae348d491aa7e30ef335fb3037a2aacf09989570a3761c74971f35d
|
7
|
+
data.tar.gz: fca7f4d887d1a97fa39ba4a973dfa1785822926df17d309646b97991ecb8d3ea1d6f18607ad5827f3b6fa55ae64715b88dfda5fb81b0385405bbd20451174d98
|
data/README.md
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
# Zlib
|
2
2
|
|
3
|
-
[
|
4
|
-
|
5
|
-
This module provides access to the {zlib library}[http://zlib.net]. Zlib is designed to be a portable, free, general-purpose, legally unencumbered -- that is, not covered by any patents -- lossless data-compression library for use on virtually any computer hardware and operating system.
|
3
|
+
This module provides access to the [zlib library](http://zlib.net). Zlib is designed to be a portable, free, general-purpose, legally unencumbered -- that is, not covered by any patents -- lossless data-compression library for use on virtually any computer hardware and operating system.
|
6
4
|
|
7
5
|
The zlib compression library provides in-memory compression and decompression functions, including integrity checks of the uncompressed data.
|
8
6
|
|
data/ext/zlib/extconf.rb
CHANGED
@@ -31,9 +31,12 @@ else
|
|
31
31
|
$extso << dll
|
32
32
|
$cleanfiles << "$(topdir)/#{dll}" << "$(ZIMPLIB)"
|
33
33
|
zmk = "\t$(MAKE) -f $(ZMKFILE) TOP=$(ZSRC)"
|
34
|
+
zopts = []
|
34
35
|
if $nmake
|
35
36
|
zmkfile = "$(ZSRC)/win32/Makefile.msc"
|
36
37
|
m = "#{zsrc}/win32/Makefile.msc"
|
38
|
+
# zopts << "USE_ASM=1"
|
39
|
+
zopts << "ARCH=#{RbConfig::CONFIG['target_cpu']}"
|
37
40
|
else
|
38
41
|
zmkfile = "$(ZSRC)/win32/Makefile.gcc"
|
39
42
|
m = "#{zsrc}/win32/Makefile.gcc"
|
@@ -55,9 +58,10 @@ else
|
|
55
58
|
addconf.push(
|
56
59
|
"ZMKFILE = #{zmkfile}\n",
|
57
60
|
"ZIMPLIB = #{zimplib}\n",
|
61
|
+
"ZOPTS = #{zopts.join(' ')}\n",
|
58
62
|
"$(TARGET_SO): $(ZIMPLIB)\n",
|
59
63
|
"$(ZIMPLIB):\n",
|
60
|
-
"#{zmk} $@\n",
|
64
|
+
"#{zmk} $(ZOPTS) $@\n",
|
61
65
|
"install-so: $(topdir)/#{dll}",
|
62
66
|
"$(topdir)/#{dll}: $(ZIMPLIB)\n",
|
63
67
|
"\t$(Q) $(COPY) #{dll} $(@D)\n",
|
data/ext/zlib/zlib.c
CHANGED
@@ -25,7 +25,7 @@
|
|
25
25
|
# define VALGRIND_MAKE_MEM_UNDEFINED(p, n) 0
|
26
26
|
#endif
|
27
27
|
|
28
|
-
#define RUBY_ZLIB_VERSION "
|
28
|
+
#define RUBY_ZLIB_VERSION "2.0.0"
|
29
29
|
|
30
30
|
#ifndef RB_PASS_CALLED_KEYWORDS
|
31
31
|
# define rb_class_new_instance_kw(argc, argv, klass, kw_splat) rb_class_new_instance(argc, argv, klass)
|
@@ -56,7 +56,10 @@ max_uint(long n)
|
|
56
56
|
#define MAX_UINT(n) (uInt)(n)
|
57
57
|
#endif
|
58
58
|
|
59
|
-
|
59
|
+
#define OPTHASH_GIVEN_P(opts) \
|
60
|
+
(argc > 0 && !NIL_P((opts) = rb_check_hash_type(argv[argc-1])) && (--argc, 1))
|
61
|
+
|
62
|
+
static ID id_dictionaries, id_read, id_buffer;
|
60
63
|
|
61
64
|
/*--------- Prototypes --------*/
|
62
65
|
|
@@ -130,7 +133,7 @@ static VALUE rb_inflate_s_allocate(VALUE);
|
|
130
133
|
static VALUE rb_inflate_initialize(int, VALUE*, VALUE);
|
131
134
|
static VALUE rb_inflate_s_inflate(VALUE, VALUE);
|
132
135
|
static void do_inflate(struct zstream*, VALUE);
|
133
|
-
static VALUE rb_inflate_inflate(
|
136
|
+
static VALUE rb_inflate_inflate(int, VALUE*, VALUE);
|
134
137
|
static VALUE rb_inflate_addstr(VALUE, VALUE);
|
135
138
|
static VALUE rb_inflate_sync(VALUE, VALUE);
|
136
139
|
static VALUE rb_inflate_sync_point_p(VALUE);
|
@@ -407,6 +410,15 @@ do_checksum(int argc, VALUE *argv, uLong (*func)(uLong, const Bytef*, uInt))
|
|
407
410
|
if (NIL_P(str)) {
|
408
411
|
sum = func(sum, Z_NULL, 0);
|
409
412
|
}
|
413
|
+
else if (rb_obj_is_kind_of(str, rb_cIO)) {
|
414
|
+
VALUE buf;
|
415
|
+
VALUE buflen = INT2NUM(8192);
|
416
|
+
|
417
|
+
while (!NIL_P(buf = rb_funcall(str, id_read, 1, buflen))) {
|
418
|
+
StringValue(buf);
|
419
|
+
sum = checksum_long(func, sum, (Bytef*)RSTRING_PTR(buf), RSTRING_LEN(buf));
|
420
|
+
}
|
421
|
+
}
|
410
422
|
else {
|
411
423
|
StringValue(str);
|
412
424
|
sum = checksum_long(func, sum, (Bytef*)RSTRING_PTR(str), RSTRING_LEN(str));
|
@@ -422,6 +434,8 @@ do_checksum(int argc, VALUE *argv, uLong (*func)(uLong, const Bytef*, uInt))
|
|
422
434
|
* Calculates Adler-32 checksum for +string+, and returns updated value of
|
423
435
|
* +adler+. If +string+ is omitted, it returns the Adler-32 initial value. If
|
424
436
|
* +adler+ is omitted, it assumes that the initial value is given to +adler+.
|
437
|
+
* If +string+ is an IO instance, reads from the IO until the IO returns nil
|
438
|
+
* and returns Adler-32 of all read data.
|
425
439
|
*
|
426
440
|
* Example usage:
|
427
441
|
*
|
@@ -466,7 +480,9 @@ rb_zlib_adler32_combine(VALUE klass, VALUE adler1, VALUE adler2, VALUE len2)
|
|
466
480
|
*
|
467
481
|
* Calculates CRC checksum for +string+, and returns updated value of +crc+. If
|
468
482
|
* +string+ is omitted, it returns the CRC initial value. If +crc+ is omitted, it
|
469
|
-
* assumes that the initial value is given to +crc+.
|
483
|
+
* assumes that the initial value is given to +crc+. If +string+ is an IO instance,
|
484
|
+
* reads from the IO until the IO returns nil and returns CRC checksum of all read
|
485
|
+
* data.
|
470
486
|
*
|
471
487
|
* FIXME: expression.
|
472
488
|
*/
|
@@ -544,7 +560,8 @@ struct zstream {
|
|
544
560
|
#define ZSTREAM_FLAG_CLOSING 0x8
|
545
561
|
#define ZSTREAM_FLAG_GZFILE 0x10 /* disallows yield from expand_buffer for
|
546
562
|
gzip*/
|
547
|
-
#define
|
563
|
+
#define ZSTREAM_REUSE_BUFFER 0x20
|
564
|
+
#define ZSTREAM_FLAG_UNUSED 0x40
|
548
565
|
|
549
566
|
#define ZSTREAM_READY(z) ((z)->flags |= ZSTREAM_FLAG_READY)
|
550
567
|
#define ZSTREAM_IS_READY(z) ((z)->flags & ZSTREAM_FLAG_READY)
|
@@ -553,6 +570,8 @@ struct zstream {
|
|
553
570
|
#define ZSTREAM_IS_GZFILE(z) ((z)->flags & ZSTREAM_FLAG_GZFILE)
|
554
571
|
#define ZSTREAM_BUF_FILLED(z) (NIL_P((z)->buf) ? 0 : RSTRING_LEN((z)->buf))
|
555
572
|
|
573
|
+
#define ZSTREAM_REUSE_BUFFER_P(z) ((z)->flags & ZSTREAM_REUSE_BUFFER)
|
574
|
+
|
556
575
|
#define ZSTREAM_EXPAND_BUFFER_OK 0
|
557
576
|
|
558
577
|
/* I think that more better value should be found,
|
@@ -629,11 +648,19 @@ zstream_expand_buffer(struct zstream *z)
|
|
629
648
|
if (buf_filled >= ZSTREAM_AVAIL_OUT_STEP_MAX) {
|
630
649
|
int state = 0;
|
631
650
|
|
632
|
-
|
651
|
+
if (!ZSTREAM_REUSE_BUFFER_P(z)) {
|
652
|
+
rb_obj_reveal(z->buf, rb_cString);
|
653
|
+
}
|
633
654
|
|
634
655
|
rb_protect(rb_yield, z->buf, &state);
|
635
656
|
|
636
|
-
|
657
|
+
if (ZSTREAM_REUSE_BUFFER_P(z)) {
|
658
|
+
rb_str_modify(z->buf);
|
659
|
+
rb_str_set_len(z->buf, 0);
|
660
|
+
}
|
661
|
+
else {
|
662
|
+
z->buf = Qnil;
|
663
|
+
}
|
637
664
|
zstream_expand_buffer_into(z, ZSTREAM_AVAIL_OUT_STEP_MAX);
|
638
665
|
|
639
666
|
if (state)
|
@@ -751,7 +778,9 @@ zstream_detach_buffer(struct zstream *z)
|
|
751
778
|
}
|
752
779
|
else {
|
753
780
|
dst = z->buf;
|
754
|
-
|
781
|
+
if (!ZSTREAM_REUSE_BUFFER_P(z)) {
|
782
|
+
rb_obj_reveal(dst, rb_cString);
|
783
|
+
}
|
755
784
|
}
|
756
785
|
|
757
786
|
z->buf = Qnil;
|
@@ -2000,8 +2029,8 @@ rb_inflate_add_dictionary(VALUE obj, VALUE dictionary)
|
|
2000
2029
|
* Document-method: Zlib::Inflate#inflate
|
2001
2030
|
*
|
2002
2031
|
* call-seq:
|
2003
|
-
* inflate(deflate_string) -> String
|
2004
|
-
* inflate(deflate_string) { |chunk| ... } -> nil
|
2032
|
+
* inflate(deflate_string, buffer: nil) -> String
|
2033
|
+
* inflate(deflate_string, buffer: nil) { |chunk| ... } -> nil
|
2005
2034
|
*
|
2006
2035
|
* Inputs +deflate_string+ into the inflate stream and returns the output from
|
2007
2036
|
* the stream. Calling this method, both the input and the output buffer of
|
@@ -2011,6 +2040,15 @@ rb_inflate_add_dictionary(VALUE obj, VALUE dictionary)
|
|
2011
2040
|
* If a block is given consecutive inflated chunks from the +deflate_string+
|
2012
2041
|
* are yielded to the block and +nil+ is returned.
|
2013
2042
|
*
|
2043
|
+
* If a :buffer keyword argument is given and not nil:
|
2044
|
+
*
|
2045
|
+
* * The :buffer keyword should be a String, and will used as the output buffer.
|
2046
|
+
* Using this option can reuse the memory required during inflation.
|
2047
|
+
* * When not passing a block, the return value will be the same object as the
|
2048
|
+
* :buffer keyword argument.
|
2049
|
+
* * When passing a block, the yielded chunks will be the same value as the
|
2050
|
+
* :buffer keyword argument.
|
2051
|
+
*
|
2014
2052
|
* Raises a Zlib::NeedDict exception if a preset dictionary is needed to
|
2015
2053
|
* decompress. Set the dictionary by Zlib::Inflate#set_dictionary and then
|
2016
2054
|
* call this method again with an empty string to flush the stream:
|
@@ -2034,10 +2072,37 @@ rb_inflate_add_dictionary(VALUE obj, VALUE dictionary)
|
|
2034
2072
|
* See also Zlib::Inflate.new
|
2035
2073
|
*/
|
2036
2074
|
static VALUE
|
2037
|
-
rb_inflate_inflate(VALUE
|
2075
|
+
rb_inflate_inflate(int argc, VALUE* argv, VALUE obj)
|
2038
2076
|
{
|
2039
2077
|
struct zstream *z = get_zstream(obj);
|
2040
|
-
VALUE dst;
|
2078
|
+
VALUE dst, src, opts, buffer = Qnil;
|
2079
|
+
|
2080
|
+
if (OPTHASH_GIVEN_P(opts)) {
|
2081
|
+
VALUE buf;
|
2082
|
+
rb_get_kwargs(opts, &id_buffer, 0, 1, &buf);
|
2083
|
+
if (buf != Qundef && buf != Qnil) {
|
2084
|
+
buffer = StringValue(buf);
|
2085
|
+
}
|
2086
|
+
}
|
2087
|
+
if (buffer != Qnil) {
|
2088
|
+
if (!(ZSTREAM_REUSE_BUFFER_P(z) && z->buf == buffer)) {
|
2089
|
+
long len = RSTRING_LEN(buffer);
|
2090
|
+
if (len >= ZSTREAM_AVAIL_OUT_STEP_MAX) {
|
2091
|
+
rb_str_modify(buffer);
|
2092
|
+
}
|
2093
|
+
else {
|
2094
|
+
len = ZSTREAM_AVAIL_OUT_STEP_MAX - len;
|
2095
|
+
rb_str_modify_expand(buffer, len);
|
2096
|
+
}
|
2097
|
+
rb_str_set_len(buffer, 0);
|
2098
|
+
z->flags |= ZSTREAM_REUSE_BUFFER;
|
2099
|
+
z->buf = buffer;
|
2100
|
+
}
|
2101
|
+
} else if (ZSTREAM_REUSE_BUFFER_P(z)) {
|
2102
|
+
z->flags &= ~ZSTREAM_REUSE_BUFFER;
|
2103
|
+
z->buf = Qnil;
|
2104
|
+
}
|
2105
|
+
rb_scan_args(argc, argv, "10", &src);
|
2041
2106
|
|
2042
2107
|
if (ZSTREAM_IS_FINISHED(z)) {
|
2043
2108
|
if (NIL_P(src)) {
|
@@ -2046,7 +2111,11 @@ rb_inflate_inflate(VALUE obj, VALUE src)
|
|
2046
2111
|
else {
|
2047
2112
|
StringValue(src);
|
2048
2113
|
zstream_append_buffer2(z, src);
|
2049
|
-
|
2114
|
+
if (ZSTREAM_REUSE_BUFFER_P(z)) {
|
2115
|
+
dst = rb_str_resize(buffer, 0);
|
2116
|
+
} else {
|
2117
|
+
dst = rb_str_new(0, 0);
|
2118
|
+
}
|
2050
2119
|
}
|
2051
2120
|
}
|
2052
2121
|
else {
|
@@ -2198,7 +2267,7 @@ rb_inflate_set_dictionary(VALUE obj, VALUE dic)
|
|
2198
2267
|
#define OS_CODE OS_UNIX
|
2199
2268
|
#endif
|
2200
2269
|
|
2201
|
-
static ID id_write,
|
2270
|
+
static ID id_write, id_readpartial, id_flush, id_seek, id_close, id_path, id_input;
|
2202
2271
|
static VALUE cGzError, cNoFooter, cCRCError, cLengthError;
|
2203
2272
|
|
2204
2273
|
|
@@ -3723,6 +3792,60 @@ rb_gzreader_s_open(int argc, VALUE *argv, VALUE klass)
|
|
3723
3792
|
return gzfile_s_open(argc, argv, klass, "rb");
|
3724
3793
|
}
|
3725
3794
|
|
3795
|
+
/*
|
3796
|
+
* Document-method: Zlib::GzipReader.zcat
|
3797
|
+
*
|
3798
|
+
* call-seq:
|
3799
|
+
* Zlib::GzipReader.zcat(io, options = {}, &block) => nil
|
3800
|
+
* Zlib::GzipReader.zcat(io, options = {}) => string
|
3801
|
+
*
|
3802
|
+
* Decompresses all gzip data in the +io+, handling multiple gzip
|
3803
|
+
* streams until the end of the +io+. There should not be any non-gzip
|
3804
|
+
* data after the gzip streams.
|
3805
|
+
*
|
3806
|
+
* If a block is given, it is yielded strings of uncompressed data,
|
3807
|
+
* and the method returns +nil+.
|
3808
|
+
* If a block is not given, the method returns the concatenation of
|
3809
|
+
* all uncompressed data in all gzip streams.
|
3810
|
+
*/
|
3811
|
+
static VALUE
|
3812
|
+
rb_gzreader_s_zcat(int argc, VALUE *argv, VALUE klass)
|
3813
|
+
{
|
3814
|
+
VALUE io, unused, obj, buf=0, tmpbuf;
|
3815
|
+
long pos;
|
3816
|
+
|
3817
|
+
rb_check_arity(argc, 1, 2);
|
3818
|
+
io = argv[0];
|
3819
|
+
|
3820
|
+
do {
|
3821
|
+
obj = rb_funcallv(klass, rb_intern("new"), argc, argv);
|
3822
|
+
if (rb_block_given_p()) {
|
3823
|
+
rb_gzreader_each(0, 0, obj);
|
3824
|
+
}
|
3825
|
+
else {
|
3826
|
+
if (!buf) {
|
3827
|
+
buf = rb_str_new(0, 0);
|
3828
|
+
}
|
3829
|
+
tmpbuf = gzfile_read_all(get_gzfile(obj));
|
3830
|
+
rb_str_cat(buf, RSTRING_PTR(tmpbuf), RSTRING_LEN(tmpbuf));
|
3831
|
+
}
|
3832
|
+
|
3833
|
+
rb_gzreader_read(0, 0, obj);
|
3834
|
+
pos = NUM2LONG(rb_funcall(io, rb_intern("pos"), 0));
|
3835
|
+
unused = rb_gzreader_unused(obj);
|
3836
|
+
rb_gzfile_finish(obj);
|
3837
|
+
if (!NIL_P(unused)) {
|
3838
|
+
pos -= NUM2LONG(rb_funcall(unused, rb_intern("length"), 0));
|
3839
|
+
rb_funcall(io, rb_intern("pos="), 1, LONG2NUM(pos));
|
3840
|
+
}
|
3841
|
+
} while (pos < NUM2LONG(rb_funcall(io, rb_intern("size"), 0)));
|
3842
|
+
|
3843
|
+
if (rb_block_given_p()) {
|
3844
|
+
return Qnil;
|
3845
|
+
}
|
3846
|
+
return buf;
|
3847
|
+
}
|
3848
|
+
|
3726
3849
|
/*
|
3727
3850
|
* Document-method: Zlib::GzipReader.new
|
3728
3851
|
*
|
@@ -3949,20 +4072,6 @@ rb_gzreader_each_byte(VALUE obj)
|
|
3949
4072
|
return Qnil;
|
3950
4073
|
}
|
3951
4074
|
|
3952
|
-
/*
|
3953
|
-
* Document-method: Zlib::GzipReader#bytes
|
3954
|
-
*
|
3955
|
-
* This is a deprecated alias for <code>each_byte</code>.
|
3956
|
-
*/
|
3957
|
-
static VALUE
|
3958
|
-
rb_gzreader_bytes(VALUE obj)
|
3959
|
-
{
|
3960
|
-
rb_warn("Zlib::GzipReader#bytes is deprecated; use #each_byte instead");
|
3961
|
-
if (!rb_block_given_p())
|
3962
|
-
return rb_enumeratorize(obj, ID2SYM(rb_intern("each_byte")), 0, 0);
|
3963
|
-
return rb_gzreader_each_byte(obj);
|
3964
|
-
}
|
3965
|
-
|
3966
4075
|
/*
|
3967
4076
|
* Document-method: Zlib::GzipReader#ungetc
|
3968
4077
|
*
|
@@ -4189,6 +4298,8 @@ gzreader_gets(int argc, VALUE *argv, VALUE obj)
|
|
4189
4298
|
* Document-method: Zlib::GzipReader#gets
|
4190
4299
|
*
|
4191
4300
|
* See Zlib::GzipReader documentation for a description.
|
4301
|
+
* However, note that this method can return +nil+ even if
|
4302
|
+
* #eof? returns false, unlike the behavior of File#gets.
|
4192
4303
|
*/
|
4193
4304
|
static VALUE
|
4194
4305
|
rb_gzreader_gets(int argc, VALUE *argv, VALUE obj)
|
@@ -4235,20 +4346,6 @@ rb_gzreader_each(int argc, VALUE *argv, VALUE obj)
|
|
4235
4346
|
return obj;
|
4236
4347
|
}
|
4237
4348
|
|
4238
|
-
/*
|
4239
|
-
* Document-method: Zlib::GzipReader#lines
|
4240
|
-
*
|
4241
|
-
* This is a deprecated alias for <code>each_line</code>.
|
4242
|
-
*/
|
4243
|
-
static VALUE
|
4244
|
-
rb_gzreader_lines(int argc, VALUE *argv, VALUE obj)
|
4245
|
-
{
|
4246
|
-
rb_warn("Zlib::GzipReader#lines is deprecated; use #each_line instead");
|
4247
|
-
if (!rb_block_given_p())
|
4248
|
-
return rb_enumeratorize(obj, ID2SYM(rb_intern("each_line")), argc, argv);
|
4249
|
-
return rb_gzreader_each(argc, argv, obj);
|
4250
|
-
}
|
4251
|
-
|
4252
4349
|
/*
|
4253
4350
|
* Document-method: Zlib::GzipReader#readlines
|
4254
4351
|
*
|
@@ -4299,8 +4396,6 @@ zlib_gzip_end(struct gzfile *gz)
|
|
4299
4396
|
zstream_end(&gz->z);
|
4300
4397
|
}
|
4301
4398
|
|
4302
|
-
#define OPTHASH_GIVEN_P(opts) \
|
4303
|
-
(argc > 0 && !NIL_P((opts) = rb_check_hash_type(argv[argc-1])) && (--argc, 1))
|
4304
4399
|
static ID id_level, id_strategy;
|
4305
4400
|
static VALUE zlib_gzip_run(VALUE arg);
|
4306
4401
|
|
@@ -4453,6 +4548,10 @@ zlib_gunzip_run(VALUE arg)
|
|
4453
4548
|
void
|
4454
4549
|
Init_zlib(void)
|
4455
4550
|
{
|
4551
|
+
#if HAVE_RB_EXT_RACTOR_SAFE
|
4552
|
+
rb_ext_ractor_safe(true);
|
4553
|
+
#endif
|
4554
|
+
|
4456
4555
|
#undef rb_intern
|
4457
4556
|
VALUE mZlib, cZStream, cDeflate, cInflate;
|
4458
4557
|
#if GZIP_SUPPORT
|
@@ -4547,7 +4646,7 @@ Init_zlib(void)
|
|
4547
4646
|
rb_define_alloc_func(cInflate, rb_inflate_s_allocate);
|
4548
4647
|
rb_define_method(cInflate, "initialize", rb_inflate_initialize, -1);
|
4549
4648
|
rb_define_method(cInflate, "add_dictionary", rb_inflate_add_dictionary, 1);
|
4550
|
-
rb_define_method(cInflate, "inflate", rb_inflate_inflate, 1);
|
4649
|
+
rb_define_method(cInflate, "inflate", rb_inflate_inflate, -1);
|
4551
4650
|
rb_define_method(cInflate, "<<", rb_inflate_addstr, 1);
|
4552
4651
|
rb_define_method(cInflate, "sync", rb_inflate_sync, 1);
|
4553
4652
|
rb_define_method(cInflate, "sync_point?", rb_inflate_sync_point_p, 0);
|
@@ -4696,6 +4795,7 @@ Init_zlib(void)
|
|
4696
4795
|
rb_define_method(cGzipWriter, "puts", rb_gzwriter_puts, -1);
|
4697
4796
|
|
4698
4797
|
rb_define_singleton_method(cGzipReader, "open", rb_gzreader_s_open,-1);
|
4798
|
+
rb_define_singleton_method(cGzipReader, "zcat", rb_gzreader_s_zcat, -1);
|
4699
4799
|
rb_define_alloc_func(cGzipReader, rb_gzreader_s_allocate);
|
4700
4800
|
rb_define_method(cGzipReader, "initialize", rb_gzreader_initialize, -1);
|
4701
4801
|
rb_define_method(cGzipReader, "rewind", rb_gzreader_rewind, 0);
|
@@ -4708,14 +4808,12 @@ Init_zlib(void)
|
|
4708
4808
|
rb_define_method(cGzipReader, "readbyte", rb_gzreader_readbyte, 0);
|
4709
4809
|
rb_define_method(cGzipReader, "each_byte", rb_gzreader_each_byte, 0);
|
4710
4810
|
rb_define_method(cGzipReader, "each_char", rb_gzreader_each_char, 0);
|
4711
|
-
rb_define_method(cGzipReader, "bytes", rb_gzreader_bytes, 0);
|
4712
4811
|
rb_define_method(cGzipReader, "ungetc", rb_gzreader_ungetc, 1);
|
4713
4812
|
rb_define_method(cGzipReader, "ungetbyte", rb_gzreader_ungetbyte, 1);
|
4714
4813
|
rb_define_method(cGzipReader, "gets", rb_gzreader_gets, -1);
|
4715
4814
|
rb_define_method(cGzipReader, "readline", rb_gzreader_readline, -1);
|
4716
4815
|
rb_define_method(cGzipReader, "each", rb_gzreader_each, -1);
|
4717
4816
|
rb_define_method(cGzipReader, "each_line", rb_gzreader_each, -1);
|
4718
|
-
rb_define_method(cGzipReader, "lines", rb_gzreader_lines, -1);
|
4719
4817
|
rb_define_method(cGzipReader, "readlines", rb_gzreader_readlines, -1);
|
4720
4818
|
rb_define_method(cGzipReader, "external_encoding", rb_gzreader_external_encoding, 0);
|
4721
4819
|
|
@@ -4757,6 +4855,7 @@ Init_zlib(void)
|
|
4757
4855
|
|
4758
4856
|
id_level = rb_intern("level");
|
4759
4857
|
id_strategy = rb_intern("strategy");
|
4858
|
+
id_buffer = rb_intern("buffer");
|
4760
4859
|
#endif /* GZIP_SUPPORT */
|
4761
4860
|
}
|
4762
4861
|
|
data/zlib.gemspec
CHANGED
@@ -20,9 +20,9 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.summary = %q{Ruby interface for the zlib compression/decompression library}
|
21
21
|
spec.description = %q{Ruby interface for the zlib compression/decompression library}
|
22
22
|
spec.homepage = "https://github.com/ruby/zlib"
|
23
|
-
spec.
|
23
|
+
spec.licenses = ["Ruby", "BSD-2-Clause"]
|
24
24
|
|
25
|
-
spec.files = [".gitignore",
|
25
|
+
spec.files = [".gitignore", "Gemfile", "LICENSE.txt", "README.md", "Rakefile", "bin/console", "bin/setup", "ext/zlib/extconf.rb", "ext/zlib/zlib.c", "zlib.gemspec"]
|
26
26
|
spec.bindir = "exe"
|
27
27
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
28
28
|
spec.require_paths = ["lib"]
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zlib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yukihiro Matsumoto
|
8
8
|
- UENO Katsuhiro
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2021-10-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -56,14 +56,13 @@ dependencies:
|
|
56
56
|
description: Ruby interface for the zlib compression/decompression library
|
57
57
|
email:
|
58
58
|
- matz@ruby-lang.org
|
59
|
-
-
|
59
|
+
-
|
60
60
|
executables: []
|
61
61
|
extensions:
|
62
62
|
- ext/zlib/extconf.rb
|
63
63
|
extra_rdoc_files: []
|
64
64
|
files:
|
65
65
|
- ".gitignore"
|
66
|
-
- ".travis.yml"
|
67
66
|
- Gemfile
|
68
67
|
- LICENSE.txt
|
69
68
|
- README.md
|
@@ -75,9 +74,10 @@ files:
|
|
75
74
|
- zlib.gemspec
|
76
75
|
homepage: https://github.com/ruby/zlib
|
77
76
|
licenses:
|
77
|
+
- Ruby
|
78
78
|
- BSD-2-Clause
|
79
79
|
metadata: {}
|
80
|
-
post_install_message:
|
80
|
+
post_install_message:
|
81
81
|
rdoc_options: []
|
82
82
|
require_paths:
|
83
83
|
- lib
|
@@ -92,8 +92,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
92
92
|
- !ruby/object:Gem::Version
|
93
93
|
version: '0'
|
94
94
|
requirements: []
|
95
|
-
rubygems_version: 3.0.
|
96
|
-
signing_key:
|
95
|
+
rubygems_version: 3.3.0.dev
|
96
|
+
signing_key:
|
97
97
|
specification_version: 4
|
98
98
|
summary: Ruby interface for the zlib compression/decompression library
|
99
99
|
test_files: []
|