rubyzip 2.4.1 → 3.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/Changelog.md +419 -0
  3. data/LICENSE.md +24 -0
  4. data/README.md +137 -37
  5. data/Rakefile +11 -7
  6. data/lib/zip/central_directory.rb +169 -123
  7. data/lib/zip/compressor.rb +3 -1
  8. data/lib/zip/constants.rb +29 -21
  9. data/lib/zip/crypto/decrypted_io.rb +4 -2
  10. data/lib/zip/crypto/encryption.rb +4 -2
  11. data/lib/zip/crypto/null_encryption.rb +6 -4
  12. data/lib/zip/crypto/traditional_encryption.rb +8 -6
  13. data/lib/zip/decompressor.rb +4 -3
  14. data/lib/zip/deflater.rb +10 -8
  15. data/lib/zip/dirtyable.rb +32 -0
  16. data/lib/zip/dos_time.rb +43 -4
  17. data/lib/zip/entry.rb +333 -242
  18. data/lib/zip/entry_set.rb +11 -9
  19. data/lib/zip/errors.rb +136 -16
  20. data/lib/zip/extra_field/generic.rb +6 -13
  21. data/lib/zip/extra_field/ntfs.rb +6 -4
  22. data/lib/zip/extra_field/old_unix.rb +3 -1
  23. data/lib/zip/extra_field/universal_time.rb +3 -1
  24. data/lib/zip/extra_field/unix.rb +5 -3
  25. data/lib/zip/extra_field/unknown.rb +33 -0
  26. data/lib/zip/extra_field/zip64.rb +12 -5
  27. data/lib/zip/extra_field.rb +16 -22
  28. data/lib/zip/file.rb +166 -264
  29. data/lib/zip/file_split.rb +91 -0
  30. data/lib/zip/filesystem/dir.rb +86 -0
  31. data/lib/zip/filesystem/directory_iterator.rb +48 -0
  32. data/lib/zip/filesystem/file.rb +262 -0
  33. data/lib/zip/filesystem/file_stat.rb +110 -0
  34. data/lib/zip/filesystem/zip_file_name_mapper.rb +81 -0
  35. data/lib/zip/filesystem.rb +27 -596
  36. data/lib/zip/inflater.rb +7 -5
  37. data/lib/zip/input_stream.rb +50 -50
  38. data/lib/zip/ioextras/abstract_input_stream.rb +16 -11
  39. data/lib/zip/ioextras/abstract_output_stream.rb +5 -3
  40. data/lib/zip/ioextras.rb +7 -7
  41. data/lib/zip/null_compressor.rb +3 -1
  42. data/lib/zip/null_decompressor.rb +3 -1
  43. data/lib/zip/null_input_stream.rb +3 -1
  44. data/lib/zip/output_stream.rb +55 -56
  45. data/lib/zip/pass_thru_compressor.rb +3 -1
  46. data/lib/zip/pass_thru_decompressor.rb +4 -2
  47. data/lib/zip/streamable_directory.rb +3 -1
  48. data/lib/zip/streamable_stream.rb +3 -0
  49. data/lib/zip/version.rb +3 -1
  50. data/lib/zip.rb +18 -22
  51. data/rubyzip.gemspec +39 -0
  52. data/samples/example.rb +8 -3
  53. data/samples/example_filesystem.rb +3 -2
  54. data/samples/example_recursive.rb +3 -1
  55. data/samples/gtk_ruby_zip.rb +4 -2
  56. data/samples/qtzip.rb +6 -5
  57. data/samples/write_simple.rb +2 -1
  58. data/samples/zipfind.rb +1 -0
  59. metadata +87 -51
  60. data/TODO +0 -15
  61. data/lib/zip/extra_field/zip64_placeholder.rb +0 -15
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2d59784cc9a5e884c6537a896b30b1a18206c7a97a0f74e37bd58769f0700497
4
- data.tar.gz: 7e4bf8643b179bb0e5415b0f6aa7e92ce4786ed734cf23b902ea9739d5c46bb9
3
+ metadata.gz: 2840381c70e4bc8b3fbbfc003e4caf71dab05301621a411b44dc16cd962ca4fb
4
+ data.tar.gz: 75199ebb2cf53b8a53b930a0ef908773328b4cab2dadef4839fe8194fced289c
5
5
  SHA512:
