mime-types 2.99.3 → 3.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +5 -5
  2. data/{Code-of-Conduct.rdoc → Code-of-Conduct.md} +29 -30
  3. data/Contributing.md +132 -0
  4. data/History.md +269 -0
  5. data/{Licence.rdoc → Licence.md} +4 -18
  6. data/Manifest.txt +8 -25
  7. data/README.rdoc +63 -73
  8. data/Rakefile +200 -97
  9. data/lib/mime/type/columnar.rb +30 -63
  10. data/lib/mime/type.rb +294 -458
  11. data/lib/mime/types/_columnar.rb +137 -0
  12. data/lib/mime/types/cache.rb +52 -74
  13. data/lib/mime/types/columnar.rb +2 -147
  14. data/lib/mime/types/container.rb +96 -0
  15. data/lib/mime/types/deprecations.rb +17 -34
  16. data/lib/mime/types/full.rb +19 -0
  17. data/lib/mime/types/loader.rb +36 -152
  18. data/lib/mime/types/logger.rb +7 -5
  19. data/lib/mime/types/registry.rb +90 -0
  20. data/lib/mime/types.rb +55 -148
  21. data/lib/mime-types.rb +2 -2
  22. data/test/minitest_helper.rb +8 -18
  23. data/test/test_mime_type.rb +489 -464
  24. data/test/test_mime_types.rb +139 -91
  25. data/test/test_mime_types_cache.rb +85 -57
  26. data/test/test_mime_types_class.rb +120 -100
  27. data/test/test_mime_types_lazy.rb +30 -28
  28. data/test/test_mime_types_loader.rb +18 -45
  29. metadata +92 -77
  30. data/Contributing.rdoc +0 -170
  31. data/History-Types.rdoc +0 -454
  32. data/History.rdoc +0 -590
  33. data/data/mime-types.json +0 -1
  34. data/data/mime.content_type.column +0 -1980
  35. data/data/mime.docs.column +0 -1980
  36. data/data/mime.encoding.column +0 -1980
  37. data/data/mime.friendly.column +0 -1980
  38. data/data/mime.obsolete.column +0 -1980
  39. data/data/mime.registered.column +0 -1980
  40. data/data/mime.signature.column +0 -1980
  41. data/data/mime.use_instead.column +0 -1980
  42. data/data/mime.xrefs.column +0 -1980
  43. data/docs/COPYING.txt +0 -339
  44. data/docs/artistic.txt +0 -127
  45. data/lib/mime/types/loader_path.rb +0 -15
  46. data/support/apache_mime_types.rb +0 -108
  47. data/support/benchmarks/load.rb +0 -64
  48. data/support/benchmarks/load_allocations.rb +0 -83
  49. data/support/benchmarks/object_counts.rb +0 -41
  50. data/support/convert/columnar.rb +0 -88
  51. data/support/convert.rb +0 -158
  52. data/support/iana_registry.rb +0 -172
metadata CHANGED
@@ -1,43 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mime-types
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.99.3
4
+ version: 3.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Austin Ziegler
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-11 00:00:00.000000000 Z
11
+ date: 2021-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: minitest
14
+ name: mime-types-data
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '5.9'
20
- type: :development
19
+ version: '3.2015'
20
+ type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '5.9'
26
+ version: '3.2015'
27
27
  - !ruby/object:Gem::Dependency
28
- name: rdoc
28
+ name: minitest
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '4.0'
33
+ version: '5.14'
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: '4.0'
40
+ version: '5.14'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: hoe-doofus
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -95,19 +95,19 @@ dependencies:
95
95
  - !ruby/object:Gem::Version
96
96
  version: '1.0'
97
97
  - !ruby/object:Gem::Dependency
98
- name: hoe-travis
98
+ name: standard
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '1.2'
103
+ version: '1.0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: '1.2'
110
+ version: '1.0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: minitest-autotest
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -137,132 +137,146 @@ dependencies:
137
137
  - !ruby/object:Gem::Version
138
138
  version: '1.0'
139
139
  - !ruby/object:Gem::Dependency
140
- name: rake
140
+ name: minitest-bonus-assertions
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: '10.0'
145
+ version: '3.0'
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: '10.0'
152
+ version: '3.0'
153
153
  - !ruby/object:Gem::Dependency
154
- name: fivemat
154
+ name: minitest-hooks
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
157
  - - "~>"
158
158
  - !ruby/object:Gem::Version
