Commit Graph

1485 Commits

Author SHA1 Message Date
Robert Haines 1f3f84c889 Update version number and Changelog for RC2. 2025-02-08 17:18:43 +00:00
Robert Haines deca4d5aeb Fix de facto regression for input streams.
A close reading of the ZIP spec insists that if bit 3 of the GP flags is set
then the archive cannot be read via `Zip::InputStream`. But in most cases
the correct information is present to be able to do so, both safely and
reliably, and v2.4 does allow this.

This commit ensures that behaviour is present in v3.0.
2025-02-08 16:51:30 +00:00
Robert Haines 98881e23d1 Add a test to ensure correct version number format.
Hopefully this will avoid a repeat of the '2.4' debacle...
2025-02-01 16:31:20 +00:00
Robert Haines 43d845c2cb Update version number, README and Changelog for RC1.
Also update the year to 2025 in the licence.
2025-01-26 22:23:25 +00:00
Geremia Taglialatela 3f909b2bdc Fix CI against JRuby, JRuby-head, and Windows
Additionally:
- Use `latest` rubygems, instead of specifying a version and keeping
  it up to date
- Bump `rake` dependency to `~> 13.2.0` to allow tests to pass against
  Windows
2025-01-25 17:39:22 +00:00
Robert Haines f7c6b79256 Update some dev dependency gems and relax version matching.
For gems such as rake, minitest and rdoc it is appropriate to allow version
matches against major versions, allowing us to get the latest minor and
patch versions automatically.

Also update the minimum minor versions while we are at it.

We'll leave rubocop* and simplecov* gems pinned to minor versions.
2025-01-25 09:55:27 +00:00
Geremia Taglialatela 8ed6662891 Fix JRuby CI tests
Pin `jar-dependencies` to `0.4.1`.

Ref: jruby/jruby#7262

Close #626
2025-01-07 19:14:56 +00:00
Geremia Taglialatela 0d920d552f Update README with Ruby version compatibility
This commit updates the README to reflect the Ruby versions that are
known to work with version 2.x of the library. Specifically,
it documents that version 2.x works on Ruby 3.x.

Ref: 0001864cfe
2025-01-07 17:58:42 +00:00
Robert Haines 89cdf82a77 Copy the 2.4 branch changelog into the main branch. 2025-01-06 18:58:44 +00:00
Robert Haines b3186d7ad1 Update the version of RubyGems in the actions. 2025-01-04 16:43:51 +00:00
Robert Haines 7412338c2e Fix variable name typo in `DecryptedIo`.
Fixes: #580
2025-01-04 16:18:27 +00:00
Robert Haines d908e72819 Add Ruby 3.4 to the tests. 2025-01-04 16:17:25 +00:00
Bastien 5b0d25e416 Fix misspell 2024-10-26 20:05:18 +01:00
Robert Haines f81175b3d3 Update Changlog. 2024-10-26 19:16:55 +01:00
Jean Boussier 5c6a7c9ad9 Fix `File#write_buffer` to always return the given `io`
Ref: ef89a62b70

This fixes a regression in 2.4.rc1.