6
- metadata.gz: c65346fc54aa6e931f8975a8e98212323a597583523a251d2d88184971a9469a549e9cd967c2d6015002f07fe8c19b13d96261781131b9bd7a0b099da1c04fe2
7
- data.tar.gz: b397b12e1bef39a1cd4ade2698756f3194ed75504fb15ea5494dc26189be4a8d66af1a2411e827b660f67044ef4ee207c3d951d190886912079ce8ffcbf19bac
6
+ metadata.gz: 1716ef6a03ee08773e4dba640be0fe0e294e4a955b2535d5049dd62c37cc82e161827c2e226c9b93c883f6789c9f275d30e267733038aee59e2c4a80f55193e1
7
+ data.tar.gz: b4b320f64167dd5f464e45d61d49b2e49619bc356cd2d59f617dfd8ebe7a1be5724e294bab2498186dde951cfd7453a5a4b09f15fd6f88f9872234956182241a
data/Changelog.md ADDED
@@ -0,0 +1,419 @@
1
+ # 3.0.0 (Next)
2
+
3
+ - Fix `File#write_buffer` to always return the given `io`.
4
+ - Add `Entry#absolute_time?` and `DOSTime#absolute_time?` methods.
5
+ - Use explicit named parameters for `File` methods.
6
+ - Ensure that entries can be extracted safely without path traversal. [#540](https://github.com/rubyzip/rubyzip/issues/540)
7
+ - Enable Zip64 by default.
8
+ - Rename `GPFBit3Error` to `StreamingError`.
9
+ - Ensure that `Entry.ftype` is correct via `InputStream`. [#533](https://github.com/rubyzip/rubyzip/issues/533)
10
+ - Add `Entry#zip64?` as a better way detect Zip64 entries.
11
+ - Implement `Zip::FileSystem::ZipFsFile#symlink?`.
12
+ - Remove `File::add_buffer` from the API.
13
+ - Fix `OutputStream#put_next_entry` to preserve `StreamableStream`s. [#503](https://github.com/rubyzip/rubyzip/issues/503)
14
+ - Ensure `File.open_buffer` doesn't rewrite unchanged data.
15
+ - Add `CentralDirectory#count_entries` and `File::count_entries`.
16
+ - Fix reading unknown extra fields. [#505](https://github.com/rubyzip/rubyzip/issues/505)
17
+ - Fix reading zip files with max length file comment. [#508](https://github.com/rubyzip/rubyzip/issues/508)
18
+ - Fix reading zip64 files with max length file comment. [#509](https://github.com/rubyzip/rubyzip/issues/509)
19
+ - Don't silently alter zip files opened with `Zip::sort_entries`. [#329](https://github.com/rubyzip/rubyzip/issues/329)
20
+ - Use named parameters for optional arguments in the public API.
21
+ - Raise an error if entry names exceed 65,535 characters. [#247](https://github.com/rubyzip/rubyzip/issues/247)
22
+ - Remove the `ZipXError` v1 legacy classes.
23
+ - Raise an error on reading a split archive with `InputStream`. [#349](https://github.com/rubyzip/rubyzip/issues/349)
24
+ - Ensure `InputStream` raises `GPFBit3Error` for OSX Archive files. [#493](https://github.com/rubyzip/rubyzip/issues/493)
25
+ - Improve documentation and error messages for `InputStream`. [#196](https://github.com/rubyzip/rubyzip/issues/196)
26
+ - Fix zip file-level comment is not read from zip64 files. [#492](https://github.com/rubyzip/rubyzip/issues/492)
27
+ - Fix `Zip::OutputStream.write_buffer` doesn't work with Tempfiles. [#265](https://github.com/rubyzip/rubyzip/issues/265)
28
+ - Reinstate normalising pathname separators to /. [#487](https://github.com/rubyzip/rubyzip/pull/487)
29
+ - Fix restore options consistency. [#486](https://github.com/rubyzip/rubyzip/pull/486)
30
+ - View and/or preserve original date created, date modified? (Windows). [#336](https://github.com/rubyzip/rubyzip/issues/336)
31
+ - Fix frozen string literal error. [#475](https://github.com/rubyzip/rubyzip/pull/475)
32
+ - Set the default `Entry` time to the file's mtime on Windows. [#465](https://github.com/rubyzip/rubyzip/issues/465)
33
+ - Ensure that `Entry#time=` sets times as `DOSTime` objects. [#481](https://github.com/rubyzip/rubyzip/issues/481)
34
+ - Replace and deprecate `Zip::DOSTime#dos_equals`. [#464](https://github.com/rubyzip/rubyzip/pull/464)
35
+ - Fix loading extra fields. [#459](https://github.com/rubyzip/rubyzip/pull/459)
36
+ - Set compression level on a per-zipfile basis. [#448](https://github.com/rubyzip/rubyzip/pull/448)
37
+ - Fix input stream partial read error. [#462](https://github.com/rubyzip/rubyzip/pull/462)
38
+ - Fix zlib deflate buffer growth. [#447](https://github.com/rubyzip/rubyzip/pull/447)
39
+
40
+ Tooling/internal:
41
+
42
+ - Update the README with new Ruby version compatability information.
43
+ - Fix various issues with JRuby tests.
44
+ - Update gem dependency versions.
45
+ - Add Ruby 3.4 to the CI.
46
+ - Fix mispelled variable names in the crypto classes.
47
+ - Only use the Zip64 CDIR end locator if needed.
48
+ - Prevent unnecessary Zip64 data being stored.
49
+ - Abstract marking various things as 'dirty' into `Dirtyable` for reuse.
50
+ - Properly test `File#mkdir`.
51
+ - Remove unused private method `File#directory?`.
52
+ - Expose the `EntrySet` more cleanly through `CentralDirectory`.
53
+ - `Zip::File` no longer subclasses `Zip::CentralDirectory`.
54
+ - Configure Coveralls to not report a failure on minor decreases of test coverage. [#491](https://github.com/rubyzip/rubyzip/issues/491)
55
+ - Extract the file splitting code out into its own module.
56
+ - Refactor, and tidy up, the `Zip::Filesystem` classes for improved maintainability.
57
+ - Fix Windows tests. [#489](https://github.com/rubyzip/rubyzip/pull/489)
58
+ - Refactor `assert_forwarded` so it does not need `ObjectSpace._id2ref` or `eval`. [#483](https://github.com/rubyzip/rubyzip/pull/483)
59
+ - Add GitHub Actions CI infrastructure. [#469](https://github.com/rubyzip/rubyzip/issues/469)
60
+ - Add Ruby 3.0 to CI. [#474](https://github.com/rubyzip/rubyzip/pull/474)
61
+ - Fix the compression level tests to compare relative sizes. [#473](https://github.com/rubyzip/rubyzip/pull/473)
62
+ - Simplify assertions in basic_zip_file_test. [#470](https://github.com/rubyzip/rubyzip/pull/470)
63
+ - Remove compare_enumerables from test_helper.rb. [#468](https://github.com/rubyzip/rubyzip/pull/468)
64
+ - Use correct SPDX license identifier. [#458](https://github.com/rubyzip/rubyzip/pull/458)
65
+ - Enable truffle ruby in Travis CI. [#450](https://github.com/rubyzip/rubyzip/pull/450)
66
+ - Update rubocop again and run it in CI. [#444](https://github.com/rubyzip/rubyzip/pull/444)
67
+ - Fix a test that was incorrect on big-endian architectures. [#445](https://github.com/rubyzip/rubyzip/pull/445)
68
+
69
+ # 2.4.1 (2025-01-05)
70
+
71
+ *This is a re-release of version 2.4 with a full version number string. We need to move to version 2.4.1 due to the canonical version number 2.4 now being taken in Rubygems.*
72
+
73
+ Tooling:
74
+
75
+ - Opt-in for MFA requirement explicitly on 2.4 branch.
76
+
77
+ # 2.4 (2025-01-04) - Yanked
78
+
79
+ *Yanked due to incorrect version number format (2.4 vs 2.4.0).*
80
+
81
+ - Ensure compatibility with `--enable-frozen-string-literal`.
82
+ - Ensure `File.open_buffer` doesn't rewrite unchanged data. This is a backport of the fix on the 3.x branch.
83
+ - Enable use of the version 3 calling style (mainly named parameters) wherever possible, while retaining version 2.x compatibility.
84
+ - Add (switchable) warning messages to methods that are changed or removed in version 3.x.
85
+
86
+ Tooling:
87
+
88
+ - Switch to using GitHub Actions (from Travis).
89
+ - Update Rubocop versions and configuration.
90
+ - Update actions with latest rubies.
91
+
92
+ # 2.3.2 (2021-07-05)
93
+
94
+ - A "dummy" release to warn about breaking changes coming in version 3.0. This updated version uses the Gem `post_install_message` instead of printing to `STDERR`.
95
+
96
+ # 2.3.1 (2021-07-03)
97
+
98
+ - A "dummy" release to warn about breaking changes coming in version 3.0.
99
+
100
+ # 2.3.0 (2020-03-14)
101
+
102
+ - Fix frozen string literal error [#431](https://github.com/rubyzip/rubyzip/pull/431)
103
+ - Set `OutputStream.write_buffer`'s buffer to binmode [#439](https://github.com/rubyzip/rubyzip/pull/439)
104
+ - Upgrade rubocop and fix various linting complaints [#437](https://github.com/rubyzip/rubyzip/pull/437) [#440](https://github.com/rubyzip/rubyzip/pull/440)
105
+
106
+ Tooling:
107
+
108
+ - Add a `bin/console` script for development [#420](https://github.com/rubyzip/rubyzip/pull/420)
109
+ - Update rake requirement (development dependency only) to fix a security alert.
110
+
111
+ # 2.2.0 (2020-02-01)
112
+
113
+ - Add support for decompression plugin gems [#427](https://github.com/rubyzip/rubyzip/pull/427)
114
+
115
+ # 2.1.0 (2020-01-25)
116
+
117
+ - Fix (at least partially) the `restore_times` and `restore_permissions` options to `Zip::File.new` [#413](https://github.com/rubyzip/rubyzip/pull/413)
118
+ - Previously, neither option did anything, regardless of what it was set to. We have therefore defaulted them to `false` to preserve the current behavior, for the time being. If you have explicitly set either to `true`, it will now have an effect.
119
+ - Fix handling of UniversalTime (`mtime`, `atime`, `ctime`) fields. [#421](https://github.com/rubyzip/rubyzip/pull/421)
120
+ - Previously, `Zip::File` did not pass the options to `Zip::Entry` in some cases. [#423](https://github.com/rubyzip/rubyzip/pull/423)
121
+ - Note that `restore_times` in this release does nothing on Windows and only restores `mtime`, not `atime` or `ctime`.
122
+ - Allow `Zip::File.open` to take an options hash like `Zip::File.new` [#418](https://github.com/rubyzip/rubyzip/pull/418)
123
+ - Always print warnings with `warn`, instead of a mix of `puts` and `warn` [#416](https://github.com/rubyzip/rubyzip/pull/416)
124
+ - Create temporary files in the system temporary directory instead of the directory of the zip file [#411](https://github.com/rubyzip/rubyzip/pull/411)
125
+ - Drop unused `tmpdir` requirement [#411](https://github.com/rubyzip/rubyzip/pull/411)
126
+
127
+ Tooling
128
+
129
+ - Move CI to xenial and include jruby on JDK11 [#419](https://github.com/rubyzip/rubyzip/pull/419/files)
130
+
131
+ # 2.0.0 (2019-09-25)
132
+
133
+ Security
134
+
135
+ - Default the `validate_entry_sizes` option to `true`, so that callers can trust an entry's reported size when using `extract` [#403](https://github.com/rubyzip/rubyzip/pull/403)
136
+ - This option defaulted to `false` in 1.3.0 for backward compatibility, but it now defaults to `true`. If you are using an older version of ruby and can't yet upgrade to 2.x, you can still use 1.3.0 and set the option to `true`.
137
+
138
+ Tooling / Documentation
139
+
140
+ - Remove test files from the gem to avoid problems with antivirus detections on the test files [#405](https://github.com/rubyzip/rubyzip/pull/405) / [#384](https://github.com/rubyzip/rubyzip/issues/384)
141
+ - Drop support for unsupported ruby versions [#406](https://github.com/rubyzip/rubyzip/pull/406)
142
+
143
+ # 1.3.0 (2019-09-25)
144
+
145
+ Security
146
+
147
+ - Add `validate_entry_sizes` option so that callers can trust an entry's reported size when using `extract` [#403](https://github.com/rubyzip/rubyzip/pull/403)
148
+ - This option defaults to `false` for backward compatibility in this release, but you are strongly encouraged to set it to `true`. It will default to `true` in rubyzip 2.0.
149
+
150
+ New Feature
151
+
152
+ - Add `add_stored` method to simplify adding entries without compression [#366](https://github.com/rubyzip/rubyzip/pull/366)
153
+
154
+ Tooling / Documentation
155
+
156
+ - Add more gem metadata links [#402](https://github.com/rubyzip/rubyzip/pull/402)
157
+
158
+ # 1.2.4 (2019-09-06)
159
+
160
+ - Do not rewrite zip files opened with `open_buffer` that have not changed [#360](https://github.com/rubyzip/rubyzip/pull/360)
161
+
162
+ Tooling / Documentation
163
+
164
+ - Update `example_recursive.rb` in README [#397](https://github.com/rubyzip/rubyzip/pull/397)
165
+ - Hold CI at `trusty` for now, automatically pick the latest ruby patch version, use rbx-4 and hold jruby at 9.1 [#399](https://github.com/rubyzip/rubyzip/pull/399)
166
+
167
+ # 1.2.3
168
+
169
+ - Allow tilde in zip entry names [#391](https://github.com/rubyzip/rubyzip/pull/391) (fixes regression in 1.2.2 from [#376](https://github.com/rubyzip/rubyzip/pull/376))
170
+ - Support frozen string literals in more files [#390](https://github.com/rubyzip/rubyzip/pull/390)
171
+ - Require `pathname` explicitly [#388](https://github.com/rubyzip/rubyzip/pull/388) (fixes regression in 1.2.2 from [#376](https://github.com/rubyzip/rubyzip/pull/376))
172
+
173
+ Tooling / Documentation:
174
+
175
+ - CI updates [#392](https://github.com/rubyzip/rubyzip/pull/392), [#394](https://github.com/rubyzip/rubyzip/pull/394)
176
+ - Bump supported ruby versions and add 2.6
177
+ - JRuby failures are no longer ignored (reverts [#375](https://github.com/rubyzip/rubyzip/pull/375) / part of [#371](https://github.com/rubyzip/rubyzip/pull/371))
178
+ - Add changelog entry that was missing for last release [#387](https://github.com/rubyzip/rubyzip/pull/387)
179
+ - Comment cleanup [#385](https://github.com/rubyzip/rubyzip/pull/385)
180
+
181
+ # 1.2.2
182
+
183
+ NB: This release drops support for extracting symlinks, because there was no clear way to support this securely. See https://github.com/rubyzip/rubyzip/pull/376#issue-210954555 for details.
184
+
185
+ - Fix CVE-2018-1000544 [#376](https://github.com/rubyzip/rubyzip/pull/376) / [#371](https://github.com/rubyzip/rubyzip/pull/371)
186
+ - Fix NoMethodError: undefined method `glob' [#363](https://github.com/rubyzip/rubyzip/pull/363)
187
+ - Fix handling of stored files (i.e. files not using compression) with general purpose bit 3 set [#358](https://github.com/rubyzip/rubyzip/pull/358)
188
+ - Fix `close` on StringIO-backed zip file [#353](https://github.com/rubyzip/rubyzip/pull/353)
189
+ - Add `Zip.force_entry_names_encoding` option [#340](https://github.com/rubyzip/rubyzip/pull/340)
190
+ - Update rubocop, apply auto-fixes, and fix regressions caused by said auto-fixes [#332](https://github.com/rubyzip/rubyzip/pull/332), [#355](https://github.com/rubyzip/rubyzip/pull/355)
191
+ - Save temporary files to temporary directory (rather than current directory) [#325](https://github.com/rubyzip/rubyzip/pull/325)
192
+
193
+ Tooling / Documentation:
194
+
195
+ - Turn off all terminal output in all tests [#361](https://github.com/rubyzip/rubyzip/pull/361)
196
+ - Several CI updates [#346](https://github.com/rubyzip/rubyzip/pull/346), [#347](https://github.com/rubyzip/rubyzip/pull/347), [#350](https://github.com/rubyzip/rubyzip/pull/350), [#352](https://github.com/rubyzip/rubyzip/pull/352)
197
+ - Several README improvements [#345](https://github.com/rubyzip/rubyzip/pull/345), [#326](https://github.com/rubyzip/rubyzip/pull/326), [#321](https://github.com/rubyzip/rubyzip/pull/321)
198
+
199
+ # 1.2.1
200
+
201
+ - Add accessor to @internal_file_attributes #304
202
+ - Extended globbing #303
203
+ - README updates #283, #289
204
+ - Cleanup after tests #298, #306
205
+ - Fix permissions on new zip files #294, #300
206
+ - Fix examples #297
207
+ - Support cp932 encoding #308
208
+ - Fix Directory traversal vulnerability #315
209
+ - Allow open_buffer to work without a given block #314
210
+
211
+ # 1.2.0
212
+
213
+ - Don't enable JRuby objectspace #252
214
+ - Fixes an exception thrown when decoding some weird .zip files #248
215
+ - Use duck typing with IO methods #244
216
+ - Added error for empty (zero bit) zip file #242
217
+ - Accept StringIO in Zip.open_buffer #238
218
+ - Do something more expected with new file permissions #237
219
+ - Case insensitivity option for #find_entry #222
220
+ - Fixes in documentation and examples
221
+
222
+ # 1.1.7
223
+
224
+ - Fix UTF-8 support for comments
225
+ - `Zip.sort_entries` working for zip output
226
+ - Prevent tempfile path from being unlinked by garbage collection
227
+ - NTFS Extra Field (0x000a) support
228
+ - Use String#tr instead of String#gsub
229
+ - Ability to not show warning about incorrect date
230
+ - Be smarter about handling buffer file modes.
231
+ - Support for Traditional Encryption (ZipCrypto)
232
+
233
+ # 1.1.6
234
+
235
+ - Revert "Return created zip file from Zip::File.open when supplied a block"
236
+
237
+ # 1.1.5
238
+
239
+ - Treat empty file as non-exists (@layerssss)
240
+ - Revert regression commit
241
+ - Return created zip file from Zip::File.open when supplied a block (@tpickett66)
242
+ - Zip::Entry::DEFLATED is forced on every file (@mehmetc)
243
+ - Add InputStream#ungetc (@zacstewart)
244
+ - Alias for legacy error names (@orien)
245
+
246
+ # 1.1.4
247
+
248
+ - Don't send empty string to stream (@mrloop)
249
+ - Zip::Entry::DEFLATED was forced on every file (@mehmetc)
250
+ - Alias for legacy error names (@orien)
251
+
252
+ # 1.1.3
253
+
254
+ - Fix compatibility of ::OutputStream::write_buffer (@orien)
255
+ - Clean up tempfiles from output stream (@iangreenleaf)
256
+
257
+ # 1.1.2
258
+
259
+ - Fix compatibility of ::Zip::File.write_buffer
260
+
261
+ # 1.1.1
262
+
263
+ - Speedup deflater (@loadhigh)
264
+ - Less Arrays and Strings allocations (@srawlins)
265
+ - Fix Zip64 writing support (@mrjamesriley)
266
+ - Fix StringIO support (@simonoff)
267
+ - Possibility to change default compression level
268
+ - Make Zip64 write support optional via configuration
269
+
270
+ # 1.1.0
271
+
272
+ - StringIO Support
273
+ - Zip64 Support
274
+ - Better jRuby Support
275
+ - Order of files in the archive can be sorted
276
+ - Other small fixes
277
+
278
+ # 1.0.0
279
+
280
+ - Removed support for Ruby 1.8
281
+ - Changed the API for gem. Now it can be used without require param in Gemfile.
282
+ - Added read-only support for Zip64 files.
283
+ - Added support for setting Unicode file names.
284
+
285
+ # 0.9.9
286
+
287
+ - Added support for backslashes in zip files (generated by the default Windows zip packer for example) and comment sections with the comment length set to zero even though there is actually a comment.
288
+
289
+ # 0.9.8
290
+
291
+ - Fixed: "Unitialized constant NullInputStream" error
292
+
293
+ # 0.9.5
294
+
295
+ - Removed support for loading ruby in zip files (ziprequire.rb).
296
+
297
+ # 0.9.4
298
+
299
+ - Changed ZipOutputStream.put_next_entry signature (API CHANGE!). Now allows comment, extra field and compression method to be specified.
300
+
301
+ # 0.9.3
302
+
303
+ - Fixed: Added ZipEntry::name_encoding which retrieves the character encoding of the name and comment of the entry.
304
+ - Added convenience methods ZipEntry::name_in(enc) and ZipEntry::comment_in(enc) for getting zip entry names and comments in a specified character encoding.
305
+
306
+ # 0.9.2
307
+
308
+ - Fixed: Renaming an entry failed if the entry's new name was a different length than its old name. (Diego Barros)
309
+
310
+ # 0.9.1
311
+
312
+ - Added symlink support and support for unix file permissions. Reduced memory usage during decompression.
313
+ - New methods ZipFile::[follow_symlinks, restore_times, restore_permissions, restore_ownership].
314
+ - New methods ZipEntry::unix_perms, ZipInputStream::eof?.
315
+ - Added documentation and test for new ZipFile::extract.
316
+ - Added some of the API suggestions from sf.net #1281314.
317
+ - Applied patch for sf.net bug #1446926.
318
+ - Applied patch for sf.net bug #1459902.
319
+ - Rework ZipEntry and delegate classes.
320
+
321
+ # 0.5.12
322
+
323
+ - Fixed problem with writing binary content to a ZipFile in MS Windows.
324
+
325
+ # 0.5.11
326
+
327
+ - Fixed name clash file method copy_stream from fileutils.rb. Fixed problem with references to constant CHUNK_SIZE.
328
+ - ZipInputStream/AbstractInputStream read is now buffered like ruby IO's read method, which means that read and gets etc can be mixed. The unbuffered read method has been renamed to sysread.
329
+
330
+ # 0.5.10
331
+
332
+ - Fixed method name resolution problem with FileUtils::copy_stream and IOExtras::copy_stream.
333
+
334
+ # 0.5.9
335
+
336
+ - Fixed serious memory consumption issue
337
+
338
+ # 0.5.8
339
+
340
+ - Fixed install script.
341
+
342
+ # 0.5.7
343
+
344
+ - install.rb no longer assumes it is being run from the toplevel source dir. Directory structure changed to reflect common ruby library project structure. Migrated from RubyUnit to Test::Unit format. Now uses Rake to build source packages and gems and run unit tests.
345
+
346
+ # 0.5.6
347
+
348
+ - Fix for FreeBSD 4.9 which returns Errno::EFBIG instead of Errno::EINVAL for some invalid seeks. Fixed 'version needed to extract'-field incorrect in local headers.
349
+
350
+ # 0.5.5
351
+
352
+ - Fix for a problem with writing zip files that concerns only ruby 1.8.1.
353
+
354
+ # 0.5.4
355
+
356
+ - Significantly reduced memory footprint when modifying zip files.
357
+
358
+ # 0.5.3
359
+
360
+ - Added optimization to avoid decompressing and recompressing individual entries when modifying a zip archive.
361
+
362
+ # 0.5.2
363
+
364
+ - Fixed ZipFile corruption bug in ZipFile class. Added basic unix extra-field support.
365
+
366
+ # 0.5.1
367
+
368
+ - Fixed ZipFile.get_output_stream bug.
369
+
370
+ # 0.5.0
371
+
372
+ - Ruby 1.8.0 and ruby-zlib 0.6.0 compatibility
373
+ - Changed method names from camelCase to rubys underscore style.
374
+ - Installs to zip/ subdir instead of directly to site_ruby
375
+ - Added ZipFile.directory and ZipFile.file - each method return an
376
+ object that can be used like Dir and File only for the contents of the
377
+ zip file.
378
+ - Added sample application zipfind which works like Find.find, only
379
+ Zip::ZipFind.find traverses into zip archives too.
380
+ - FIX: AbstractInputStream.each_line with non-default separator
381
+
382
+ # 0.5.0a
383
+
384
+ Source reorganized. Added ziprequire, which can be used to load ruby modules from a zip file, in a fashion similar to jar files in Java. Added gtk_ruby_zip, another sample application. Implemented ZipInputStream.lineno and ZipInputStream.rewind
385
+
386
+ Bug fixes:
387
+
388
+ - Read and write date and time information correctly for zip entries.
389
+ - Fixed read() using separate buffer, causing mix of gets/readline/read to cause problems.
390
+
391
+ # 0.4.2
392
+
393
+ - Performance optimizations. Test suite runs in half the time.
394
+
395
+ # 0.4.1
396
+
397
+ - Windows compatibility fixes.
398
+
399
+ # 0.4.0
400
+
401
+ - Zip::ZipFile is now mutable and provides a more convenient way of modifying zip archives than Zip::ZipOutputStream. Operations for adding, extracting, renaming, replacing and removing entries to zip archives are now available.
402
+ - Runs without warnings with -w switch.
403
+ - Install script install.rb added.
404
+
405
+ # 0.3.1
406
+
407
+ - Rudimentary support for writing zip archives.
408
+
409
+ # 0.2.2
410
+
411
+ - Fixed and extended unit test suite. Updated to work with ruby/zlib 0.5. It doesn't work with earlier versions of ruby/zlib.
412
+
413
+ # 0.2.0
414
+
415
+ - Class ZipFile added. Where ZipInputStream is used to read the individual entries in a zip file, ZipFile reads the central directory in the zip archive, so you can get to any entry in the zip archive without having to skipping through all the preceeding entries.
416
+
417
+ # 0.1.0
418
+
419
+ - First working version of ZipInputStream.
data/LICENSE.md ADDED
@@ -0,0 +1,24 @@
1
+ BSD 2-Clause License
2
+
3
+ Copyright (c) 2002-2025, The Rubyzip Developers
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
19
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
22
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
23
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.