159
- version: '1.3'
159
+ version: '1.4'
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
- version: '1.3'
166
+ version: '1.4'
167
+ - !ruby/object:Gem::Dependency
168
+ name: rake
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: '10.0'
174
+ - - "<"
175
+ - !ruby/object:Gem::Version
176
+ version: '14.0'
177
+ type: :development
178
+ prerelease: false
179
+ version_requirements: !ruby/object:Gem::Requirement
180
+ requirements:
181
+ - - ">="
182
+ - !ruby/object:Gem::Version
183
+ version: '10.0'
184
+ - - "<"
185
+ - !ruby/object:Gem::Version
186
+ version: '14.0'
167
187
  - !ruby/object:Gem::Dependency
168
- name: minitest-rg
188
+ name: simplecov
169
189
  requirement: !ruby/object:Gem::Requirement
170
190
  requirements:
171
191
  - - "~>"
172
192
  - !ruby/object:Gem::Version
173
- version: '5.2'
193
+ version: '0.7'
174
194
  type: :development
175
195
  prerelease: false
176
196
  version_requirements: !ruby/object:Gem::Requirement
177
197
  requirements:
178
198
  - - "~>"
179
199
  - !ruby/object:Gem::Version
180
- version: '5.2'
200
+ version: '0.7'
201
+ - !ruby/object:Gem::Dependency
202
+ name: rdoc
203
+ requirement: !ruby/object:Gem::Requirement
204
+ requirements:
205
+ - - ">="
206
+ - !ruby/object:Gem::Version
207
+ version: '4.0'
208
+ - - "<"
209
+ - !ruby/object:Gem::Version
210
+ version: '7'
211
+ type: :development
212
+ prerelease: false
213
+ version_requirements: !ruby/object:Gem::Requirement
214
+ requirements:
215
+ - - ">="
216
+ - !ruby/object:Gem::Version
217
+ version: '4.0'
218
+ - - "<"
219
+ - !ruby/object:Gem::Version
220
+ version: '7'
181
221
  - !ruby/object:Gem::Dependency
182
222
  name: hoe
183
223
  requirement: !ruby/object:Gem::Requirement
184
224
  requirements:
185
225
  - - "~>"
186
226
  - !ruby/object:Gem::Version
187
- version: '3.15'
227
+ version: '3.23'
188
228
  type: :development
189
229
  prerelease: false
190
230
  version_requirements: !ruby/object:Gem::Requirement
191
231
  requirements:
192
232
  - - "~>"
193
233
  - !ruby/object:Gem::Version
194
- version: '3.15'
234
+ version: '3.23'
195
235
  description: |-
196
236
  The mime-types library provides a library and registry for information about
197
237
  MIME content type definitions. It can be used to determine defined filename
198
238
  extensions for MIME types, or to use filename extensions to look up the likely
199
239
  MIME type definitions.
200
240
 
