mime-types 3.3.1 → 3.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Code-of-Conduct.md +10 -10
- data/Contributing.md +82 -93
- data/History.md +167 -138
- data/Licence.md +3 -3
- data/README.rdoc +1 -0
- data/Rakefile +131 -145
- data/lib/mime/type/columnar.rb +3 -3
- data/lib/mime/type.rb +141 -94
- data/lib/mime/types/_columnar.rb +20 -19
- data/lib/mime/types/cache.rb +8 -8
- data/lib/mime/types/columnar.rb +1 -1
- data/lib/mime/types/container.rb +14 -14
- data/lib/mime/types/deprecations.rb +15 -11
- data/lib/mime/types/full.rb +2 -2
- data/lib/mime/types/loader.rb +28 -15
- data/lib/mime/types/logger.rb +3 -5
- data/lib/mime/types/registry.rb +7 -7
- data/lib/mime/types.rb +18 -16
- data/lib/mime-types.rb +1 -1
- data/test/minitest_helper.rb +7 -9
- data/test/test_mime_type.rb +272 -261
- data/test/test_mime_types.rb +72 -72
- data/test/test_mime_types_cache.rb +38 -38
- data/test/test_mime_types_class.rb +59 -59
- data/test/test_mime_types_lazy.rb +16 -16
- data/test/test_mime_types_loader.rb +14 -14
- metadata +15 -43
data/History.md
CHANGED
@@ -1,216 +1,241 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
## 3.4.1 / 2021-11-16
|
4
|
+
|
5
|
+
- 1 bugfix:
|
6
|
+
|
7
|
+
- Fixed a Ruby < 2.3 incompatibility introduced by the use of standardrb,
|
8
|
+
where `<<-` heredocs were converted to `<<~` heredocs. These have been
|
9
|
+
reverted back to `<<-` with the indentation kept and a `.strip` call
|
10
|
+
to prevent excess whitespace.
|
11
|
+
|
12
|
+
## 3.4.0 / 2021-11-15
|
13
|
+
|
14
|
+
- 1 minor enhancement:
|
15
|
+
|
16
|
+
- Added a new field to `MIME::Type` for checking provisional registrations
|
17
|
+
from IANA. [#157]
|
18
|
+
|
19
|
+
- Documentation:
|
20
|
+
|
21
|
+
- Kevin Menard synced the documentation so that all examples are correct.
|
22
|
+
[#153]
|
23
|
+
|
24
|
+
- Administrivia:
|
25
|
+
|
26
|
+
- Added Ruby 3.0 to the CI test matrix. Added `windows/jruby` to the
|
27
|
+
CI exclusion list; it refuses to run successfully.
|
28
|
+
- Removed the Travis CI configuration and changed it to Github Workflows
|
29
|
+
[#150]. Removed Coveralls configuration.
|
30
|
+
- Igor Victor added TruffleRuby to the Travis CI configuration. [#149]
|
31
|
+
- Koichi ITO loosened an excessively tight dependency. [#147]
|
32
|
+
- Started using `standardrb` for Ruby formatting and validation.
|
33
|
+
- Moved `deps:top` functionality to a support file.
|
34
|
+
|
1
35
|
## 3.3.1 / 2019-12-26
|
2
36
|
|
3
|
-
|
37
|
+
- 1 minor bugfix:
|
4
38
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
39
|
+
- Al Snow fixed a warning with MIME::Types::Logger producing a warning
|
40
|
+
because Ruby 2.7 introduces numbered block parameters. Because of the way
|
41
|
+
that the MIME::Types::Logger works for deprecation messages, the
|
42
|
+
initializer parameters had been named `_1`, `_2`, and `_3`. This has now
|
43
|
+
been resolved. [#146]
|
10
44
|
|
11
|
-
|
45
|
+
- Administrivia:
|
12
46
|
|
13
|
-
|
14
|
-
false`). [#142][]
|
47
|
+
- Olle Jonsson removed an outdated Travis configuration option (`sudo: false`). [#142]
|
15
48
|
|
16
49
|
## 3.3 / 2019-09-04
|
17
50
|
|
18
|
-
|
51
|
+
- 1 minor enhancement
|
19
52
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
53
|
+
- Jean Boussier reduced memory usage for Ruby versions 2.3 or higher by
|
54
|
+
interning various string values in each type. This is done with a
|
55
|
+
backwards-compatible call that _freezes_ the strings on older versions of
|
56
|
+
Ruby. [#141]
|
24
57
|
|
25
|
-
|
58
|
+
- Administrivia:
|
26
59
|
|
27
|
-
|
60
|
+
- Nicholas La Roux updated Travis build configurations. [#139]
|
28
61
|
|
29
62
|
## 3.2.2 / 2018-08-12
|
30
63
|
|
31
|
-
|
32
|
-
|
64
|
+
- Hiroto Fukui removed a stray `debugger` statement that I had used in
|
65
|
+
producing v3.2.1. [#137]
|
33
66
|
|
34
67
|
## 3.2.1 / 2018-08-12
|
35
68
|
|
36
|
-
|
37
|
-
|
38
|
-
|
69
|
+
- A few bugs related to MIME::Types::Container and its use in the
|
70
|
+
mime-types-data helper tools reared their head because I released 3.2
|
71
|
+
before verifying against mime-types-data.
|
39
72
|
|
40
73
|
## 3.2 / 2018-08-12
|
41
74
|
|
42
|
-
|
75
|
+
- 2 minor enhancements
|
43
76
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
77
|
+
- Janko Marohnić contributed a change to `MIME::Type#priority_order` that
|
78
|
+
should improve on strict sorting when dealing with MIME types that appear
|
79
|
+
to be in the same family even if strict sorting would cause an
|
80
|
+
unregistered type to be sorted first. [#132]
|
48
81
|
|
49
|
-
|
50
|
-
|
51
|
-
string allocations. [#135][]
|
82
|
+
- Dillon Welch contributed a change that added `frozen_string_literal: true` to files so that modern Rubies can automatically reduce duplicate
|
83
|
+
string allocations. [#135]
|
52
84
|
|
53
|
-
|
85
|
+
- 2 bug fixes
|
54
86
|
|
55
|
-
|
87
|
+
- Burke Libbey fixed a problem with cached data loading. [#126]
|
56
88
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
[#134][].
|
89
|
+
- Resolved an issue where Enumerable#inject returns `nil` when provided an
|
90
|
+
empty enumerable and a default value has not been provided. This is
|
91
|
+
because when Enumerable#inject isn't provided a starting value, the first
|
92
|
+
value is used as the default value. In every case where this error was
|
93
|
+
happening, the result was supposed to be an array containing Set objects
|
94
|
+
so they can be reduced to a single Set. [#117], [#127], [#134]
|
64
95
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
96
|
+
- Fixed an uncontrolled growth bug in MIME::Types::Container where a key
|
97
|
+
miss would create a new entry with an empty Set in the container. This
|
98
|
+
was working as designed (this particular feature was heavily used during
|
99
|
+
MIME::Type registry construction), but the design was flawed in that it
|
100
|
+
did not have any way of determining the difference between construction
|
101
|
+
and querying. This would mean that, if you have a function in your web
|
102
|
+
app that queries the MIME::Types registry by extension, the extension
|
103
|
+
registry would grow uncontrollably. [#136]
|
73
104
|
|
74
|
-
|
105
|
+
- Deprecations:
|
75
106
|
|
76
|
-
|
107
|
+
- Lazy loading (`$RUBY_MIME_TYPES_LAZY_LOAD`) has been deprecated.
|
77
108
|
|
78
|
-
|
109
|
+
- Documentation Changes:
|
79
110
|
|
80
|
-
|
81
|
-
README.
|
111
|
+
- Supporting files are now Markdown instead of rdoc, except for the README.
|
82
112
|
|
83
|
-
|
84
|
-
|
113
|
+
- The history file has been modified to remove all history prior to 3.0.
|
114
|
+
This history can be found in previous commits.
|
85
115
|
|
86
|
-
|
116
|
+
- A spelling error was corrected by Edward Betts ([#129]).
|
87
117
|
|
88
|
-
|
118
|
+
- Administrivia:
|
89
119
|
|
90
|
-
|
91
|
-
|
92
|
-
|
120
|
+
- CI configuration for more modern versions of Ruby were added by Nicolas
|
121
|
+
Leger ([#130]), Jun Aruga ([#125]), and Austin Ziegler. Removed
|
122
|
+
ruby-head-clang and rbx (Rubinius) from CI.
|
93
123
|
|
94
|
-
|
95
|
-
|
124
|
+
- Fixed tests which were asserting equality against nil, which will become
|
125
|
+
an error in Minitest 6.
|
96
126
|
|
97
127
|
## 3.1 / 2016-05-22
|
98
128
|
|
99
|
-
|
129
|
+
- 1 documentation change:
|
100
130
|
|
101
|
-
|
102
|
-
|
103
|
-
[#112][].
|
131
|
+
- Tim Smith (@tas50) updated the build badges to be SVGs to improve
|
132
|
+
readability on high-density (retina) screens with pull request [#112].
|
104
133
|
|
105
|
-
|
134
|
+
- 3 bug fixes
|
106
135
|
|
107
|
-
|
108
|
-
|
136
|
+
- A test for `MIME::Types::Cache` fails under Ruby 2.3 because of frozen
|
137
|
+
strings, [#118]. This has been fixed.
|
109
138
|
|
110
|
-
|
111
|
-
|
112
|
-
|
139
|
+
- The JSON data has been incorrectly encoded since the release of
|
140
|
+
mime-types 3 on the `xrefs` field, because of the switch to using a Set
|
141
|
+
to store cross-reference information. This has been fixed.
|
113
142
|
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
143
|
+
- A tentative fix for [#117] has been applied, removing the only circular
|
144
|
+
require dependencies that exist (and for which there was code to prevent,
|
145
|
+
but the current fix is simpler). I have no way to verify this fix and
|
146
|
+
depending on how things are loaded by `delayed_job`, this fix may not be
|
147
|
+
sufficient.
|
119
148
|
|
120
|
-
|
149
|
+
- 1 governance change
|
121
150
|
|
122
|
-
|
151
|
+
- Updated to Contributor Covenant 1.4.
|
123
152
|
|
124
153
|
## 3.0 / 2015-11-21
|
125
154
|
|
126
|
-
|
155
|
+
- 2 governance changes
|
127
156
|
|
128
|
-
|
129
|
-
|
157
|
+
- This project and the related mime-types-data project are now exclusively
|
158
|
+
MIT licensed. Resolves [#95].
|
130
159
|
|
131
|
-
|
132
|
-
|
133
|
-
|
160
|
+
- All projects under the mime-types organization now have a standard code
|
161
|
+
of conduct adapted from the [Contributor Covenant]. This text can be
|
162
|
+
found in the [Code-of-Conduct.md] file.
|
134
163
|
|
135
|
-
|
164
|
+
- 3 major changes
|
136
165
|
|
137
|
-
|
166
|
+
- All methods deprecated in mime-types 2.x have been removed.
|
138
167
|
|
139
|
-
|
140
|
-
|
168
|
+
- mime-types now requires Ruby 2.0 compatibility or later. Resolves
|
169
|
+
[#97].
|
141
170
|
|
142
|
-
|
143
|
-
|
144
|
-
|
171
|
+
- The registry data has been removed from mime-types and put into
|
172
|
+
mime-types-data, maintained and released separately. It can be found at
|
173
|
+
[mime-types-data].
|
145
174
|
|
146
|
-
|
175
|
+
- 17 minor changes:
|
147
176
|
|
148
|
-
|
177
|
+
- `MIME::Type` changes:
|
149
178
|
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
179
|
+
- Changed the way that simplified types representations are created to
|
180
|
+
reflect the fact that `x-` prefixes are no longer considered special
|
181
|
+
according to IANA. A simplified MIME type is case-folded to lowercase.
|
182
|
+
A new keyword parameter, `remove_x_prefix`, can be provided to remove
|
183
|
+
`x-` prefixes.
|
155
184
|
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
`['text/yaml', %w(yaml yml)]` did (and still does).
|
185
|
+
- Improved initialization with an Array works so that extensions do not
|
186
|
+
need to be wrapped in another array. This means that `%w(text/yaml yaml yml)` works in the same way that `['text/yaml', %w(yaml yml)]` did (and
|
187
|
+
still does).
|
160
188
|
|
161
|
-
|
162
|
-
|
189
|
+
- Changed `priority_compare` to conform with attributes that no longer
|
190
|
+
exist.
|
163
191
|
|
164
|
-
|
165
|
-
Set.
|
192
|
+
- Changed the internal implementation of extensions to use a frozen Set.
|
166
193
|
|
167
|
-
|
168
|
-
|
169
|
-
|
194
|
+
- When extensions are set or modified with `add_extensions`, the primary
|
195
|
+
registry will be informed of a need to reindex extensions. Resolves
|
196
|
+
[#84].
|
170
197
|
|
171
|
-
|
172
|
-
|
173
|
-
|
198
|
+
- The preferred extension can be set explicitly. If not set, it will be
|
199
|
+
the first extension. If the preferred extension is not in the extension
|
200
|
+
list, it will be added.
|
174
201
|
|
175
|
-
|
202
|
+
- Improved how xref URLs are generated.
|
176
203
|
|
177
|
-
|
178
|
-
`attr_accessors`.
|
204
|
+
- Converted `obsolete`, `registered` and `signature` to `attr_accessors`.
|
179
205
|
|
180
|
-
|
206
|
+
- `MIME::Types` changes:
|
181
207
|
|
182
|
-
|
183
|
-
|
208
|
+
- Modified `MIME::Types.new` to track instances of `MIME::Types` so that
|
209
|
+
they can be told to reindex the extensions as necessary.
|
184
210
|
|
185
|
-
|
211
|
+
- Removed `data_version` attribute.
|
186
212
|
|
187
|
-
|
188
|
-
|
213
|
+
- Changed `#[]` so that the `complete` and `registered` flags are
|
214
|
+
keywords instead of a generic options parameter.
|
189
215
|
|
190
|
-
|
216
|
+
- Extracted the class methods to a separate file.
|
191
217
|
|
192
|
-
|
193
|
-
|
218
|
+
- Changed the container implementation to use a Set instead of an Array
|
219
|
+
to prevent data duplication. Resolves [#79].
|
194
220
|
|
195
|
-
|
221
|
+
- `MIME::Types::Cache` changes:
|
196
222
|
|
197
|
-
|
198
|
-
|
223
|
+
- Caching is now based on the data gem version instead of the mime-types
|
224
|
+
version.
|
199
225
|
|
200
|
-
|
226
|
+
- Caching is compatible with columnar registry stores.
|
201
227
|
|
202
|
-
|
228
|
+
- `MIME::Types::Loader` changes:
|
203
229
|
|
204
|
-
|
205
|
-
|
206
|
-
|
230
|
+
- `MIME::Types::Loader::PATH` has been removed and replaced with
|
231
|
+
`MIME::Types::Data::PATH` from the mime-types-data gem. The environment
|
232
|
+
variable `RUBY_MIME_TYPES_DATA` is still used.
|
207
233
|
|
208
|
-
|
209
|
-
removed.
|
234
|
+
- Support for the long-deprecated mime-types v1 format has been removed.
|
210
235
|
|
211
|
-
|
212
|
-
|
213
|
-
|
236
|
+
- The registry is default loaded from the columnar store by default. The
|
237
|
+
internal format of the columnar store has changed; many of the boolean
|
238
|
+
flags are now loaded from a single file. Resolves [#85].
|
214
239
|
|
215
240
|
[#79]: https://github.com/mime-types/ruby-mime-types/pull/79
|
216
241
|
[#84]: https://github.com/mime-types/ruby-mime-types/pull/84
|
@@ -235,6 +260,10 @@
|
|
235
260
|
[#141]: https://github.com/mime-types/ruby-mime-types/pull/141
|
236
261
|
[#142]: https://github.com/mime-types/ruby-mime-types/pull/142
|
237
262
|
[#146]: https://github.com/mime-types/ruby-mime-types/pull/146
|
238
|
-
[
|
239
|
-
[
|
263
|
+
[#147]: https://github.com/mime-types/ruby-mime-types/pull/147
|
264
|
+
[#149]: https://github.com/mime-types/ruby-mime-types/pull/149
|
265
|
+
[#150]: https://github.com/mime-types/ruby-mime-types/pull/150
|
266
|
+
[#153]: https://github.com/mime-types/ruby-mime-types/pull/153
|
267
|
+
[code-of-conduct.md]: Code-of-Conduct_md.html
|
268
|
+
[contributor covenant]: http://contributor-covenant.org
|
240
269
|
[mime-types-data]: https://github.com/mime-types/mime-types-data
|
data/Licence.md
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
|
1
|
+
# Licence
|
2
2
|
|
3
|
-
|
3
|
+
- Copyright 2003–2019 Austin Ziegler and contributors.
|
4
4
|
|
5
5
|
The software in this repository is made available under the MIT license.
|
6
6
|
|
7
|
-
|
7
|
+
## MIT License
|
8
8
|
|
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
|
data/README.rdoc
CHANGED
@@ -65,6 +65,7 @@ files). A MIME::Type stores the known information about one MIME type.
|
|
65
65
|
puts text.ascii? # => true
|
66
66
|
puts text.obsolete? # => false
|
67
67
|
puts text.registered? # => true
|
68
|
+
puts text.provisional? # => false
|
68
69
|
puts text.complete? # => true
|
69
70
|
|
70
71
|
puts text # => 'text/plain'
|