Commit Graph

1197 Commits

Author SHA1 Message Date
Robert Haines 6c4b7a9f90 Move to version `2.4.1` due to clash with `2.4`. 2025-01-05 18:15:02 +00:00
Geremia Taglialatela 3b4c2bfa22 Opt-in for MFA requirement explicitly on 2.4
As a pupular gem, `rubyzip` implicitly requires that all privileged
operations by any of the owners require OTP.

By explicitly setting `rubygems_mfa_required` metadata, the
gem will show "NEW VERSIONS REQUIRE MFA" and "VERSION PUBLISHED WITH
MFA" in the sidebar at https://rubygems.org/gems/rubyzip

NOTE: The explicit opt-in was introduced in the `master` branch via
1c06454, but has not been backported to `2.4`

Ref:
- https://blog.rubygems.org/2022/08/15/requiring-mfa-on-popular-gems.html
- https://guides.rubygems.org/mfa-requirement-opt-in/
2025-01-05 18:00:28 +00:00
Robert Haines e3eb62491b Make sure version number is 2.4.0.
And add a test to keep version numbers consistent from now on.

Fixes: #623
2025-01-05 11:43:53 +00:00
Robert Haines c09352b546 Bump version and Changelog for release. 2025-01-04 10:12:55 +00:00
Robert Haines 71bb069049 Update actions with latest rubies.
Also, allow failure on 'head' versions.
2025-01-04 09:54:58 +00:00
Robert Haines bb06f99b14 Update actions dependencies. 2024-10-26 13:36:30 +01:00
Robert Haines 3d95a8204f Update earliest Ruby version for MacOS builds in CI. 2024-10-26 13:35:43 +01:00
Tsutomu Katsube 56954b0b59 Suppress "literal string will be frozen in the future" warning
Ref: https://bugs.ruby-lang.org/issues/20205

This patch will suppress the "literal string will be frozen in the
future" warning on the 2.4 branch.

Steps to reproduce
---

Run the following commands with ruby 3.4.0preview1:

```console
$ cd /tmp
$ git clone git@github.com:rubyzip/rubyzip.git
$ cd rubyzip
$ git switch 2.4
$ bundle install
$ ruby -I lib -W:deprecated -e '
require "zip"

Zip::File.open("test/data/ntfs.zip") do |zip_file|
  zip_file.each do |entry|
    puts entry.get_input_stream.read
  end
end
'
```

Expected result
---

```console
ntfs test
```

Actual result
---

```console
/private/tmp/rubyzip/lib/zip/extra_field/ntfs.rb:54: warning: literal string will be frozen in the future
ntfs test
```

Environment
---

```console
$ ruby -v
ruby 3.4.0preview1 (2024-05-16 master 9d69619623) [x86_64-darwin23]
```
2024-09-21 09:06:36 +09:00
Robert Haines 6ff40f7a78 Fix setting and restoring `RUBYZIP_V3_API_WARN` in tests.
Make sure that it is reset to its original value so that we can set it
up front for all tests.
2024-04-09 18:05:05 +01:00
Robert Haines e05dc9b978 Improve version 3 API messages.
The messages now tell you where you have called the changed method from.
2024-04-09 17:53:27 +01:00
Jean Boussier a4c3f5bddb Fix deprecation in Entry#get_input_stream 2024-04-09 16:37:04 +01:00
Jean Boussier 57cff3338f Fix `File#write_buffer` to always return the given `io`
Ref: ef89a62b70

This fixes a regression in 2.4.rc1.
2024-04-09 10:05:18 +01:00
Robert Haines 0001864cfe Bump version, Changelog and README for release. 2024-04-08 16:15:44 +01:00
Jean Boussier 385ebd054a Ensure compatibility with `--enable-frozen-string-literal`
Ref: https://bugs.ruby-lang.org/issues/20205

In Ruby 3.4 string literals will be "chilled" by default. Meaning
they are still mutable, but will pretend to be frozen.

In most case it has no impact, just emit a few warnings there and
there, but there is one thing it impacts is the `StringIO.new('')`
pattern. `StringIO` checks if the given string is frozen, and if
it is will act as a read only IO.

This breaks rubyzip 2.x.

This commit make the 2.x branch compatible with frozen string literals.
2024-04-08 15:10:07 +01:00
Robert Haines 46689d7350 Add `DOSTime` to the post_install message. 2024-04-08 14:29:10 +01:00
Robert Haines ef89a62b70 Ensure `File.open_buffer` doesn't rewrite unchanged data.
This is a backport of 14b63f68 from trunk.
2024-04-08 12:44:12 +01:00
Robert Haines 900db76760 Handle the `extract` methods in `Entry` and `File`.
Add v3 versions and warning messages to the v2 versions. We need to do
these methods like this because the new versions are very different.
2024-03-10 17:21:53 +00:00
Robert Haines 14efdd1cc4 Add `DOSTime#<=>` and a warning message to `DOSTime#dos_equals`.
`#dos_equals` now uses `#==` for its implementation.
2024-03-10 11:34:36 +00:00
Robert Haines 02faddaf44 Add warning messages to `File#get_output_stream`. 2024-03-10 09:00:17 +00:00
Robert Haines 9aa5964262 Add warning messages to the `File` class methods.
* `new`
 * `open`
 * `open_buffer`
