mime-types 3.5.1 → 3.5.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2577d95fe119a69a6462f904e9395bd3e2afe41a92e31bb278efd5978edfe450
4
- data.tar.gz: d014796e5c1647f5a19b45b7993b390540b671fca83471e3d004712b277f3283
3
+ metadata.gz: cfc8b8464d84ae454c33d168638a3c496d4a7c9bcdcc5fb76905a4db3f7f8c68
4
+ data.tar.gz: 90b122e2a9fb78b41e350f92038854491bf95520cd6764e7719a086da3afa5ff
5
5
  SHA512:
6
- metadata.gz: 152b2f7e76b5b54c5dce0f0f97d5b0c301e4df2d71df0ba7643027d3e1015e3a3be838ceff2e49a851a3c62cd802ff2ab1473a1a62f6e359e66252204ce4bc7e
7
- data.tar.gz: 63b40def9bdb08b5d4acc7af524746e900c6e07fb4b267e6bc816e083b59b1d7b779b3d7884494e1a8e5eea88240aa1a2c4e95e71e1be79f4fdf31dbdb251903
6
+ metadata.gz: '068f424c28bda754c9870faf925a80525721e7baff71b582ad9b91041510f078c6dc1d1316362347a406dd31c6843c28abd05fdcf7ec211ce35e617817f3741b'
7
+ data.tar.gz: 7d47eb015acfb84adc666c2ba59eb38da6d349bb029d407725f1046b2ec375a61aee3fcf195bd92f663400a9c9e14ca9d3c53022ad4ba9049b2ef46e662b65ab
data/Contributing.md CHANGED
@@ -82,9 +82,9 @@ Here's the most direct way to get your work merged into the project:
82
82
  Thanks to everyone else who has contributed to mime-types over the years:
83
83
 
84
84
  - Aaron Patterson
85
- - Alex Vondrak
86
85
  - Aggelos Avgerinos
87
86
  - Al Snow
87
+ - Alex Vondrak
88
88
  - Andre Pankratz
89
89
  - Andy Brody
90
90
  - Arnaud Meuret
@@ -93,8 +93,8 @@ Thanks to everyone else who has contributed to mime-types over the years:
93
93
  - Chris Gat
94
94
  - David Genord
95
95
  - Dillon Welch
96
- - Eric Marden
97
96
  - Edward Betts
97
+ - Eric Marden
98
98
  - Garret Alfert
99
99
  - Godfrey Chan
100
100
  - Greg Brockman
@@ -106,15 +106,16 @@ Thanks to everyone else who has contributed to mime-types over the years:
106
106
  - Jeremy Evans
107
107
  - Juanito Fatas
108
108
  - Jun Aruga
109
- - Łukasz Śliwa
110
109
  - Keerthi Siva
111
110
  - Ken Ip
112
111
  - Kevin Menard
113
112
  - Koichi ITO
113
+ - Łukasz Śliwa
114
114
  - Martin d'Allens
115
+ - Masato Nakamura
115
116
  - Mauricio Linhares
116
- - Nicolas Leger
117
117
  - Nicholas La Roux
118
+ - Nicolas Leger
118
119
  - nycvotes-dev
119
120
  - Olle Jonsson
120
121
  - Postmodern