201
- This is release 2.99.1, the first scheduled data update for mime-types 2.x. As
202
- of mime-types 2.99. deprecation warnings are noisy and data that has been
203
- deprecated is now no longer available. The data is both dropped from the data
204
- files and is stubbed out as empty or +nil+ values as appropriate.
205
-
206
- mime-types-2.6 was the last version of mime-types 2.x with newly available
207
- features, and mime-types 2.99 will only receive quarterly updates to the IANA
208
- registered MIME media types plus any security updates that may be required.
209
-
210
- If the loss of the deprecated data matters, be sure to set your dependency
211
- appropriately:
212
-
213
- gem 'mime-types', '~> 2.6, < 2.99'
241
+ Version 3.0 is a major release that requires Ruby 2.0 compatibility and removes
242
+ deprecated functions. The columnar registry format introduced in 2.6 has been
243
+ made the primary format; the registry data has been extracted from this library
244
+ and put into {mime-types-data}[https://github.com/mime-types/mime-types-data].
245
+ Additionally, mime-types is now licensed exclusively under the MIT licence and
246
+ there is a code of conduct in effect. There are a number of other smaller
247
+ changes described in the History file.
214
248
  email:
215
249
  - halostatue@gmail.com
216
250
  executables: []
217
251
  extensions: []
218
252
  extra_rdoc_files:
219
- - Code-of-Conduct.rdoc
220
- - Contributing.rdoc
221
- - History-Types.rdoc
222
- - History.rdoc
223
- - Licence.rdoc
253
+ - Code-of-Conduct.md
254
+ - Contributing.md
255
+ - History.md
256
+ - Licence.md
224
257
  - Manifest.txt
225
258
  - README.rdoc
226
- - docs/COPYING.txt
227
- - docs/artistic.txt
228
259
  files:
229
- - Code-of-Conduct.rdoc
230
- - Contributing.rdoc
231
- - History-Types.rdoc
232
- - History.rdoc
233
- - Licence.rdoc
260
+ - Code-of-Conduct.md
261
+ - Contributing.md
262
+ - History.md
263
+ - Licence.md
234
264
  - Manifest.txt
235
265
  - README.rdoc
236
266
  - Rakefile
237
- - data/mime-types.json
238
- - data/mime.content_type.column
239
- - data/mime.docs.column
240
- - data/mime.encoding.column
241
- - data/mime.friendly.column
242
- - data/mime.obsolete.column
243
- - data/mime.registered.column
244
- - data/mime.signature.column
245
- - data/mime.use_instead.column
246
- - data/mime.xrefs.column
247
- - docs/COPYING.txt
248
- - docs/artistic.txt
249
267
  - lib/mime-types.rb
250
268
  - lib/mime/type.rb
251
269
  - lib/mime/type/columnar.rb
252
270
  - lib/mime/types.rb
271
+ - lib/mime/types/_columnar.rb
253
272
  - lib/mime/types/cache.rb
254
273
  - lib/mime/types/columnar.rb
274
+ - lib/mime/types/container.rb
255
275
  - lib/mime/types/deprecations.rb
276
+ - lib/mime/types/full.rb
256
277
  - lib/mime/types/loader.rb
257
- - lib/mime/types/loader_path.rb
258
278
  - lib/mime/types/logger.rb
259
- - support/apache_mime_types.rb
260
- - support/benchmarks/load.rb
261
- - support/benchmarks/load_allocations.rb
262
- - support/benchmarks/object_counts.rb
263
- - support/convert.rb
264
- - support/convert/columnar.rb
265
- - support/iana_registry.rb
279
+ - lib/mime/types/registry.rb
266
280
  - test/bad-fixtures/malformed
267
281
  - test/fixture/json.json
268
282
  - test/fixture/old-data
@@ -277,10 +291,12 @@ files:
277
291
  homepage: https://github.com/mime-types/ruby-mime-types/
278
292
  licenses:
279
293
  - MIT
280
- - Artistic-2.0
281
- - GPL-2.0
282
- metadata: {}
283
- post_install_message:
294
+ metadata:
295
+ homepage_uri: https://github.com/mime-types/ruby-mime-types/
296
+ source_code_uri: https://github.com/mime-types/ruby-mime-types/
297
+ bug_tracker_uri: https://github.com/mime-types/ruby-mime-types/issues
298
+ changelog_uri: https://github.com/mime-types/ruby-mime-types/blob/master/History.md
299
+ post_install_message:
284
300
  rdoc_options:
285
301
  - "--main"
286
302
  - README.rdoc
@@ -290,16 +306,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
290
306
  requirements:
291
307
  - - ">="
292
308
  - !ruby/object:Gem::Version
293
- version: 1.9.2
309
+ version: '2.0'
294
310
  required_rubygems_version: !ruby/object:Gem::Requirement
295
311
  requirements:
296
312
  - - ">="
297
313
  - !ruby/object:Gem::Version
298
314
  version: '0'
299
315
  requirements: []
300
- rubyforge_project:
301
- rubygems_version: 2.5.1
302
- signing_key:
316
+ rubygems_version: 3.1.6
317
+ signing_key:
303
318
  specification_version: 4
304
319
  summary: The mime-types library provides a library and registry for information about
305
320
  MIME content type definitions
data/Contributing.rdoc DELETED
@@ -1,170 +0,0 @@
1
- == Contributing
2
-
3
- I value any contribution to mime-types you can provide: a bug report, a feature
4
- request, or code contributions.
5
-
6
- There are a few guidelines for contributing to mime-types:
7
-
8
- * Code changes *will* *not* be accepted without tests. The test suite is
9
- written with {Minitest}[https://github.com/seattlerb/minitest].
10
- * Match my coding style.
11
- * Use a thoughtfully-named topic branch that contains your change. Rebase your
12
- commits into logical chunks as necessary.
13
- * Use {quality commit messages}[http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html].
14
- * Do not change the version number; when your patch is accepted and a release
15
- is made, the version will be updated at that point.
16
- * Submit a GitHub pull request with your changes.
17
- * New or changed behaviours require new or updated documentation.
18
-
19
- === Adding or Modifying MIME Types
20
-
21
- The mime-types registry is loaded from encoded files in +data+. These are not
22
- editable and cannot be compared meaningfully in a pull request; pull requests
23
- that include changes to these files will require amendment to revert these
24
- files.
25
-
26
- New or modified MIME types should be edited in the appropriate YAML file under
27
- +type-lists+. The format is as shown below for the +application/xml+ MIME type
28
- in +type-lists/application.yml+.
29
-
30
- - !ruby/object:MIME::Type
31
- content-type: application/xml
32
- encoding: 8bit
33
- extensions:
34
- - xml
35
- - xsl
36
- xrefs: !ruby/hash:MIME::Types::Container
37
- rfc:
38
- - rfc3023
39
- registered: true
40
-
41
- There are other fields that can be added, matching the fields discussed in the
42
- documentation for MIME::Type. Pull requests for MIME types should just contain
43
- the changes to the YAML files for the new or modified MIME types; I will
44
- convert the YAML files to JSON prior to a new release. I would rather not have
45
- to verify that the JSON matches the YAML changes, which is why it is not
46
- necessary to convert for the pull request.
47
-
48
- If you are making a change for a private fork, use <tt>rake
49
- convert:yaml:json</tt> to convert the YAML to JSON, or <tt>rake
50
- convert:yaml:columnar</tt> to convert it to the new columnar format.
51
-
52
- ==== Updating Types from the IANA or Apache Lists
53
-
54
- If you are maintaining a private fork and wish to update your copy of the MIME
55
- types registry used by this gem, you can do this with the rake tasks:
56
-
57
- $ rake mime:iana
58
- $ rake mime:apache
59
-
60
- Both of these require
61
- {Nokogiri}[http://www.nokogiri.org/tutorials/installing_nokogiri.html], which
62
- is not installed by default. Install it in the usual way for your Ruby.
63
-
64
- === Test Dependencies
65
-
66
- mime-types uses Ryan Davis’s {Hoe}[https://github.com/seattlerb/hoe] to manage
67
- the release process, and it adds a number of rake tasks. You will mostly be
68
- interested in:
69
-
70
- $ rake
71
-
72
- which runs the tests the same way that:
73
-
74
- $ rake test
75
- $ rake travis
76
-
77
- will do.
78
-
79
- To assist with the installation of the development dependencies for mime-types,
80
- I have provided the simplest possible Gemfile pointing to the (generated)
81
- +mime-types.gemspec+ file. This will permit you to do:
82
-
83
- $ bundle install
84
-
85
- to get the development dependencies. If you aleady have +hoe+ installed, you
86
- can accomplish the same thing with:
87
-
88
- $ rake newb
89
-
90
- This task will install any missing dependencies, run the tests/specs, and
91
- generate the RDoc.
92
-
93
- You can run tests with code coverage analysis by running:
94
-
95
- $ rake test:coverage
96
-
97
- === Benchmarks
98
-
99
- mime-types offers several benchmark tasks to measure different measures of
100
- performance.
101
-
102
- There is a repeated load test, measuring how long it takes to start and load
103
- mime-types with its full registry. By default, it runs fifty loops and uses the
104
- built-in benchmark library.
105
-
106
- $ rake benchmark:load
107
-
108
- There are two allocation tracing benchmarks (for normal and columnar loads).
109
- These can only be run on Ruby 2.1 or better and requires the
110
- {allocation_tracer}[https://github.com/ko1/allocation_tracer] gem (not
111
- installed by default).
112
-
113
- $ rake benchmark:allocations
114
- $ rake benchmark:allocations:columnar
115
-
116
- There are two loaded object count benchmarks (for normal and columnar loads).
117
- These use <tt>ObjectSpace.count_objects</tt>.
118
-
119
- $ rake benchmark:objects
120
- $ rake benchmark:objects:columnar
121
-
122
- === Workflow
123
-
124
- Here's the most direct way to get your work merged into the project:
125
-
126
- * Fork the project.
127
- * Clone down your fork (<tt>git clone git://github.com/<username>/ruby-mime-types.git</tt>).
128
- * Create a topic branch to contain your change (<tt>git checkout -b my\_awesome\_feature</tt>).
129
- * Hack away, add tests. Not necessarily in that order.
130
- * Make sure everything still passes by running +rake+.
131
- * If necessary, rebase your commits into logical chunks, without errors.
132
- * Push the branch up (<tt>git push origin my\_awesome\_feature</tt>).
133
- * Create a pull request against mime-types/ruby-mime-types and describe what
134
- your change does and the why you think it should be merged.
135
-
136
- === Contributors
137
-
138
- * Austin Ziegler created mime-types.
139
-
140
- Thanks to everyone else who has contributed to mime-types:
141
-
142
- * Aaron Patterson
143
- * Aggelos Avgerinos
144
- * Andre Pankratz
145
- * Andy Brody
146
- * Arnaud Meuret
147
- * Brandon Galbraith
148
- * Chris Gat
149
- * David Genord
150
- * Eric Marden
151
- * Garret Alfert
152
- * Godfrey Chan
153
- * Greg Brockman
154
- * Hans de Graaff
155
- * Henrik Hodne
156
- * Jeremy Evans
157
- * Juanito Fatas
158
- * Łukasz Śliwa
159
- * Keerthi Siva
160
- * Ken Ip
161
- * Martin d'Allens
162
- * Mauricio Linhares
163
- * nycvotes-dev
164
- * Postmodern
165
- * Richard Hirner
166
- * Richard Hurt
167
- * Richard Schneeman
168
- * Tao Guo
169
- * Tibor Szolár
170
- * Todd Carrico