mime-types 3.6.0 → 3.7.0
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/CHANGELOG.md +413 -0
- data/CONTRIBUTING.md +93 -0
- data/CONTRIBUTORS.md +52 -0
- data/{Licence.md → LICENCE.md} +9 -10
- data/Manifest.txt +8 -6
- data/README.md +200 -0
- data/Rakefile +65 -94
- data/SECURITY.md +7 -0
- data/lib/mime/type/columnar.rb +14 -1
- data/lib/mime/type.rb +116 -55
- data/lib/mime/types/_columnar.rb +52 -5
- data/lib/mime/types/container.rb +43 -13
- data/lib/mime/types/loader.rb +1 -1
- data/lib/mime/types/logger.rb +34 -3
- data/lib/mime/types/version.rb +14 -0
- data/lib/mime/types.rb +20 -10
- data/test/minitest_helper.rb +3 -3
- data/test/test_mime_type.rb +32 -34
- data/test/test_mime_types.rb +10 -5
- data/test/test_mime_types_class.rb +10 -4
- metadata +50 -98
- data/.standard.yml +0 -4
- data/Contributing.md +0 -133
- data/History.md +0 -353
- data/README.rdoc +0 -195
- /data/{Code-of-Conduct.md → CODE_OF_CONDUCT.md} +0 -0
data/test/test_mime_type.rb
CHANGED
@@ -175,11 +175,6 @@ describe MIME::Type do
|
|
175
175
|
refute_equal text_plain, "text/html"
|
176
176
|
assert_operator text_plain, :>, "text/html"
|
177
177
|
end
|
178
|
-
|
179
|
-
it "correctly compares against nil" do
|
180
|
-
refute_equal text_html, nil
|
181
|
-
assert_operator text_plain, :<, nil
|
182
|
-
end
|
183
178
|
end
|
184
179
|
|
185
180
|
describe "#ascii?" do
|
@@ -326,41 +321,56 @@ describe MIME::Type do
|
|
326
321
|
end
|
327
322
|
|
328
323
|
describe "#priority_compare" do
|
324
|
+
def priority(type)
|
325
|
+
priority = "OpRceXtN"
|
326
|
+
.chars
|
327
|
+
.zip(("%08b" % type.__sort_priority).chars)
|
328
|
+
.map { |e| e.join(":") }
|
329
|
+
.join(" ")
|
330
|
+
|
331
|
+
"#{type} (#{priority} / #{type.__sort_priority})"
|
332
|
+
end
|
333
|
+
|
329
334
|
def assert_priority_less(left, right)
|
330
|
-
assert_equal(-1, left.priority_compare(right))
|
335
|
+
assert_equal(-1, left.priority_compare(right), "#{priority(left)} is not less than #{priority(right)}")
|
331
336
|
end
|
332
337
|
|
333
338
|
def assert_priority_same(left, right)
|
334
|
-
assert_equal 0, left.priority_compare(right)
|
339
|
+
assert_equal 0, left.priority_compare(right), "#{priority(left)} is not equal to #{priority(right)}"
|
335
340
|
end
|
336
341
|
|
337
342
|
def assert_priority_more(left, right)
|
338
|
-
assert_equal 1, left.priority_compare(right)
|
343
|
+
assert_equal 1, left.priority_compare(right), "#{priority(left)} is not more than #{priority(right)}"
|
339
344
|
end
|
340
345
|
|
341
346
|
def assert_priority(left, middle, right)
|
342
347
|
assert_priority_less left, right
|
343
348
|
assert_priority_same left, middle
|
344
|
-
assert_priority_more right,
|
349
|
+
assert_priority_more right, middle
|
345
350
|
end
|
346
351
|
|
347
352
|
let(:text_1) { mime_type("content-type" => "text/1") }
|
348
353
|
let(:text_1p) { mime_type("content-type" => "text/1") }
|
349
354
|
let(:text_2) { mime_type("content-type" => "text/2") }
|
350
355
|
|
351
|
-
it "sorts
|
356
|
+
it "sorts based on the simplified type when the sort priorities are the same" do
|
352
357
|
assert_priority text_1, text_1p, text_2
|
353
358
|
end
|
354
359
|
|
355
|
-
it "sorts
|
356
|
-
text_1.
|
357
|
-
|
360
|
+
it "sorts obsolete types higher than non-obsolete types" do
|
361
|
+
text_1.obsolete = text_1p.obsolete = false
|
362
|
+
text_1b = mime_type(text_1) { |t| t.obsolete = true }
|
363
|
+
|
364
|
+
assert_priority_less text_1, text_1b
|
358
365
|
|
359
|
-
|
366
|
+
assert_priority text_1, text_1p, text_1b
|
367
|
+
end
|
360
368
|
|
361
|
-
|
369
|
+
it "sorts provisional types higher than non-provisional types" do
|
370
|
+
text_1.provisional = text_1p.provisional = false
|
371
|
+
text_1b = mime_type(text_1) { |t| t.provisional = true }
|
362
372
|
|
363
|
-
|
373
|
+
assert_priority text_1, text_1p, text_1b
|
364
374
|
end
|
365
375
|
|
366
376
|
it "sorts (3) based on the registration state" do
|
@@ -377,23 +387,11 @@ describe MIME::Type do
|
|
377
387
|
assert_priority text_1, text_1p, text_1b
|
378
388
|
end
|
379
389
|
|
380
|
-
it "sorts
|
381
|
-
text_1.
|
382
|
-
|
383
|
-
|
384
|
-
assert_priority text_1, text_1p, text_1b
|
385
|
-
end
|
386
|
-
|
387
|
-
it "sorts (5) based on the use-instead value" do
|
388
|
-
text_1.obsolete = text_1p.obsolete = true
|
389
|
-
text_1.use_instead = text_1p.use_instead = "abc/xyz"
|
390
|
-
text_1b = mime_type(text_1) { |t| t.use_instead = nil }
|
391
|
-
|
392
|
-
assert_priority text_1, text_1p, text_1b
|
393
|
-
|
394
|
-
text_1b.use_instead = "abc/zzz"
|
390
|
+
it "sorts based on extensions (more extensions sort lower)" do
|
391
|
+
text_1.extensions = ["foo", "bar"]
|
392
|
+
text_2.extensions = ["foo"]
|
395
393
|
|
396
|
-
|
394
|
+
assert_priority_less text_1, text_2
|
397
395
|
end
|
398
396
|
end
|
399
397
|
|
@@ -502,10 +500,10 @@ describe MIME::Type do
|
|
502
500
|
|
503
501
|
describe "#to_json" do
|
504
502
|
let(:expected_1) {
|
505
|
-
'{"content-type":"a/b","encoding":"base64","registered":false}'
|
503
|
+
'{"content-type":"a/b","encoding":"base64","registered":false,"sort-priority":48}'
|
506
504
|
}
|
507
505
|
let(:expected_2) {
|
508
|
-
'{"content-type":"a/b","encoding":"base64","registered":true,"provisional":true}'
|
506
|
+
'{"content-type":"a/b","encoding":"base64","registered":true,"provisional":true,"sort-priority":80}'
|
509
507
|
}
|
510
508
|
|
511
509
|
it "converts to JSON when requested" do
|
data/test/test_mime_types.rb
CHANGED
@@ -12,7 +12,8 @@ describe MIME::Types do
|
|
12
12
|
MIME::Type.new("content-type" => "application/x-wordperfect6.1"),
|
13
13
|
MIME::Type.new("content-type" => "application/x-www-form-urlencoded", "registered" => true),
|
14
14
|
MIME::Type.new("content-type" => "application/x-gzip", "extensions" => %w[gz]),
|
15
|
-
MIME::Type.new("content-type" => "application/gzip", "extensions" => "gz", "registered" => true)
|
15
|
+
MIME::Type.new("content-type" => "application/gzip", "extensions" => "gz", "registered" => true),
|
16
|
+
*MIME::Types.type_for("foo.webm")
|
16
17
|
)
|
17
18
|
}
|
18
19
|
end
|
@@ -33,8 +34,8 @@ describe MIME::Types do
|
|
33
34
|
end
|
34
35
|
|
35
36
|
it "is countable with an enumerator" do
|
36
|
-
assert_equal
|
37
|
-
assert_equal
|
37
|
+
assert_equal 8, mime_types.each.count
|
38
|
+
assert_equal 8, mime_types.lazy.count
|
38
39
|
end
|
39
40
|
end
|
40
41
|
|
@@ -139,7 +140,7 @@ describe MIME::Types do
|
|
139
140
|
end
|
140
141
|
|
141
142
|
it "finds multiple extensions" do
|
142
|
-
assert_equal %w[image/jpeg
|
143
|
+
assert_equal %w[text/plain image/jpeg],
|
143
144
|
mime_types.type_for(%w[foo.txt foo.jpeg])
|
144
145
|
end
|
145
146
|
|
@@ -158,11 +159,15 @@ describe MIME::Types do
|
|
158
159
|
it "handles newline characters correctly" do
|
159
160
|
assert_includes mime_types.type_for("test.pdf\n.txt"), "text/plain"
|
160
161
|
end
|
162
|
+
|
163
|
+
it "returns a stable order for types with equal priority" do
|
164
|
+
assert_equal %w[text/x-vcalendar text/x-vcard], MIME::Types[/text\/x-vca/]
|
165
|
+
end
|
161
166
|
end
|
162
167
|
|
163
168
|
describe "#count" do
|
164
169
|
it "can count the number of types inside" do
|
165
|
-
assert_equal
|
170
|
+
assert_equal 8, mime_types.count
|
166
171
|
end
|
167
172
|
end
|
168
173
|
end
|
@@ -47,7 +47,7 @@ describe MIME::Types, "registry" do
|
|
47
47
|
}
|
48
48
|
# This is this way because of a new type ending with gzip that only
|
49
49
|
# appears in some data files.
|
50
|
-
assert_equal %w[application/gzip
|
50
|
+
assert_equal %w[application/gzip multipart/x-gzip application/x-gzip], types
|
51
51
|
assert_equal 3, types.size
|
52
52
|
end
|
53
53
|
|
@@ -86,9 +86,11 @@ describe MIME::Types, "registry" do
|
|
86
86
|
assert_equal %w[image/jpeg], MIME::Types.of(["foo.jpeg", "bar.jpeg"])
|
87
87
|
end
|
88
88
|
|
89
|
-
it "finds multiple extensions" do
|
90
|
-
|
91
|
-
|
89
|
+
it "finds multiple extensions ordered by the filename list" do
|
90
|
+
result = MIME::Types.type_for(%w[foo.txt foo.jpeg])
|
91
|
+
|
92
|
+
# assert_equal %w[text/plain image/jpeg], MIME::Types.type_for(%w[foo.txt foo.jpeg])
|
93
|
+
assert_equal %w[text/plain image/jpeg], result
|
92
94
|
end
|
93
95
|
|
94
96
|
it "does not find unknown extensions" do
|
@@ -105,6 +107,10 @@ describe MIME::Types, "registry" do
|
|
105
107
|
assert_includes MIME::Types.type_for("test.pdf\n.txt"), "text/plain"
|
106
108
|
assert_includes MIME::Types.type_for("test.txt\n.pdf"), "application/pdf"
|
107
109
|
end
|
110
|
+
|
111
|
+
it "returns a stable order for types with equal priority" do
|
112
|
+
assert_equal %w[text/x-vcalendar text/x-vcard], MIME::Types[/text\/x-vca/]
|
113
|
+
end
|
108
114
|
end
|
109
115
|
|
110
116
|
describe ".count" do
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mime-types
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Austin Ziegler
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-05-07 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: mime-types-data
|
@@ -16,14 +15,20 @@ dependencies:
|
|
16
15
|
requirements:
|
17
16
|
- - "~>"
|
18
17
|
- !ruby/object:Gem::Version
|
19
|
-
version: '3.
|
18
|
+
version: '3.2025'
|
19
|
+
- - ">="
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 3.2025.0507
|
20
22
|
type: :runtime
|
21
23
|
prerelease: false
|
22
24
|
version_requirements: !ruby/object:Gem::Requirement
|
23
25
|
requirements:
|
24
26
|
- - "~>"
|
25
27
|
- !ruby/object:Gem::Version
|
26
|
-
version: '3.
|
28
|
+
version: '3.2025'
|
29
|
+
- - ">="
|
30
|
+
- !ruby/object:Gem::Version
|
31
|
+
version: 3.2025.0507
|
27
32
|
- !ruby/object:Gem::Dependency
|
28
33
|
name: logger
|
29
34
|
requirement: !ruby/object:Gem::Requirement
|
@@ -38,96 +43,62 @@ dependencies:
|
|
38
43
|
- - ">="
|
39
44
|
- !ruby/object:Gem::Version
|
40
45
|
version: '0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: minitest
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '5.25'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '5.25'
|
55
46
|
- !ruby/object:Gem::Dependency
|
56
47
|
name: hoe
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ">="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '3.0'
|
62
|
-
- - "<"
|
63
|
-
- !ruby/object:Gem::Version
|
64
|
-
version: '5'
|
65
|
-
type: :development
|
66
|
-
prerelease: false
|
67
|
-
version_requirements: !ruby/object:Gem::Requirement
|
68
|
-
requirements:
|
69
|
-
- - ">="
|
70
|
-
- !ruby/object:Gem::Version
|
71
|
-
version: '3.0'
|
72
|
-
- - "<"
|
73
|
-
- !ruby/object:Gem::Version
|
74
|
-
version: '5'
|
75
|
-
- !ruby/object:Gem::Dependency
|
76
|
-
name: hoe-doofus
|
77
48
|
requirement: !ruby/object:Gem::Requirement
|
78
49
|
requirements:
|
79
50
|
- - "~>"
|
80
51
|
- !ruby/object:Gem::Version
|
81
|
-
version: '
|
52
|
+
version: '4.0'
|
82
53
|
type: :development
|
83
54
|
prerelease: false
|
84
55
|
version_requirements: !ruby/object:Gem::Requirement
|
85
56
|
requirements:
|
86
57
|
- - "~>"
|
87
58
|
- !ruby/object:Gem::Version
|
88
|
-
version: '
|
59
|
+
version: '4.0'
|
89
60
|
- !ruby/object:Gem::Dependency
|
90
|
-
name: hoe-
|
61
|
+
name: hoe-halostatue
|
91
62
|
requirement: !ruby/object:Gem::Requirement
|
92
63
|
requirements:
|
93
64
|
- - "~>"
|
94
65
|
- !ruby/object:Gem::Version
|
95
|
-
version: '
|
66
|
+
version: '2.0'
|
96
67
|
type: :development
|
97
68
|
prerelease: false
|
98
69
|
version_requirements: !ruby/object:Gem::Requirement
|
99
70
|
requirements:
|
100
71
|
- - "~>"
|
101
72
|
- !ruby/object:Gem::Version
|
102
|
-
version: '
|
73
|
+
version: '2.0'
|
103
74
|
- !ruby/object:Gem::Dependency
|
104
|
-
name: hoe-
|
75
|
+
name: hoe-rubygems
|
105
76
|
requirement: !ruby/object:Gem::Requirement
|
106
77
|
requirements:
|
107
78
|
- - "~>"
|
108
79
|
- !ruby/object:Gem::Version
|
109
|
-
version: '1.
|
80
|
+
version: '1.0'
|
110
81
|
type: :development
|
111
82
|
prerelease: false
|
112
83
|
version_requirements: !ruby/object:Gem::Requirement
|
113
84
|
requirements:
|
114
85
|
- - "~>"
|
115
86
|
- !ruby/object:Gem::Version
|
116
|
-
version: '1.
|
87
|
+
version: '1.0'
|
117
88
|
- !ruby/object:Gem::Dependency
|
118
|
-
name:
|
89
|
+
name: minitest
|
119
90
|
requirement: !ruby/object:Gem::Requirement
|
120
91
|
requirements:
|
121
92
|
- - "~>"
|
122
93
|
- !ruby/object:Gem::Version
|
123
|
-
version: '
|
94
|
+
version: '5.0'
|
124
95
|
type: :development
|
125
96
|
prerelease: false
|
126
97
|
version_requirements: !ruby/object:Gem::Requirement
|
127
98
|
requirements:
|
128
99
|
- - "~>"
|
129
100
|
- !ruby/object:Gem::Version
|
130
|
-
version: '
|
101
|
+
version: '5.0'
|
131
102
|
- !ruby/object:Gem::Dependency
|
132
103
|
name: minitest-autotest
|
133
104
|
requirement: !ruby/object:Gem::Requirement
|
@@ -179,7 +150,7 @@ dependencies:
|
|
179
150
|
version: '10.0'
|
180
151
|
- - "<"
|
181
152
|
- !ruby/object:Gem::Version
|
182
|
-
version: '14
|
153
|
+
version: '14'
|
183
154
|
type: :development
|
184
155
|
prerelease: false
|
185
156
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -189,55 +160,35 @@ dependencies:
|
|
189
160
|
version: '10.0'
|
190
161
|
- - "<"
|
191
162
|
- !ruby/object:Gem::Version
|
192
|
-
version: '14
|
193
|
-
- !ruby/object:Gem::Dependency
|
194
|
-
name: standard
|
195
|
-
requirement: !ruby/object:Gem::Requirement
|
196
|
-
requirements:
|
197
|
-
- - "~>"
|
198
|
-
- !ruby/object:Gem::Version
|
199
|
-
version: '1.0'
|
200
|
-
type: :development
|
201
|
-
prerelease: false
|
202
|
-
version_requirements: !ruby/object:Gem::Requirement
|
203
|
-
requirements:
|
204
|
-
- - "~>"
|
205
|
-
- !ruby/object:Gem::Version
|
206
|
-
version: '1.0'
|
163
|
+
version: '14'
|
207
164
|
- !ruby/object:Gem::Dependency
|
208
165
|
name: rdoc
|
209
166
|
requirement: !ruby/object:Gem::Requirement
|
210
167
|
requirements:
|
211
168
|
- - ">="
|
212
169
|
- !ruby/object:Gem::Version
|
213
|
-
version: '
|
214
|
-
- - "<"
|
215
|
-
- !ruby/object:Gem::Version
|
216
|
-
version: '7'
|
170
|
+
version: '0.0'
|
217
171
|
type: :development
|
218
172
|
prerelease: false
|
219
173
|
version_requirements: !ruby/object:Gem::Requirement
|
220
174
|
requirements:
|
221
175
|
- - ">="
|
222
176
|
- !ruby/object:Gem::Version
|
223
|
-
version: '
|
224
|
-
- - "<"
|
225
|
-
- !ruby/object:Gem::Version
|
226
|
-
version: '7'
|
177
|
+
version: '0.0'
|
227
178
|
- !ruby/object:Gem::Dependency
|
228
|
-
name:
|
179
|
+
name: standard
|
229
180
|
requirement: !ruby/object:Gem::Requirement
|
230
181
|
requirements:
|
231
182
|
- - "~>"
|
232
183
|
- !ruby/object:Gem::Version
|
233
|
-
version: '0
|
184
|
+
version: '1.0'
|
234
185
|
type: :development
|
235
186
|
prerelease: false
|
236
187
|
version_requirements: !ruby/object:Gem::Requirement
|
237
188
|
requirements:
|
238
189
|
- - "~>"
|
239
190
|
- !ruby/object:Gem::Version
|
240
|
-
version: '0
|
191
|
+
version: '1.0'
|
241
192
|
description: |-
|
242
193
|
The mime-types library provides a library and registry for information about
|
243
194
|
MIME content type definitions. It can be used to determine defined filename
|
@@ -247,30 +198,32 @@ description: |-
|
|
247
198
|
Version 3.0 is a major release that requires Ruby 2.0 compatibility and removes
|
248
199
|
deprecated functions. The columnar registry format introduced in 2.6 has been
|
249
200
|
made the primary format; the registry data has been extracted from this library
|
250
|
-
and put into
|
251
|
-
|
252
|
-
|
253
|
-
changes described in the History file.
|
201
|
+
and put into [mime-types-data][data]. Additionally, mime-types is now licensed
|
202
|
+
exclusively under the MIT licence and there is a code of conduct in effect.
|
203
|
+
There are a number of other smaller changes described in the History file.
|
254
204
|
email:
|
255
205
|
- halostatue@gmail.com
|
256
206
|
executables: []
|
257
207
|
extensions: []
|
258
208
|
extra_rdoc_files:
|
259
|
-
-
|
260
|
-
-
|
261
|
-
-
|
262
|
-
-
|
209
|
+
- CHANGELOG.md
|
210
|
+
- CODE_OF_CONDUCT.md
|
211
|
+
- CONTRIBUTING.md
|
212
|
+
- CONTRIBUTORS.md
|
213
|
+
- LICENCE.md
|
263
214
|
- Manifest.txt
|
264
|
-
- README.
|
215
|
+
- README.md
|
216
|
+
- SECURITY.md
|
265
217
|
files:
|
266
|
-
-
|
267
|
-
-
|
268
|
-
-
|
269
|
-
-
|
270
|
-
-
|
218
|
+
- CHANGELOG.md
|
219
|
+
- CODE_OF_CONDUCT.md
|
220
|
+
- CONTRIBUTING.md
|
221
|
+
- CONTRIBUTORS.md
|
222
|
+
- LICENCE.md
|
271
223
|
- Manifest.txt
|
272
|
-
- README.
|
224
|
+
- README.md
|
273
225
|
- Rakefile
|
226
|
+
- SECURITY.md
|
274
227
|
- lib/mime-types.rb
|
275
228
|
- lib/mime/type.rb
|
276
229
|
- lib/mime/type/columnar.rb
|
@@ -284,6 +237,7 @@ files:
|
|
284
237
|
- lib/mime/types/loader.rb
|
285
238
|
- lib/mime/types/logger.rb
|
286
239
|
- lib/mime/types/registry.rb
|
240
|
+
- lib/mime/types/version.rb
|
287
241
|
- test/bad-fixtures/malformed
|
288
242
|
- test/fixture/json.json
|
289
243
|
- test/fixture/old-data
|
@@ -300,14 +254,13 @@ licenses:
|
|
300
254
|
- MIT
|
301
255
|
metadata:
|
302
256
|
homepage_uri: https://github.com/mime-types/ruby-mime-types/
|
303
|
-
source_code_uri: https://github.com/mime-types/ruby-mime-types/
|
304
257
|
bug_tracker_uri: https://github.com/mime-types/ruby-mime-types/issues
|
305
|
-
|
258
|
+
source_code_uri: https://github.com/mime-types/ruby-mime-types/
|
259
|
+
changelog_uri: https://github.com/mime-types/ruby-mime-types/blob/main/CHANGELOG.md
|
306
260
|
rubygems_mfa_required: 'true'
|
307
|
-
post_install_message:
|
308
261
|
rdoc_options:
|
309
262
|
- "--main"
|
310
|
-
- README.
|
263
|
+
- README.md
|
311
264
|
require_paths:
|
312
265
|
- lib
|
313
266
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -321,8 +274,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
321
274
|
- !ruby/object:Gem::Version
|
322
275
|
version: '0'
|
323
276
|
requirements: []
|
324
|
-
rubygems_version: 3.
|
325
|
-
signing_key:
|
277
|
+
rubygems_version: 3.6.6
|
326
278
|
specification_version: 4
|
327
279
|
summary: The mime-types library provides a library and registry for information about
|
328
280
|
MIME content type definitions
|
data/.standard.yml
DELETED
data/Contributing.md
DELETED
@@ -1,133 +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][].
|
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][].
|
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 no longer contained in mime-types, but in
|
22
|
-
[mime-types-data][]. Please see that project for contributions there.
|
23
|
-
|
24
|
-
### Test Dependencies
|
25
|
-
|
26
|
-
mime-types uses Ryan Davis’s [Hoe][] to manage the release process, and it adds
|
27
|
-
a number of rake tasks. You will mostly be interested in `rake`, which runs the
|
28
|
-
tests the same way that `rake test` will do.
|
29
|
-
|
30
|
-
To assist with the installation of the development dependencies for
|
31
|
-
mime-types, I have provided the simplest possible Gemfile pointing to the
|
32
|
-
(generated) `mime-types.gemspec` file. This will permit you to do `bundle install` to get the development dependencies. If you already have `hoe`
|
33
|
-
installed, you can accomplish the same thing with `rake newb`.
|
34
|
-
|
35
|
-
This task will install any missing dependencies, run the tests/specs, and
|
36
|
-
generate the RDoc.
|
37
|
-
|
38
|
-
You can run tests with code coverage analysis by running `rake test:coverage`.
|
39
|
-
|
40
|
-
## Benchmarks
|
41
|
-
|
42
|
-
mime-types offers several benchmark tasks to measure different measures of
|
43
|
-
performance.
|
44
|
-
|
45
|
-
There is a repeated load test, measuring how long it takes to start and load
|
46
|
-
mime-types with its full registry. By default, it runs fifty loops and uses the
|
47
|
-
built-in benchmark library:
|
48
|
-
|
49
|
-
- `rake benchmark:load`
|
50
|
-
|
51
|
-
There are two allocation tracing benchmarks (for normal and columnar loads).
|
52
|
-
These can only be run on Ruby 2.1 or better and requires the
|
53
|
-
[allocation\_tracer][] gem (not installed by default).
|
54
|
-
|
55
|
-
- `rake benchmark:allocations`
|
56
|
-
- `rake benchmark:allocations:columnar`
|
57
|
-
|
58
|
-
There are two loaded object count benchmarks (for normal and columnar loads).
|
59
|
-
These use `ObjectSpace.count_objects`.
|
60
|
-
|
61
|
-
- `rake benchmark:objects`
|
62
|
-
- `rake benchmark:objects:columnar`
|
63
|
-
|
64
|
-
## Workflow
|
65
|
-
|
66
|
-
Here's the most direct way to get your work merged into the project:
|
67
|
-
|
68
|
-
- Fork the project.
|
69
|
-
- Clone down your fork (`git clone git://github.com/<username>/ruby-mime-types.git`).
|
70
|
-
- Create a topic branch to contain your change (`git checkout -b my_awesome_feature`).
|
71
|
-
- Hack away, add tests. Not necessarily in that order.
|
72
|
-
- Make sure everything still passes by running `rake`.
|
73
|
-
- If necessary, rebase your commits into logical chunks, without errors.
|
74
|
-
- Push the branch up (`git push origin my_awesome_feature`).
|
75
|
-
- Create a pull request against mime-types/ruby-mime-types and describe what
|
76
|
-
your change does and the why you think it should be merged.
|
77
|
-
|
78
|
-
## Contributors
|
79
|
-
|
80
|
-
- Austin Ziegler created mime-types.
|
81
|
-
|
82
|
-
Thanks to everyone else who has contributed to mime-types over the years:
|
83
|
-
|
84
|
-
- Aaron Patterson
|
85
|
-
- Aggelos Avgerinos
|
86
|
-
- Al Snow
|
87
|
-
- Alex Vondrak
|
88
|
-
- Andre Pankratz
|
89
|
-
- Andy Brody
|
90
|
-
- Arnaud Meuret
|
91
|
-
- Brandon Galbraith
|
92
|
-
- Burke Libbey
|
93
|
-
- Chris Gat
|
94
|
-
- David Genord
|
95
|
-
- Dillon Welch
|
96
|
-
- Edward Betts
|
97
|
-
- Eric Marden
|
98
|
-
- Garret Alfert
|
99
|
-
- Godfrey Chan
|
100
|
-
- Greg Brockman
|
101
|
-
- Hans de Graaff
|
102
|
-
- Henrik Hodne
|
103
|
-
- Igor Victor
|
104
|
-
- Janko Marohnić
|
105
|
-
- Jean Boussier
|
106
|
-
- Jeremy Evans
|
107
|
-
- Juanito Fatas
|
108
|
-
- Jun Aruga
|
109
|
-
- Keerthi Siva
|
110
|
-
- Ken Ip
|
111
|
-
- Kevin Menard
|
112
|
-
- Koichi ITO
|
113
|
-
- Łukasz Śliwa
|
114
|
-
- Martin d'Allens
|
115
|
-
- Masato Nakamura
|
116
|
-
- Mauricio Linhares
|
117
|
-
- Nicholas La Roux
|
118
|
-
- Nicolas Leger
|
119
|
-
- nycvotes-dev
|
120
|
-
- Olle Jonsson
|
121
|
-
- Postmodern
|
122
|
-
- Richard Hirner
|
123
|
-
- Richard Hurt
|
124
|
-
- Richard Schneeman
|
125
|
-
- Robb Shecter
|
126
|
-
- Tibor Szolár
|
127
|
-
- Todd Carrico
|
128
|
-
|
129
|
-
[minitest]: https://github.com/seattlerb/minitest
|
130
|
-
[quality commit messages]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
|
131
|
-
[mime-types-data]: https://github.com/mime-types/mime-types-data
|
132
|
-
[hoe]: https://github.com/seattlerb/hoe
|
133
|
-
[allocation\_tracer]: https://github.com/ko1/allocation_tracer
|