2024-03-10 08:03:49 +00:00
Robert Haines 13f4ea766f Update gemspec. 2024-03-03 21:10:08 +00:00
Robert Haines 3910870f3a Remove Coveralls/Simplecov from this branch.
We don't use it in CI anyway.
2024-03-03 20:56:50 +00:00
Robert Haines 07d833ca78 Add warning messages to `InputStream.open`. 2024-03-03 18:06:51 +00:00
Robert Haines 6bbda380fe Add warning messages to deprectated methods.
* File.add_buffer
 * InputStream.open_buffer
2024-03-02 18:50:47 +00:00
Robert Haines a6e6c3c469 Update rubocop fails. 2024-03-02 18:38:00 +00:00
Robert Haines b691a4b72c Minor updates to the Actions workflow. 2024-03-02 08:59:52 +00:00
Robert Haines f68877920a Update File.split API to allow v3.0 calling style. 2024-03-02 08:23:27 +00:00
Robert Haines 13781b20d3 Add a warning when run on Ruby < 3.0. 2024-03-01 23:04:02 +00:00
Robert Haines 4b1cfba9db Add warning message (and tests) to OutputStream. 2024-03-01 18:05:06 +00:00
Robert Haines 5e9ee53c70 Add warning message to InputStream. 2024-03-01 18:05:06 +00:00
Robert Haines cb0505d735 Add a switchable warning message re the v3 API.
Switched via an environment variable, and tested.
2024-03-01 18:05:06 +00:00
Robert Haines 49950d924c Update Entry#new API to allow v3.0 calling style.
See https://github.com/rubyzip/rubyzip/wiki/Updating-to-version-3.x#new-1
for details.
2024-03-01 18:05:06 +00:00
Robert Haines a17da19e0c Update InputStream API to allow v3.0 calling style.
See https://github.com/rubyzip/rubyzip/wiki/Updating-to-version-3.x#zipinputstream
for details.
2024-03-01 18:05:06 +00:00
Robert Haines 7c1a8fbf8f Update OutputStream API to allow v3.0 calling style.
See https://github.com/rubyzip/rubyzip/wiki/Updating-to-version-3.x#zipoutputstream
for details.
2024-03-01 18:05:06 +00:00
Robert Haines 77611045f1 Switch to GitHub Actions on the `2.3.2` branch. 2022-02-06 14:31:04 +00:00
Robert Haines 2f1c1ea400 Move to using a post install message for 3.0 warning. 2021-07-05 20:13:36 +01:00
Robert Haines 16de339666 Print banner text re v3.0.0 when `zip` is required. 2021-07-03 12:12:22 +01:00
Robert Haines 84d7a66abc Bump version number and Changelog. 2021-07-03 12:10:30 +01:00
John Lees-Miller 3bc55a5d98
Merge pull request #443 from rubyzip/v2-3-0
Bump version to 2.3.0
2020-03-14 12:00:50 +00:00
John Lees-Miller 69186f65cd Bump version to 2.3.0 2020-03-14 11:31:39 +00:00
John Lees-Miller 516941bec5 Update changelog for #439 and #440 2020-03-14 11:28:02 +00:00
John Lees-Miller a64a14767d Bump rake version (development dependency) 2020-03-14 11:09:33 +00:00
John Lees-Miller 4c789c2821 Remove unused constant from #439 2020-03-14 11:00:39 +00:00
John Lees-Miller fabacf1633
Merge pull request #440 from hainesr/rubocop-names
Rubocop name cops
2020-03-14 10:58:54 +00:00
John Lees-Miller b231b28998
Merge pull request #439 from henkeinfo/binary-outstream-buffer
Set OutputStream.write_buffer's default buffer to binmode
2020-03-14 10:32:28 +00:00
Sebastian Henke 66324a711c Remove duplicate binmode call 2020-03-02 11:06:50 +01:00
Sebastian Henke e33c07a6e7
Use existing constant for ASCII_8BIT
Co-Authored-By: John Lees-Miller <jdleesmiller@gmail.com>
2020-03-02 11:00:39 +01:00
Robert Haines ce17c57e2d Fix Naming/AccessorMethodName in the tests.
This was kind of a misfire of this cop, but no bother to change.
2020-02-29 18:11:52 +00:00
Robert Haines c30d9dfb26 Configure Naming/MemoizedInstanceVariableName in source.
Rather than turn it off for a whole file, it's better to mark these
exceptions in comments.
2020-02-29 18:11:52 +00:00
Robert Haines f9b161eb32 Fix Naming/VariableName cop in the library code. 2020-02-29 18:11:52 +00:00