mime-types 3.6.0 → 3.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/{History.md → CHANGELOG.md} +138 -116
- data/CONTRIBUTING.md +104 -0
- data/CONTRIBUTORS.md +50 -0
- data/{Licence.md → LICENCE.md} +9 -10
- data/Manifest.txt +8 -6
- data/README.md +199 -0
- data/Rakefile +46 -90
- data/SECURITY.md +7 -0
- data/lib/mime/type.rb +2 -3
- data/lib/mime/types/container.rb +43 -13
- data/lib/mime/types/logger.rb +34 -3
- data/lib/mime/types/version.rb +14 -0
- data/lib/mime/types.rb +1 -3
- data/test/minitest_helper.rb +3 -3
- metadata +31 -98
- data/.standard.yml +0 -4
- data/Contributing.md +0 -133
- data/README.rdoc +0 -195
- /data/{Code-of-Conduct.md → CODE_OF_CONDUCT.md} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd6f8aeab4035fef308644c29775e3f2d93ec7ecd6c5e382d9757e11f472732a
|
4
|
+
data.tar.gz: 79f7acfee2e37d1016cdb16f3abfa8b2b7910a771e2a97145be56fe1c81d75ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3652bd791955a3c634735c1fb886a54a98aff2ad2b828d7a6dfb6c70d4bf13de7698aae13f1f610eb2796efc009e57314329d1b97e9fcf46c19dff7b82d08a2e
|
7
|
+
data.tar.gz: 7db724bccd63070bb30228d36319d3d8fb79b10a6c75888463f0feb902cd9677303d67542460b3ea1f867c54ead962e6956650690153d37e67ad00a3c9ec98c0
|
data/{History.md → CHANGELOG.md}
RENAMED
@@ -1,5 +1,24 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 3.6.1 / 2025-03-15
|
4
|
+
|
5
|
+
- Restructure project structure to be more consistent with mime-types-data.
|
6
|
+
|
7
|
+
- Increased GitHub action security. Added Ruby 3.4, dropped macOS 12, added
|
8
|
+
macOS 15.
|
9
|
+
|
10
|
+
- Added [trusted publishing][tp] for fully automated releases.
|
11
|
+
|
12
|
+
- Added `MIME::Types::NullLogger` to completely silence MIME::Types logging.
|
13
|
+
|
14
|
+
- Improved the development experience with updates to the Gemfile.
|
15
|
+
|
16
|
+
- Worked around various issues with the benchmarks and profiling code.
|
17
|
+
|
18
|
+
- Removed Forwardable from MIME::Types::Container.
|
19
|
+
|
20
|
+
- Added coverage support (back).
|
21
|
+
|
3
22
|
## 3.6.0 / 2024-10-02
|
4
23
|
|
5
24
|
- 2 deprecations:
|
@@ -25,9 +44,9 @@ there are some validation changes and updated code with formatting.
|
|
25
44
|
|
26
45
|
- Dependency and CI updates:
|
27
46
|
|
28
|
-
- Masato Nakamura added Ruby 3.3 to the CI workflow in [#179][].
|
47
|
+
- Masato Nakamura added Ruby 3.3 to the CI workflow in [#179][pull-179].
|
29
48
|
|
30
|
-
- Fixed regressions in standard formatting in [#180][].
|
49
|
+
- Fixed regressions in standard formatting in [#180][pull-180].
|
31
50
|
|
32
51
|
- Removed `minitest-bonus-assertions` because of a bundler resolution issue.
|
33
52
|
Created a better replacement in-line.
|
@@ -37,18 +56,18 @@ there are some validation changes and updated code with formatting.
|
|
37
56
|
- 1 bug fix:
|
38
57
|
|
39
58
|
- Better handle possible line-termination strings (legal in Unix filenames)
|
40
|
-
such as `\n` in `MIME::Types.type_for`. Reported by ooooooo-q in
|
41
|
-
resolved in [#178][].
|
59
|
+
such as `\n` in `MIME::Types.type_for`. Reported by ooooooo-q in
|
60
|
+
[#177][issue-177], resolved in [#178][pull-178].
|
42
61
|
|
43
62
|
## 3.5.0 / 2023-08-07
|
44
63
|
|
45
64
|
- 1 minor enhancement:
|
46
65
|
|
47
66
|
- Robb Shecter changed the default log level for duplicate type variant from
|
48
|
-
`warn` to `debug` in [#170][]. This works because
|
49
|
-
intended to fit the `::Logger` interface, and the
|
50
|
-
(`WarnLogger`) is a subclass of `::Logger` that passes
|
51
|
-
`Kernel.warn`.
|
67
|
+
`warn` to `debug` in [#170][pull-170]. This works because
|
68
|
+
`MIME::Types.logger` is intended to fit the `::Logger` interface, and the
|
69
|
+
default logger (`WarnLogger`) is a subclass of `::Logger` that passes
|
70
|
+
through to `Kernel.warn`.
|
52
71
|
|
53
72
|
- Further consideration has changed cache load messages from `warn` to
|
54
73
|
`error` and deprecation messages from `warn` to `debug`.
|
@@ -56,7 +75,7 @@ there are some validation changes and updated code with formatting.
|
|
56
75
|
- 1 bug fix:
|
57
76
|
|
58
77
|
- Added a definition of `MIME::Type#hash`. Contributed by Alex Vondrak in
|
59
|
-
[#167][], fixing [#166][].
|
78
|
+
[#167][pull-167], fixing [#166][issue-166].
|
60
79
|
|
61
80
|
- Dependency and CI updates:
|
62
81
|
|
@@ -81,8 +100,8 @@ there are some validation changes and updated code with formatting.
|
|
81
100
|
|
82
101
|
- Fixed a Ruby < 2.3 incompatibility introduced by the use of standardrb,
|
83
102
|
where `<<-` heredocs were converted to `<<~` heredocs. These have been
|
84
|
-
reverted back to `<<-` with the indentation kept and a `.strip` call
|
85
|
-
|
103
|
+
reverted back to `<<-` with the indentation kept and a `.strip` call to
|
104
|
+
prevent excess whitespace.
|
86
105
|
|
87
106
|
## 3.4.0 / 2021-11-15
|
88
107
|
|
@@ -98,10 +117,10 @@ there are some validation changes and updated code with formatting.
|
|
98
117
|
|
99
118
|
- Administrivia:
|
100
119
|
|
101
|
-
- Added Ruby 3.0 to the CI test matrix. Added `windows/jruby` to the
|
102
|
-
|
120
|
+
- Added Ruby 3.0 to the CI test matrix. Added `windows/jruby` to the CI
|
121
|
+
exclusion list; it refuses to run successfully.
|
103
122
|
- Removed the Travis CI configuration and changed it to Github Workflows
|
104
|
-
[#150][]. Removed Coveralls configuration.
|
123
|
+
[#150][pull-150]. Removed Coveralls configuration.
|
105
124
|
- Igor Victor added TruffleRuby to the Travis CI configuration. [#149]
|
106
125
|
- Koichi ITO loosened an excessively tight dependency. [#147]
|
107
126
|
- Started using `standardrb` for Ruby formatting and validation.
|
@@ -111,15 +130,16 @@ there are some validation changes and updated code with formatting.
|
|
111
130
|
|
112
131
|
- 1 minor bug fix:
|
113
132
|
|
114
|
-
- Al Snow fixed a warning with MIME::Types::Logger producing a warning
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
133
|
+
- Al Snow fixed a warning with MIME::Types::Logger producing a warning because
|
134
|
+
Ruby 2.7 introduces numbered block parameters. Because of the way that the
|
135
|
+
MIME::Types::Logger works for deprecation messages, the initializer
|
136
|
+
parameters had been named `_1`, `_2`, and `_3`. This has now been resolved.
|
137
|
+
[#146]
|
119
138
|
|
120
139
|
- Administrivia:
|
121
140
|
|
122
|
-
- Olle Jonsson removed an outdated Travis configuration option.
|
141
|
+
- Olle Jonsson removed an outdated Travis configuration option.
|
142
|
+
[#142][pull-142]
|
123
143
|
|
124
144
|
## 3.3 / 2019-09-04
|
125
145
|
|
@@ -136,23 +156,23 @@ there are some validation changes and updated code with formatting.
|
|
136
156
|
|
137
157
|
## 3.2.2 / 2018-08-12
|
138
158
|
|
139
|
-
- Hiroto Fukui removed a stray `debugger` statement that I had used in
|
140
|
-
|
159
|
+
- Hiroto Fukui removed a stray `debugger` statement that I had used in producing
|
160
|
+
v3.2.1. [#137]
|
141
161
|
|
142
162
|
## 3.2.1 / 2018-08-12
|
143
163
|
|
144
164
|
- A few bugs related to MIME::Types::Container and its use in the
|
145
|
-
mime-types-data helper tools reared their head because I released 3.2
|
146
|
-
|
165
|
+
mime-types-data helper tools reared their head because I released 3.2 before
|
166
|
+
verifying against mime-types-data.
|
147
167
|
|
148
168
|
## 3.2 / 2018-08-12
|
149
169
|
|
150
170
|
- 2 minor enhancements
|
151
171
|
|
152
172
|
- Janko Marohnić contributed a change to `MIME::Type#priority_order` that
|
153
|
-
should improve on strict sorting when dealing with MIME types that appear
|
154
|
-
|
155
|
-
|
173
|
+
should improve on strict sorting when dealing with MIME types that appear to
|
174
|
+
be in the same family even if strict sorting would cause an unregistered
|
175
|
+
type to be sorted first. [#132]
|
156
176
|
|
157
177
|
- Dillon Welch contributed a change that added `frozen_string_literal: true`
|
158
178
|
to files so that modern Rubies can automatically reduce duplicate string
|
@@ -163,20 +183,21 @@ there are some validation changes and updated code with formatting.
|
|
163
183
|
- Burke Libbey fixed a problem with cached data loading. [#126]
|
164
184
|
|
165
185
|
- Resolved an issue where Enumerable#inject returns `nil` when provided an
|
166
|
-
empty enumerable and a default value has not been provided. This is
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
registry
|
186
|
+
empty enumerable and a default value has not been provided. This is because
|
187
|
+
when Enumerable#inject isn't provided a starting value, the first value is
|
188
|
+
used as the default value. In every case where this error was happening, the
|
189
|
+
result was supposed to be an array containing Set objects so they can be
|
190
|
+
reduced to a single Set. [#117][issue-117], [#127][issue-127],
|
191
|
+
[#134][issue-134]
|
192
|
+
|
193
|
+
- Fixed an uncontrolled growth bug in MIME::Types::Container where a key miss
|
194
|
+
would create a new entry with an empty Set in the container. This was
|
195
|
+
working as designed (this particular feature was heavily used during
|
196
|
+
MIME::Type registry construction), but the design was flawed in that it did
|
197
|
+
not have any way of determining the difference between construction and
|
198
|
+
querying. This would mean that, if you have a function in your web app that
|
199
|
+
queries the MIME::Types registry by extension, the extension registry would
|
200
|
+
grow uncontrollably. [#136]
|
180
201
|
|
181
202
|
- Deprecations:
|
182
203
|
|
@@ -186,40 +207,41 @@ there are some validation changes and updated code with formatting.
|
|
186
207
|
|
187
208
|
- Supporting files are now Markdown instead of rdoc, except for the README.
|
188
209
|
|
189
|
-
- The history file has been modified to remove all history prior to 3.0.
|
190
|
-
|
210
|
+
- The history file has been modified to remove all history prior to 3.0. This
|
211
|
+
history can be found in previous commits.
|
191
212
|
|
192
|
-
- A spelling error was corrected by Edward Betts ([#129][]).
|
213
|
+
- A spelling error was corrected by Edward Betts ([#129][pull-129]).
|
193
214
|
|
194
215
|
- Administrivia:
|
195
216
|
|
196
217
|
- CI configuration for more modern versions of Ruby were added by Nicolas
|
197
|
-
Leger ([#130][]), Jun Aruga ([#125][]), and Austin Ziegler.
|
198
|
-
ruby-head-clang and rbx (Rubinius) from CI.
|
218
|
+
Leger ([#130][pull-130]), Jun Aruga ([#125][pull-125]), and Austin Ziegler.
|
219
|
+
Removed ruby-head-clang and rbx (Rubinius) from CI.
|
199
220
|
|
200
|
-
- Fixed tests which were asserting equality against nil, which will become
|
201
|
-
|
221
|
+
- Fixed tests which were asserting equality against nil, which will become an
|
222
|
+
error in Minitest 6.
|
202
223
|
|
203
224
|
## 3.1 / 2016-05-22
|
204
225
|
|
205
226
|
- 1 documentation change:
|
206
227
|
|
207
228
|
- Tim Smith (@tas50) updated the build badges to be SVGs to improve
|
208
|
-
readability on high-density (retina) screens with pull request
|
229
|
+
readability on high-density (retina) screens with pull request
|
230
|
+
[#112][pull-112].
|
209
231
|
|
210
232
|
- 3 bug fixes
|
211
233
|
|
212
234
|
- A test for `MIME::Types::Cache` fails under Ruby 2.3 because of frozen
|
213
|
-
strings, [#118][]. This has been fixed.
|
235
|
+
strings, [#118][pull-118]. This has been fixed.
|
214
236
|
|
215
|
-
- The JSON data has been incorrectly encoded since the release of
|
216
|
-
|
217
|
-
|
237
|
+
- The JSON data has been incorrectly encoded since the release of mime-types 3
|
238
|
+
on the `xrefs` field, because of the switch to using a Set to store
|
239
|
+
cross-reference information. This has been fixed.
|
218
240
|
|
219
|
-
- A tentative fix for [#117][] has been applied, removing the only
|
220
|
-
require dependencies that exist (and for which there was code to
|
221
|
-
but the current fix is simpler). I have no way to verify this fix
|
222
|
-
depending on how things are loaded by `delayed_job`, this fix may not be
|
241
|
+
- A tentative fix for [#117][issue-117] has been applied, removing the only
|
242
|
+
circular require dependencies that exist (and for which there was code to
|
243
|
+
prevent, but the current fix is simpler). I have no way to verify this fix
|
244
|
+
and depending on how things are loaded by `delayed_job`, this fix may not be
|
223
245
|
sufficient.
|
224
246
|
|
225
247
|
- 1 governance change
|
@@ -230,23 +252,23 @@ there are some validation changes and updated code with formatting.
|
|
230
252
|
|
231
253
|
- 2 governance changes
|
232
254
|
|
233
|
-
- This project and the related mime-types-data project are now exclusively
|
234
|
-
|
255
|
+
- This project and the related mime-types-data project are now exclusively MIT
|
256
|
+
licensed. Resolves [#95][pull-95].
|
235
257
|
|
236
|
-
- All projects under the mime-types organization now have a standard code
|
237
|
-
|
238
|
-
found in the [Code
|
258
|
+
- All projects under the mime-types organization now have a standard code of
|
259
|
+
conduct adapted from the [Contributor Covenant][contributor covenant]. This
|
260
|
+
text can be found in the [Code of Conduct][code of conduct] file.
|
239
261
|
|
240
262
|
- 3 major changes
|
241
263
|
|
242
264
|
- All methods deprecated in mime-types 2.x have been removed.
|
243
265
|
|
244
266
|
- mime-types now requires Ruby 2.0 compatibility or later. Resolves
|
245
|
-
[#97][].
|
267
|
+
[#97][pull-97].
|
246
268
|
|
247
269
|
- The registry data has been removed from mime-types and put into
|
248
270
|
mime-types-data, maintained and released separately. It can be found at
|
249
|
-
[mime-types-data][].
|
271
|
+
[mime-types-data][mime-types-data].
|
250
272
|
|
251
273
|
- 17 minor changes:
|
252
274
|
|
@@ -254,14 +276,14 @@ there are some validation changes and updated code with formatting.
|
|
254
276
|
|
255
277
|
- Changed the way that simplified types representations are created to
|
256
278
|
reflect the fact that `x-` prefixes are no longer considered special
|
257
|
-
according to IANA. A simplified MIME type is case-folded to lowercase.
|
258
|
-
|
259
|
-
|
279
|
+
according to IANA. A simplified MIME type is case-folded to lowercase. A
|
280
|
+
new keyword parameter, `remove_x_prefix`, can be provided to remove `x-`
|
281
|
+
prefixes.
|
260
282
|
|
261
|
-
- Improved initialization with an Array works so that extensions do not
|
262
|
-
|
263
|
-
|
264
|
-
|
283
|
+
- Improved initialization with an Array works so that extensions do not need
|
284
|
+
to be wrapped in another array. This means that `%w(text/yaml yaml yml)`
|
285
|
+
works in the same way that `['text/yaml', %w(yaml yml)]` did (and still
|
286
|
+
does).
|
265
287
|
|
266
288
|
- Changed `priority_compare` to conform with attributes that no longer
|
267
289
|
exist.
|
@@ -270,11 +292,11 @@ there are some validation changes and updated code with formatting.
|
|
270
292
|
|
271
293
|
- When extensions are set or modified with `add_extensions`, the primary
|
272
294
|
registry will be informed of a need to re-index extensions. Resolves
|
273
|
-
[#84][].
|
295
|
+
[#84][pull-84].
|
274
296
|
|
275
|
-
- The preferred extension can be set explicitly. If not set, it will be
|
276
|
-
|
277
|
-
|
297
|
+
- The preferred extension can be set explicitly. If not set, it will be the
|
298
|
+
first extension. If the preferred extension is not in the extension list,
|
299
|
+
it will be added.
|
278
300
|
|
279
301
|
- Improved how xref URLs are generated.
|
280
302
|
|
@@ -287,13 +309,13 @@ there are some validation changes and updated code with formatting.
|
|
287
309
|
|
288
310
|
- Removed `data_version` attribute.
|
289
311
|
|
290
|
-
- Changed `#[]` so that the `complete` and `registered` flags are
|
291
|
-
|
312
|
+
- Changed `#[]` so that the `complete` and `registered` flags are keywords
|
313
|
+
instead of a generic options parameter.
|
292
314
|
|
293
315
|
- Extracted the class methods to a separate file.
|
294
316
|
|
295
|
-
- Changed the container implementation to use a Set instead of an Array
|
296
|
-
|
317
|
+
- Changed the container implementation to use a Set instead of an Array to
|
318
|
+
prevent data duplication. Resolves [#79][pull-79].
|
297
319
|
|
298
320
|
- `MIME::Types::Cache` changes:
|
299
321
|
|
@@ -312,42 +334,42 @@ there are some validation changes and updated code with formatting.
|
|
312
334
|
|
313
335
|
- The registry is default loaded from the columnar store by default. The
|
314
336
|
internal format of the columnar store has changed; many of the boolean
|
315
|
-
flags are now loaded from a single file. Resolves [#85][].
|
316
|
-
|
317
|
-
[
|
318
|
-
[#84]: https://github.com/mime-types/ruby-mime-types/pull/84
|
319
|
-
[#85]: https://github.com/mime-types/ruby-mime-types/pull/85
|
320
|
-
[#95]: https://github.com/mime-types/ruby-mime-types/pull/95
|
321
|
-
[#97]: https://github.com/mime-types/ruby-mime-types/pull/97
|
322
|
-
[#112]: https://github.com/mime-types/ruby-mime-types/pull/112
|
323
|
-
[#117]: https://github.com/mime-types/ruby-mime-types/issues/117
|
324
|
-
[#118]: https://github.com/mime-types/ruby-mime-types/pull/118
|
325
|
-
[#125]: https://github.com/mime-types/ruby-mime-types/pull/125
|
326
|
-
[#126]: https://github.com/mime-types/ruby-mime-types/pull/126
|
327
|
-
[#127]: https://github.com/mime-types/ruby-mime-types/issues/127
|
328
|
-
[#129]: https://github.com/mime-types/ruby-mime-types/pull/129
|
329
|
-
[#130]: https://github.com/mime-types/ruby-mime-types/pull/130
|
330
|
-
[#127]: https://github.com/mime-types/ruby-mime-types/issues/127
|
331
|
-
[#132]: https://github.com/mime-types/ruby-mime-types/pull/132
|
332
|
-
[#134]: https://github.com/mime-types/ruby-mime-types/issues/134
|
333
|
-
[#135]: https://github.com/mime-types/ruby-mime-types/pull/135
|
334
|
-
[#136]: https://github.com/mime-types/ruby-mime-types/issues/136
|
335
|
-
[#137]: https://github.com/mime-types/ruby-mime-types/pull/137
|
336
|
-
[#139]: https://github.com/mime-types/ruby-mime-types/pull/139
|
337
|
-
[#141]: https://github.com/mime-types/ruby-mime-types/pull/141
|
338
|
-
[#142]: https://github.com/mime-types/ruby-mime-types/pull/142
|
339
|
-
[#146]: https://github.com/mime-types/ruby-mime-types/pull/146
|
340
|
-
[#147]: https://github.com/mime-types/ruby-mime-types/pull/147
|
341
|
-
[#149]: https://github.com/mime-types/ruby-mime-types/pull/149
|
342
|
-
[#150]: https://github.com/mime-types/ruby-mime-types/pull/150
|
343
|
-
[#153]: https://github.com/mime-types/ruby-mime-types/pull/153
|
344
|
-
[#166]: https://github.com/mime-types/ruby-mime-types/issues/166
|
345
|
-
[#167]: https://github.com/mime-types/ruby-mime-types/pull/167
|
346
|
-
[#170]: https://github.com/mime-types/ruby-mime-types/pull/170
|
347
|
-
[#177]: https://github.com/mime-types/ruby-mime-types/issues/177
|
348
|
-
[#178]: https://github.com/mime-types/ruby-mime-types/pull/178
|
349
|
-
[#179]: https://github.com/mime-types/ruby-mime-types/pull/179
|
350
|
-
[#180]: https://github.com/mime-types/ruby-mime-types/pull/180
|
351
|
-
[code-of-conduct.md]: Code-of-Conduct_md.html
|
337
|
+
flags are now loaded from a single file. Resolves [#85][pull-85].
|
338
|
+
|
339
|
+
[code of conduct]: CODE_OF_CONDUCT.md
|
352
340
|
[contributor covenant]: http://contributor-covenant.org
|
341
|
+
[issue-117]: https://github.com/mime-types/ruby-mime-types/issues/117
|
342
|
+
[issue-127]: https://github.com/mime-types/ruby-mime-types/issues/127
|
343
|
+
[issue-134]: https://github.com/mime-types/ruby-mime-types/issues/134
|
344
|
+
[issue-136]: https://github.com/mime-types/ruby-mime-types/issues/136
|
345
|
+
[issue-166]: https://github.com/mime-types/ruby-mime-types/issues/166
|
346
|
+
[issue-177]: https://github.com/mime-types/ruby-mime-types/issues/177
|
353
347
|
[mime-types-data]: https://github.com/mime-types/mime-types-data
|
348
|
+
[pull-112]: https://github.com/mime-types/ruby-mime-types/pull/112
|
349
|
+
[pull-118]: https://github.com/mime-types/ruby-mime-types/pull/118
|
350
|
+
[pull-125]: https://github.com/mime-types/ruby-mime-types/pull/125
|
351
|
+
[pull-126]: https://github.com/mime-types/ruby-mime-types/pull/126
|
352
|
+
[pull-129]: https://github.com/mime-types/ruby-mime-types/pull/129
|
353
|
+
[pull-130]: https://github.com/mime-types/ruby-mime-types/pull/130
|
354
|
+
[pull-132]: https://github.com/mime-types/ruby-mime-types/pull/132
|
355
|
+
[pull-135]: https://github.com/mime-types/ruby-mime-types/pull/135
|
356
|
+
[pull-137]: https://github.com/mime-types/ruby-mime-types/pull/137
|
357
|
+
[pull-139]: https://github.com/mime-types/ruby-mime-types/pull/139
|
358
|
+
[pull-141]: https://github.com/mime-types/ruby-mime-types/pull/141
|
359
|
+
[pull-142]: https://github.com/mime-types/ruby-mime-types/pull/142
|
360
|
+
[pull-146]: https://github.com/mime-types/ruby-mime-types/pull/146
|
361
|
+
[pull-147]: https://github.com/mime-types/ruby-mime-types/pull/147
|
362
|
+
[pull-149]: https://github.com/mime-types/ruby-mime-types/pull/149
|
363
|
+
[pull-150]: https://github.com/mime-types/ruby-mime-types/pull/150
|
364
|
+
[pull-153]: https://github.com/mime-types/ruby-mime-types/pull/153
|
365
|
+
[pull-167]: https://github.com/mime-types/ruby-mime-types/pull/167
|
366
|
+
[pull-170]: https://github.com/mime-types/ruby-mime-types/pull/170
|
367
|
+
[pull-178]: https://github.com/mime-types/ruby-mime-types/pull/178
|
368
|
+
[pull-179]: https://github.com/mime-types/ruby-mime-types/pull/179
|
369
|
+
[pull-180]: https://github.com/mime-types/ruby-mime-types/pull/180
|
370
|
+
[pull-79]: https://github.com/mime-types/ruby-mime-types/pull/79
|
371
|
+
[pull-84]: https://github.com/mime-types/ruby-mime-types/pull/84
|
372
|
+
[pull-85]: https://github.com/mime-types/ruby-mime-types/pull/85
|
373
|
+
[pull-95]: https://github.com/mime-types/ruby-mime-types/pull/95
|
374
|
+
[pull-97]: https://github.com/mime-types/ruby-mime-types/pull/97
|
375
|
+
[tp]: https://guides.rubygems.org/trusted-publishing/
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,104 @@
|
|
1
|
+
# Contributing
|
2
|
+
|
3
|
+
Contribution to mime-types is encouraged in any form: a bug report, a feature
|
4
|
+
request, or code contributions. There are a few DOs and DON'Ts for
|
5
|
+
contributions.
|
6
|
+
|
7
|
+
- DO:
|
8
|
+
|
9
|
+
- Keep the coding style that already exists for any updated Ruby code (support
|
10
|
+
or otherwise). I use [Standard Ruby][standardrb] for linting and formatting.
|
11
|
+
|
12
|
+
- Use thoughtfully-named topic branches for contributions. Rebase your commits
|
13
|
+
into logical chunks as necessary.
|
14
|
+
|
15
|
+
- Use [quality commit messages][qcm].
|
16
|
+
|
17
|
+
- Add your name or GitHub handle to `CONTRIBUTORS.md` and a record in the
|
18
|
+
`CHANGELOG.md` as a separate commit from your main change. (Follow the style
|
19
|
+
in the `CHANGELOG.md` and provide a link to your PR.)
|
20
|
+
|
21
|
+
- Add or update tests as appropriate for your change. The test suite is
|
22
|
+
written with [minitest][minitest].
|
23
|
+
|
24
|
+
- Add or update documentation as appropriate for your change. The
|
25
|
+
documentation is RDoc; mime-types does not use extensions that may be
|
26
|
+
present in alternative documentation generators.
|
27
|
+
|
28
|
+
- DO NOT:
|
29
|
+
|
30
|
+
- Modify `VERSION` in `lib/mime/types/version.rb`. When your patch is accepted
|
31
|
+
and a release is made, the version will be updated at that point.
|
32
|
+
|
33
|
+
- Modify `mime-types.gemspec`; it is a generated file. (You _may_ use
|
34
|
+
`rake gemspec` to regenerate it if your change involves metadata related to
|
35
|
+
gem itself).
|
36
|
+
|
37
|
+
- Modify the `Gemfile`.
|
38
|
+
|
39
|
+
## Adding or Modifying MIME Types
|
40
|
+
|
41
|
+
The mime-types registry is managed in [mime-types-data][mtd].
|
42
|
+
|
43
|
+
### Test Dependencies
|
44
|
+
|
45
|
+
mime-types uses Ryan Davis's [Hoe][Hoe] to manage the release process, and it
|
46
|
+
adds a number of rake tasks. You will mostly be interested in `rake`, which runs
|
47
|
+
the tests the same way that `rake test` will do.
|
48
|
+
|
49
|
+
To assist with the installation of the development dependencies for mime-types,
|
50
|
+
I have provided the simplest possible Gemfile pointing to the (generated)
|
51
|
+
`mime-types.gemspec` file. This will permit you to do `bundle install` to get
|
52
|
+
the development dependencies.
|
53
|
+
|
54
|
+
This task will install any missing dependencies, run the tests/specs, and
|
55
|
+
generate the RDoc.
|
56
|
+
|
57
|
+
You can run tests with code coverage analysis by running `rake test:coverage`.
|
58
|
+
|
59
|
+
## Benchmarks
|
60
|
+
|
61
|
+
mime-types offers several benchmark tasks to measure different measures of
|
62
|
+
performance.
|
63
|
+
|
64
|
+
There is a repeated load test, measuring how long it takes to start and load
|
65
|
+
mime-types with its full registry. By default, it runs fifty loops and uses the
|
66
|
+
built-in benchmark library:
|
67
|
+
|
68
|
+
- `rake benchmark:load`
|
69
|
+
|
70
|
+
There are two allocation tracing benchmarks (for normal and columnar loads).
|
71
|
+
These can only be run on Ruby 2.1 or better and requires the
|
72
|
+
[allocation\_tracer][allocation-tracer] gem (not installed by default).
|
73
|
+
|
74
|
+
- `rake benchmark:allocations`
|
75
|
+
- `rake benchmark:allocations:columnar`
|
76
|
+
|
77
|
+
There are two loaded object count benchmarks (for normal and columnar loads).
|
78
|
+
These use `ObjectSpace.count_objects`.
|
79
|
+
|
80
|
+
- `rake benchmark:objects`
|
81
|
+
- `rake benchmark:objects:columnar`
|
82
|
+
|
83
|
+
## Workflow
|
84
|
+
|
85
|
+
Here's the most direct way to get your work merged into the project:
|
86
|
+
|
87
|
+
- Fork the project.
|
88
|
+
- Clone down your fork
|
89
|
+
(`git clone git://github.com/<username>/ruby-mime-types.git`).
|
90
|
+
- Create a topic branch to contain your change
|
91
|
+
(`git checkout -b my_awesome_feature`).
|
92
|
+
- Hack away, add tests. Not necessarily in that order.
|
93
|
+
- Make sure everything still passes by running `rake`.
|
94
|
+
- If necessary, rebase your commits into logical chunks, without errors.
|
95
|
+
- Push the branch up (`git push origin my_awesome_feature`).
|
96
|
+
- Create a pull request against mime-types/ruby-mime-types and describe what
|
97
|
+
your change does and the why you think it should be merged.
|
98
|
+
|
99
|
+
[allocation-tracer]: https://github.com/ko1/allocation_tracer
|
100
|
+
[hoe]: https://github.com/seattlerb/hoe
|
101
|
+
[minitest]: https://github.com/seattlerb/minitest
|
102
|
+
[mtd]: https://github.com/mime-types/mime-types-data
|
103
|
+
[qcm]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
|
104
|
+
[standardrb]: https://github.com/standardrb/standard
|
data/CONTRIBUTORS.md
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
# Contributors
|
2
|
+
|
3
|
+
- Austin Ziegler created mime-types.
|
4
|
+
|
5
|
+
Thanks to everyone else who has contributed to mime-types over the years:
|
6
|
+
|
7
|
+
- Aaron Patterson
|
8
|
+
- Aggelos Avgerinos
|
9
|
+
- Al Snow
|
10
|
+
- Alex Vondrak
|
11
|
+
- Andre Pankratz
|
12
|
+
- Andy Brody
|
13
|
+
- Arnaud Meuret
|
14
|
+
- Brandon Galbraith
|
15
|
+
- Burke Libbey
|
16
|
+
- Chris Gat
|
17
|
+
- David Genord
|
18
|
+
- Dillon Welch
|
19
|
+
- Edward Betts
|
20
|
+
- Eric Marden
|
21
|
+
- Garret Alfert
|
22
|
+
- Godfrey Chan
|
23
|
+
- Greg Brockman
|
24
|
+
- Hans de Graaff
|
25
|
+
- Henrik Hodne
|
26
|
+
- Igor Victor
|
27
|
+
- Janko Marohnić
|
28
|
+
- Jean Boussier
|
29
|
+
- Jeremy Evans
|
30
|
+
- Juanito Fatas
|
31
|
+
- Jun Aruga
|
32
|
+
- Keerthi Siva
|
33
|
+
- Ken Ip
|
34
|
+
- Kevin Menard
|
35
|
+
- Koichi ITO
|
36
|
+
- Łukasz Śliwa
|
37
|
+
- Martin d'Allens
|
38
|
+
- Masato Nakamura
|
39
|
+
- Mauricio Linhares
|
40
|
+
- Nicholas La Roux
|
41
|
+
- Nicolas Leger
|
42
|
+
- nycvotes-dev
|
43
|
+
- Olle Jonsson
|
44
|
+
- Postmodern
|
45
|
+
- Richard Hirner
|
46
|
+
- Richard Hurt
|
47
|
+
- Richard Schneeman
|
48
|
+
- Robb Shecter
|
49
|
+
- Tibor Szolár
|
50
|
+
- Todd Carrico
|
data/{Licence.md → LICENCE.md}
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Licence
|
2
2
|
|
3
|
-
- Copyright 2003
|
3
|
+
- Copyright 2003-2025 Austin Ziegler and contributors.
|
4
4
|
|
5
5
|
The software in this repository is made available under the MIT license.
|
6
6
|
|
@@ -9,17 +9,16 @@ The software in this repository is made available under the MIT license.
|
|
9
9
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
10
10
|
this software and associated documentation files (the "Software"), to deal in
|
11
11
|
the Software without restriction, including without limitation the rights to
|
12
|
-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
13
|
-
|
14
|
-
|
12
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
13
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
14
|
+
subject to the following conditions:
|
15
15
|
|
16
16
|
The above copyright notice and this permission notice shall be included in all
|
17
17
|
copies or substantial portions of the Software.
|
18
18
|
|
19
19
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
20
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
SOFTWARE.
|
20
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
21
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
22
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
23
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
24
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Manifest.txt
CHANGED
@@ -1,11 +1,12 @@
|
|
1
|
-
.
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
CHANGELOG.md
|
2
|
+
CODE_OF_CONDUCT.md
|
3
|
+
CONTRIBUTING.md
|
4
|
+
CONTRIBUTORS.md
|
5
|
+
LICENCE.md
|
6
6
|
Manifest.txt
|
7
|
-
README.
|
7
|
+
README.md
|
8
8
|
Rakefile
|
9
|
+
SECURITY.md
|
9
10
|
lib/mime-types.rb
|
10
11
|
lib/mime/type.rb
|
11
12
|
lib/mime/type/columnar.rb
|
@@ -19,6 +20,7 @@ lib/mime/types/full.rb
|
|
19
20
|
lib/mime/types/loader.rb
|
20
21
|
lib/mime/types/logger.rb
|
21
22
|
lib/mime/types/registry.rb
|
23
|
+
lib/mime/types/version.rb
|
22
24
|
test/bad-fixtures/malformed
|
23
25
|
test/fixture/json.json
|
24
26
|
test/fixture/old-data
|