Cherry-picked into 3.0 for consistency.
2024-04-09 10:10:47 +01:00
Robert Haines 0c0003cfda Add `DOSTime#absolute_time?`.
This method returns `true` if the time instance was created with accurate
timezone information. Ultimately, only those times parsed from binary
DOS format are missing accurate timezone information, but we need this
flag because ruby `Time` objects (from which `DOSTime` is decended) always
have a timezone set (usually whatever is local at the time).
2024-04-08 18:37:08 +01:00
Robert Haines d53f046bc7 Add `Entry#absolute_time?`.
This method returns `true` if an entry has timezone information in its
timestamps, `false` otherwise.
2024-03-07 21:31:24 +00:00
Robert Haines 8afc2514f7 Use explicit named parameters for `File` methods.
Stop using implicit options (`**options`).
2024-03-07 16:57:50 +00:00
Robert Haines 73c8e110ed Update README with up-to-date licence information.
Fixes: #556
2024-03-06 20:53:48 +00:00
Oleksii Leonov 0e4fc83b25 Add LICENSE file 2024-03-06 20:50:19 +00:00
Robert Haines c6229cc8c2 Remove TODO file.
Out of date and we use GitHub issues now anyway.
2024-03-05 20:35:56 +00:00
Robert Haines bfc9324a75 Remove deprecated InputStream::open_buffer method. 2024-03-02 14:55:46 +00:00
Robert Haines e83bec471b Update API documentation.
Mostly move things out of the public API by removing them from the docs,
but also add and correct docs where appropriate.
2024-03-02 14:52:24 +00:00
Robert Haines 9cfa01a479 Update note about minimum Ruby version in the README. 2024-03-02 14:51:25 +00:00
Robert Haines 04376dc2bc Update GitHub actions to Node.js 20 versions. 2024-03-01 22:32:19 +00:00
Robert Haines 1c06454985 Update minimum ruby version to 3.0.
All rubies before 3.0 are EOL and this is a major version bump, so it's
the right time to do this.
2024-03-01 22:14:48 +00:00
Kyle Huston b1ee5cf272 Note write_zip64_support default is false before 3.0
Improve accuracy of readme to note that write_zip64_support
is enabled by default in versions 3.0 and later.
2024-02-24 18:33:52 +00:00
Robert Haines fd0cf5443e Update ZipCrypto instructions for 2.x versions.
Suggested by @KamilDzierbicki in #568.
2024-02-24 17:52:33 +00:00
Robert Haines e3c173b0fc Update the compatibility matrix in the README. 2024-02-24 17:36:52 +00:00
m-nakamura145 5e9a9cbf18 Add Ruby 3.3 to CI matrix 2024-02-24 17:15:35 +00:00
MSP-Greg f811b2d00e Update README.md 2023-08-12 09:51:01 +01:00
MSP-Greg bb09f90ef9 Action - add 2 Windows head builds 2023-08-12 09:51:01 +01:00
Robert Haines 8cec9491b2 README: add link to wiki for version 3 details. 2023-04-16 16:13:30 +01:00
OZAWA Sakuro a2fc20db8f Zip::InputStream#read returns '' with 0 2023-04-14 11:25:22 +01:00
OZAWA Sakuro a4f9ec6423 Add compatibility test for Zip::InputStream#read(0) 2023-04-14 11:25:22 +01:00
Peter Boling 3ce504fcfb Fix typo know -> known 2023-04-14 11:25:22 +01:00
Robert Haines efa0035634 Turn on yjit for Ruby 3.2 in CI. 2023-04-14 11:25:22 +01:00
Peter Goldstein c0a3c95eee Add Ruby 3.2 to the CI matrix. 2023-04-14 11:25:22 +01:00
Robert Haines e672c46895 Use an updated rubygems in the tests CI.
This is needed for Ruby 2.5, which we need to support a bit longer.
2023-04-14 11:25:22 +01:00
Robert Haines f4a1a09962 Update the linter CI to use Ruby 2.6. 2023-04-14 11:25:22 +01:00
Robert Haines f5ea5a8708 Update Actions to use checkout@v3. 2023-04-14 11:25:22 +01:00
Robert Haines 2ffbfebb88 Document or hide classes from the docs. 2023-04-14 11:25:22 +01:00
Robert Haines 0aa10bf7d5 Document or hide modules from the docs. 2023-04-14 11:25:22 +01:00
Robert Haines 016e1000ba Suppress Rubocop extension notice. 2023-04-14 11:25:22 +01:00
Robert Haines edeab0713c Add RDoc and tasks to the Rakefile. 2023-04-14 11:25:22 +01:00
Robert Haines ccc3d4ff1a Set version to be 3.0.0.alpha. 2023-04-14 11:25:22 +01:00
Robert Haines 84087e5774 Ensure that entries can be extracted safely without path traversal.
This commit adds a parameter to the `File#extract` and `Entry#extract` methods
so that a base destination directory can be specified for extracting archives
in bulk to somewhere in the filesystem that isn't the current working
directory. This directory is `.` by default. It is combined with the entry
path - which shouldn't but could have relative directories (e.g. `..`) in it -
and tested for safety before extracting.

Resolves #540.
2023-04-14 11:15:24 +01:00
Robert Haines 58f053afb0 Only use the Zip64 CDIR end locator if needed.
Previously the central directory Zip64 data was written even if it wasn't
strictly needed. The standard allows for entries to include Zip64 data
(say, if they are streamed and their size is unknown when writing the file
data) without needing any Zip64 data in the central directory. So now we
only write central directory Zip64 data if there are over 65535 files or
the file data is huge.
2023-01-03 20:19:40 +00:00
Robert Haines f460da3afb Prevent unnecessary Zip64 data being stored.
With Zip64 write support enabled by default, it's important that we
only store the extra data when we need to. This commit ensures that
the Zip64 extra data is included for an entry if its size is over
4GB, or if we don't know how big it will be at the point of writing
the local header data.

This commit also removes the need for the Zip64Placeholder extra
data field. Now we just use the Zip64 field itself and ensure it's
filled in correctly.
2023-01-03 20:19:40 +00:00
Stan Hu d6eb73566c Enable Zip64 by default
Previously if RubyZip attempted to create an archive with more than
64K entries, the central directory would truncate the count. `unzip`
and `zipinfo` would fail with an error message such as:

```
error:  expected central file header signature not found (file #93272).
  (please check that you have transferred or created the zipfile in the
  appropriate BINARY mode and that you have compiled UnZip properly)
```

This generated a lot of confusion and a production issue since many
tools fail to decode a RubyZip-created archive if Zip64 is not enabled
for a large number of files. Since Zip64 support is now the norm,
enable this by default.
2023-01-03 20:19:40 +00:00