Skip to content

Commit

Permalink
Deprecate array and string type initialization
Browse files Browse the repository at this point in the history
- 2 deprecations:

  - Array-based MIME::Type initialization
  - String-based MIME::Type initialization

  Use of these these will result in deprecation warnings.

- Added `logger` to the gemspec to suppress a bundled gem warning with
  Ruby 3.3.5. This warning should not be showing up until Ruby 3.4.0 is
  released and will be suppressed in Ruby 3.3.6.

- Reworked the deprecation message code to be somewhat more flexible and
  allow for outputting certain warnings once. Because there will be
  at least one other release after 3.6, we do not need to make the
  type initialization deprecations frequent with this release.
  • Loading branch information
halostatue committed Oct 2, 2024
1 parent e8d0b42 commit 808a701
Show file tree
Hide file tree
Showing 14 changed files with 239 additions and 137 deletions.
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2

updates:
- package-ecosystem: github-actions
directory: /

- package-ecosystem: bundler
directory: /
49 changes: 38 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4

- uses: ruby/setup-ruby@v1
- uses: ruby/setup-ruby@c04af2bb7258bb6a03df1d3c1865998ac9390972 # v1
with:
ruby-version: '3.3'
rubygems: latest
Expand All @@ -39,22 +39,18 @@ jobs:
- '3.1'
- '3.2'
- '3.3'
- jruby
- truffleruby
include:
- ruby: jruby
os: ubuntu-22.04
continue-on-error: true
- ruby: truffleruby
os: ubuntu-22.04
continue-on-error: true

runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.continue-on-error }}
continue-on-error: ${{ matrix.continue-on-error || false }}

steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: ruby/setup-ruby@v1
- uses: ruby/setup-ruby@c04af2bb7258bb6a03df1d3c1865998ac9390972 # v1
with:
ruby-version: ${{ matrix.ruby }}
rubygems: latest
Expand Down Expand Up @@ -84,7 +80,7 @@ jobs:

steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: ruby/setup-ruby@v1
- uses: ruby/setup-ruby@c04af2bb7258bb6a03df1d3c1865998ac9390972 # v1
with:
ruby-version: ${{ matrix.ruby }}
rubygems: latest
Expand All @@ -104,7 +100,6 @@ jobs:
ruby:
- '2.6'
- '2.7'
- '3.0'
- '3.1'
- '3.2'
- '3.3'
Expand All @@ -113,12 +108,14 @@ jobs:
include:
- ruby: mingw
os: windows-2022
- ruby: '3.0'
os: windows-2022

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: ruby/setup-ruby@v1
- uses: ruby/setup-ruby@c04af2bb7258bb6a03df1d3c1865998ac9390972 # v1
with:
ruby-version: ${{ matrix.ruby }}
rubygems: latest
Expand All @@ -127,6 +124,36 @@ jobs:

- run: bundle exec ruby -S rake test --trace

# JRuby should NOT be optional, but I have not been able to make it work in quite
# a while.
jruby:
name: Ruby ${{ matrix.ruby }} - ${{ matrix.os }})

strategy:
fail-fast: false

matrix:
ruby:
- jruby
os:
- ubuntu-20.04
- ubuntu-22.04
- ubuntu-24.04

continue-on-errors: true
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: ruby/setup-ruby@c04af2bb7258bb6a03df1d3c1865998ac9390972 # v1
with:
ruby-version: ${{ matrix.ruby }}
rubygems: latest
bundler: 2
bundler-cache: true

- run: bundle exec jruby -S rake test --trace

ruby-head-optional:
name: Ruby ${{ matrix.ruby }} - ${{ matrix.os }} (optional)

Expand All @@ -146,7 +173,7 @@ jobs:

steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: ruby/setup-ruby@v1
- uses: ruby/setup-ruby@c04af2bb7258bb6a03df1d3c1865998ac9390972 # v1
with:
ruby-version: ${{ matrix.ruby }}
rubygems: latest
Expand Down
1 change: 1 addition & 0 deletions .hoerc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ exclude: !ruby/regexp '/
fasterer |
pullreview |
rubocop* |
standard* |
travis |
unused
)\.yml$
Expand Down
18 changes: 18 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Changelog

## 3.6 / 2024-10-02

- 2 deprecations:

- Array-based MIME::Type initialization
- String-based MIME::Type initialization

Use of these these will result in deprecation warnings.

- Added `logger` to the gemspec to suppress a bundled gem warning with Ruby
3.3.5. This warning should not be showing up until Ruby 3.4.0 is released and
will be suppressed in Ruby 3.3.6.

- Reworked the deprecation message code to be somewhat more flexible and allow
for outputting certain warnings once. Because there will be at least one other
release after 3.6, we do not need to make the type initialization deprecations
frequent with this release.

## 3.5.2 / 2024-01-02

There are no primary code changes, but we are releasing this as an update as
Expand Down
1 change: 1 addition & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ spec = Hoe.spec "mime-types" do
spec_extras[:metadata] = ->(val) { val["rubygems_mfa_required"] = "true" }

extra_deps << ["mime-types-data", "~> 3.2015"]
extra_deps << ["logger", ">= 0"]

extra_dev_deps << ["hoe", ">= 3.0", "< 5"]
extra_dev_deps << ["hoe-doofus", "~> 1.0"]
Expand Down
Loading

0 comments on commit 808a701

Please sign in to comment.