data/History.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.5.2 / 2024-01-02
4
+
5
+ There are no primary code changes, but we are releasing this as an update as
6
+ there are some validation changes and updated code with formatting.
7
+
8
+ - Dependency and CI updates:
9
+
10
+ - Masato Nakamura added Ruby 3.3 to the CI workflow in [#179][].
11
+
12
+ - Fixed regressions in standard formatting in [#180][].
13
+
14
+ - Removed `minitest-bonus-assertions` because of a bundler resolution issue.
15
+ Created a better replacement in-line.
16
+
3
17
  ## 3.5.1 / 2023-08-21
4
18
 
5
19
  - 1 bug fix:
@@ -314,6 +328,8 @@
314
328
  [#170]: https://github.com/mime-types/ruby-mime-types/pull/170
315
329
  [#177]: https://github.com/mime-types/ruby-mime-types/issues/177
316
330
  [#178]: https://github.com/mime-types/ruby-mime-types/pull/178
331
+ [#179]: https://github.com/mime-types/ruby-mime-types/pull/179
332
+ [#180]: https://github.com/mime-types/ruby-mime-types/pull/180
317
333
  [code-of-conduct.md]: Code-of-Conduct_md.html
318
334
  [contributor covenant]: http://contributor-covenant.org
319
335
  [mime-types-data]: https://github.com/mime-types/mime-types-data
data/Rakefile CHANGED
@@ -30,7 +30,6 @@ spec = Hoe.spec "mime-types" do
30
30
  extra_dev_deps << ["hoe-rubygems", "~> 1.0"]
31
31
  extra_dev_deps << ["minitest", "~> 5.0"]
32
32
  extra_dev_deps << ["minitest-autotest", "~> 1.0"]
33
- extra_dev_deps << ["minitest-bonus-assertions", "~> 3.0"]
34
33
  extra_dev_deps << ["minitest-focus", "~> 1.0"]
35
34
  extra_dev_deps << ["minitest-hooks", "~> 1.4"]
36
35
  extra_dev_deps << ["rake", ">= 10.0", "< 14.0"]
data/lib/mime/type.rb CHANGED
@@ -93,7 +93,7 @@ class MIME::Type
93
93
  end
94
94
 
95
95
  # The released version of the mime-types library.
96
- VERSION = "3.5.1"
96
+ VERSION = "3.5.2"
97
97
 
98
98
  include Comparable
99
99
 
@@ -26,7 +26,7 @@ module MIME
26
26
  end
27
27
 
28
28
  def initialize(_one, _two = nil, _three = nil)
29
- super nil
29
+ super(nil)
30
30
  @logdev = WarnLogDevice.new
31
31
  @formatter = ->(_s, _d, _p, m) { m }
32
32
  end
data/lib/mime/types.rb CHANGED
@@ -165,7 +165,7 @@ class MIME::Types
165
165
  # The last parameter may be the value <tt>:silent</tt> or +true+ which
166
166
  # will suppress duplicate MIME type warnings.
167
167
  def add(*types)
168
- quiet = ((types.last == :silent) || (types.last == true))
168
+ quiet = (types.last == :silent) || (types.last == true)
169
169
 
170
170
  types.each do |mime_type|
171
171
  case mime_type
@@ -5,7 +5,6 @@ require "fileutils"
5
5
 
6
6
  gem "minitest"
7
7
  require "minitest/focus"
8
- require "minitest-bonus-assertions"
9
8
  require "minitest/hooks"
10
9
 
11
10
  ENV["RUBY_MIME_TYPES_LAZY_LOAD"] = "yes"
@@ -446,37 +446,53 @@ describe MIME::Type do
446
446
  describe "#to_h" do
447
447
  let(:t) { mime_type("a/b") }
448
448
 
449
+ def assert_has_keys(wanted_keys, actual, msg = nil)
450
+ wanted_keys = Array(wanted_keys).uniq.sort
451
+ actual_keys = if actual.is_a?(Hash)
452
+ actual.keys
453
+ else
454
+ actual.to_h.keys
455
+ end
456
+
457
+ missing = wanted_keys - actual_keys
458
+ pretty_wanted_keys = (wanted_keys + actual_keys).uniq.sort
459
+
460
+ msg = message(msg) {
461
+ "#{mu_pp(actual)} is missing attribute values\n#{diff(pretty_wanted_keys, actual_keys)}"
462
+ }
463
+
464
+ assert missing.empty?, msg
465
+ end
466
+
449
467
  it "has the required keys (content-type, registered, encoding)" do
450
- assert_has_keys t.to_h, %w[content-type registered encoding]
468
+ assert_has_keys %w[content-type registered encoding], t
451
469
  end
452
470
 
453
471
  it "has the docs key if there are documents" do
454
- assert_has_keys mime_type(t) { |v| v.docs = "a" }.to_h, %w[docs]
472
+ assert_has_keys "docs", mime_type(t) { |v| v.docs = "a" }
455
473
  end
456
474
 
457
475
  it "has the extensions key if set" do
458
- assert_has_keys mime_type(t) { |v| v.extensions = "a" }.to_h,
459
- "extensions"
476
+ assert_has_keys "extensions", mime_type(t) { |v| v.extensions = "a" }
460
477
  end
461
478
 
462
479
  it "has the preferred-extension key if set" do
463
- assert_has_keys mime_type(t) { |v| v.preferred_extension = "a" }.to_h,
464
- "preferred-extension"
480
+ assert_has_keys "preferred-extension", mime_type(t) { |v| v.preferred_extension = "a" }
465
481
  end
466
482
 
467
483
  it "has the obsolete key if set" do
468
- assert_has_keys mime_type(t) { |v| v.obsolete = true }.to_h, "obsolete"
484
+ assert_has_keys "obsolete", mime_type(t) { |v| v.obsolete = true }
469
485
  end
470
486
 
471
487
  it "has the obsolete and use-instead keys if set" do
472
- assert_has_keys mime_type(t) { |v|
488
+ assert_has_keys %w[obsolete use-instead], mime_type(t) { |v|
473
489
  v.obsolete = true
474
490
  v.use_instead = "c/d"
475
- }.to_h, %w[obsolete use-instead]
491
+ }
476
492
  end
477
493
 
478
494
  it "has the signature key if set" do
479
- assert_has_keys mime_type(t) { |v| v.signature = true }.to_h, "signature"
495
+ assert_has_keys "signature", mime_type(t) { |v| v.signature = true }
480
496
  end
481
497
  end
482
498
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mime-types
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.1
4
+ version: 3.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Austin Ziegler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-22 00:00:00.000000000 Z
11
+ date: 2024-01-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mime-types-data
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '5.19'
33
+ version: '5.20'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '5.19'
40
+ version: '5.20'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: hoe
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -128,20 +128,6 @@ dependencies:
128
128
  - - "~>"
129
129
  - !ruby/object:Gem::Version
130
130
  version: '1.0'
131
- - !ruby/object:Gem::Dependency
132
- name: minitest-bonus-assertions
133
- requirement: !ruby/object:Gem::Requirement
134
- requirements:
135
- - - "~>"
136
- - !ruby/object:Gem::Version
137
- version: '3.0'
138
- type: :development
139
- prerelease: false
140
- version_requirements: !ruby/object:Gem::Requirement
141
- requirements:
142
- - - "~>"
143
- - !ruby/object:Gem::Version
144
- version: '3.0'
145
131
  - !ruby/object:Gem::Dependency
146
132
  name: minitest-focus
147
133
  requirement: !ruby/object:Gem::Requirement
@@ -321,7 +307,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
321
307
  - !ruby/object:Gem::Version
322
308
  version: '0'
323
309
  requirements: []
324
- rubygems_version: 3.4.18
310
+ rubygems_version: 3.5.3
325
311
  signing_key:
326
312
  specification_version: 4
327
313
  summary: The mime-types library provides a library and registry for information about