rubyzip 3.0.1 → 3.0.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7c2bb6e50eaebd7d5142317949277bb4ff7f38248d87ff16856b5afd428a886c
4
- data.tar.gz: e2e5ce63d0e2bb370723d4eb642502b8574af322326a971e1222c8e3b696c061
3
+ metadata.gz: c4afc6447f838d0d2edc82bb44ab842a5c45f50bd47d453aae1a7b487c9dcbee
4
+ data.tar.gz: 776833d664351c8e0323826263d16b2b11486fee80a7ceda1a8385d05dd2a38e
5
5
  SHA512:
6
- metadata.gz: eebc2d4fb0fe6bd3632a49f489cb0fc1e9d727cd8867162b419a9851a3d4f95db7614bb171f6bad2418be69ee353c26180b3c7b202602a436e2a20f80eecb613
7
- data.tar.gz: 4df75a096e8b9e3dfe67e35d6418a4c9cb06945d224d9e09b4082baabfbc01b3a698e737a306c539b29b449a970c290379275b4db95a08fd62cf9a177c616c29
6
+ metadata.gz: b52059d2cfba5c05959bb347383d4bfe79c8f3c0f945cba64362462267c750f0e16e13f63fbf272b2cf0935173678b876164c3993ddae85fb89dec726afea940
7
+ data.tar.gz: 83a932fbadf6fbafa0a1e64434f0b2a2b7f58fb56d9015350eae217430f9afaf5492254a56de9be124bdf9676a8a5aa373515c996ce2f74966aceb87b72472d1
data/Changelog.md CHANGED
@@ -1,3 +1,10 @@
1
+ # 3.0.2 (2025-08-21)
2
+
3
+ - Fix `InputStream#sysread` to handle frozen string literals. [#643](https://github.com/rubyzip/rubyzip/pull/643)
4
+ - Ensure that we don't flush too often when deflating. [#322](https://github.com/rubyzip/rubyzip/issues/322)
5
+ - Stop `print` causing Zlib errors. [#642](https://github.com/rubyzip/rubyzip/issues/642)
6
+ - Ensure that `print` and `printf` return `nil`.
7
+
1
8
  # 3.0.1 (2025-08-08)
2
9
 
3
10
  - Restore `Zip::File`'s `Enumerable` status. [#641](https://github.com/rubyzip/rubyzip/issues/641)
data/lib/zip/deflater.rb CHANGED
@@ -15,7 +15,9 @@ module Zip
15
15
  val = data.to_s
16
16
  @crc = Zlib.crc32(val, @crc)
17
17
  @size += val.bytesize
18
- buffer = @zlib_deflater.deflate(data, Zlib::SYNC_FLUSH)
18
+
19
+ # When JRuby#3962 is fixed, we can remove the flushing parameter here.
20
+ buffer = @zlib_deflater.deflate(data, Zip::ZLIB_FLUSHING_STRATEGY)
19
21
  return @output_stream if buffer.empty?
20
22
 
21
23
  @output_stream << @encrypter.encrypt(buffer)
@@ -90,7 +90,7 @@ module Zip
90
90
  end
91
91
 
92
92
  # Modeled after IO.sysread
93
- def sysread(length = nil, outbuf = '')
93
+ def sysread(length = nil, outbuf = +'')
94
94
  @decompressor.read(length, outbuf)
95
95
  end
96
96
 
@@ -13,11 +13,19 @@ module Zip
13
13
  end
14
14
 
15
15
  def print(*params)
16
- self << params.join << $OUTPUT_RECORD_SEPARATOR.to_s
16
+ self << params.join
17
+
18
+ # Deflate doesn't like `nil`s or empty strings!
19
+ unless $OUTPUT_RECORD_SEPARATOR.nil? || $OUTPUT_RECORD_SEPARATOR.empty?
20
+ self << $OUTPUT_RECORD_SEPARATOR
21
+ end
22
+
23
+ nil
17
24
  end
18
25
 
19
26
  def printf(a_format_string, *params)
20
27
  self << format(a_format_string, *params)
28
+ nil
21
29
  end
22
30
 
23
31
  def putc(an_object)
data/lib/zip/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Zip
4
- VERSION = '3.0.1'
4
+ VERSION = '3.0.2'
5
5
  end
data/lib/zip.rb CHANGED
@@ -60,6 +60,10 @@ module Zip
60
60
  restore_times: true
61
61
  }.freeze # :nodoc:
62
62
 
63
+ # :nodoc:
64
+ # Remove this when JRuby#3962 is fixed.
65
+ ZLIB_FLUSHING_STRATEGY = defined?(JRUBY_VERSION) ? Zlib::SYNC_FLUSH : Zlib::NO_FLUSH
66
+
63
67
  def reset! # :nodoc:
64
68
  @_ran_once = false
65
69
  @unicode_names = false
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubyzip
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 3.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Haines
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2025-08-08 00:00:00.000000000 Z
13
+ date: 2025-08-21 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: minitest
@@ -195,9 +195,9 @@ licenses:
195
195
  - BSD-2-Clause
196
196
  metadata:
197
197
  bug_tracker_uri: https://github.com/rubyzip/rubyzip/issues
198
- changelog_uri: https://github.com/rubyzip/rubyzip/blob/v3.0.1/Changelog.md
199
- documentation_uri: https://www.rubydoc.info/gems/rubyzip/3.0.1
200
- source_code_uri: https://github.com/rubyzip/rubyzip/tree/v3.0.1
198
+ changelog_uri: https://github.com/rubyzip/rubyzip/blob/v3.0.2/Changelog.md
199
+ documentation_uri: https://www.rubydoc.info/gems/rubyzip/3.0.2
200
+ source_code_uri: https://github.com/rubyzip/rubyzip/tree/v3.0.2
201
201
  wiki_uri: https://github.com/rubyzip/rubyzip/wiki
202
202
  rubygems_mfa_required: 'true'
203
203
  post_install_message: