mime-types 3.3 → 3.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Contributing.md +2 -0
- data/History.md +17 -0
- data/README.rdoc +1 -8
- data/lib/mime/type.rb +3 -3
- data/lib/mime/type/columnar.rb +1 -1
- data/lib/mime/types/container.rb +9 -9
- data/lib/mime/types/logger.rb +1 -1
- data/test/test_mime_type.rb +9 -9
- data/test/test_mime_types.rb +14 -14
- data/test/test_mime_types_class.rb +2 -2
- data/test/test_mime_types_loader.rb +1 -1
- metadata +11 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 727050c60daa98ccb85692629f83999009ca6d6cd259e15ceebdaf524da14c0a
|
4
|
+
data.tar.gz: 28a5af3883b49bd685f35cd84247dbe3c6894d5cca8417c212d3bb0d261b23d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb64be5b69ac765df59ea4ae0fd17f549263107c59878954e3613b44519a73eacfe00f2e28e0369452afe1a4c4846a98a5f59402d559a7b3acf9de78388bff4a
|
7
|
+
data.tar.gz: 1141d794103db9810da89504387f56caa84e704f523197072393855a8f9a89e474b52794d9de6a09d750634711446ce4731971a13fbe642a32f58e5f7f27b0fb
|
data/Contributing.md
CHANGED
@@ -99,6 +99,7 @@ Thanks to everyone else who has contributed to mime-types over the years:
|
|
99
99
|
|
100
100
|
* Aaron Patterson
|
101
101
|
* Aggelos Avgerinos
|
102
|
+
* Al Snow
|
102
103
|
* Andre Pankratz
|
103
104
|
* Andy Brody
|
104
105
|
* Arnaud Meuret
|
@@ -127,6 +128,7 @@ Thanks to everyone else who has contributed to mime-types over the years:
|
|
127
128
|
* Nicolas Leger
|
128
129
|
* Nicholas La Roux
|
129
130
|
* nycvotes-dev
|
131
|
+
* Olle Jonsson
|
130
132
|
* Postmodern
|
131
133
|
* Richard Hirner
|
132
134
|
* Richard Hurt
|
data/History.md
CHANGED
@@ -1,3 +1,18 @@
|
|
1
|
+
## 3.3.1 / 2019-12-26
|
2
|
+
|
3
|
+
* 1 minor bugfix:
|
4
|
+
|
5
|
+
* Al Snow fixed a warning with MIME::Types::Logger producing a warning
|
6
|
+
because Ruby 2.7 introduces numbered block parameters. Because of the
|
7
|
+
way that the MIME::Types::Logger works for deprecation messages, the
|
8
|
+
initializer parameters had been named `_1`, `_2`, and `_3`. This has
|
9
|
+
now been resolved. [#146][]
|
10
|
+
|
11
|
+
* Administrivia:
|
12
|
+
|
13
|
+
* Olle Jonsson removed an outdated Travis configuration option (`sudo:
|
14
|
+
false`). [#142][]
|
15
|
+
|
1
16
|
## 3.3 / 2019-09-04
|
2
17
|
|
3
18
|
* 1 minor enhancement
|
@@ -218,6 +233,8 @@
|
|
218
233
|
[#137]: https://github.com/mime-types/ruby-mime-types/pull/137
|
219
234
|
[#139]: https://github.com/mime-types/ruby-mime-types/pull/139
|
220
235
|
[#141]: https://github.com/mime-types/ruby-mime-types/pull/141
|
236
|
+
[#142]: https://github.com/mime-types/ruby-mime-types/pull/142
|
237
|
+
[#146]: https://github.com/mime-types/ruby-mime-types/pull/146
|
221
238
|
[Code-of-Conduct.md]: Code-of-Conduct_md.html
|
222
239
|
[Contributor Covenant]: http://contributor-covenant.org
|
223
240
|
[mime-types-data]: https://github.com/mime-types/mime-types-data
|
data/README.rdoc
CHANGED
@@ -4,6 +4,7 @@ home :: https://github.com/mime-types/ruby-mime-types/
|
|
4
4
|
code :: https://github.com/mime-types/ruby-mime-types/
|
5
5
|
bugs :: https://github.com/mime-types/ruby-mime-types/issues
|
6
6
|
rdoc :: http://rdoc.info/gems/mime-types/
|
7
|
+
clog :: https://github.com/mime-types/ruby-mime-types/blob/master/History.md
|
7
8
|
continuous integration :: {<img src="https://travis-ci.org/mime-types/ruby-mime-types.svg?branch=master" alt="Build Status" />}[https://travis-ci.org/mime-types/ruby-mime-types]
|
8
9
|
test coverage :: {<img src="https://coveralls.io/repos/mime-types/ruby-mime-types/badge.svg?branch=master&service=github" alt="Coverage Status" />}[https://coveralls.io/github/mime-types/ruby-mime-types?branch=master]
|
9
10
|
|
@@ -35,14 +36,6 @@ recommendations, the {IANA Media Types
|
|
35
36
|
registry}[https://www.iana.org/assignments/media-types/media-types.xhtml], and
|
36
37
|
user contributions. It conforms to RFCs 2045 and 2231.
|
37
38
|
|
38
|
-
=== mime-types 1.x End of Life
|
39
|
-
|
40
|
-
mime-types 1.x is no longer supported as of 2015-10-27.
|
41
|
-
|
42
|
-
=== mime-types 2.x End of Life
|
43
|
-
|
44
|
-
mime-types 2.x is no longer supported as of 2017-11-21.
|
45
|
-
|
46
39
|
=== mime-types 3.x
|
47
40
|
|
48
41
|
Users are encouraged to upgrade to mime-types 3.x as soon as is practical.
|
data/lib/mime/type.rb
CHANGED
@@ -57,7 +57,7 @@ class MIME::Type
|
|
57
57
|
end
|
58
58
|
|
59
59
|
# The released version of the mime-types library.
|
60
|
-
VERSION = '3.3'
|
60
|
+
VERSION = '3.3.1'
|
61
61
|
|
62
62
|
include Comparable
|
63
63
|
|
@@ -71,7 +71,7 @@ class MIME::Type
|
|
71
71
|
# :startdoc:
|
72
72
|
|
73
73
|
private_constant :MEDIA_TYPE_RE, :I18N_RE, :BINARY_ENCODINGS,
|
74
|
-
|
74
|
+
:ASCII_ENCODINGS
|
75
75
|
|
76
76
|
# Builds a MIME::Type object from the +content_type+, a MIME Content Type
|
77
77
|
# value (e.g., 'text/plain' or 'applicaton/x-eruby'). The constructed object
|
@@ -343,7 +343,7 @@ class MIME::Type
|
|
343
343
|
@friendly.update(lang)
|
344
344
|
else
|
345
345
|
fail ArgumentError,
|
346
|
-
|
346
|
+
"Expected a language or translation set, not #{lang.inspect}"
|
347
347
|
end
|
348
348
|
end
|
349
349
|
|
data/lib/mime/type/columnar.rb
CHANGED
@@ -36,7 +36,7 @@ class MIME::Type::Columnar < MIME::Type
|
|
36
36
|
column :docs, :docs=
|
37
37
|
column :preferred_extension, :preferred_extension=
|
38
38
|
column :obsolete, :obsolete=, :obsolete?, :registered, :registered=,
|
39
|
-
|
39
|
+
:registered?, :signature, :signature=, :signature?, file: 'flags'
|
40
40
|
column :xrefs, :xrefs=, :xref_urls
|
41
41
|
column :use_instead, :use_instead=
|
42
42
|
|
data/lib/mime/types/container.rb
CHANGED
@@ -48,15 +48,15 @@ class MIME::Types::Container #:nodoc:
|
|
48
48
|
end
|
49
49
|
|
50
50
|
def_delegators :@container,
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
51
|
+
:==,
|
52
|
+
:count,
|
53
|
+
:each,
|
54
|
+
:each_value,
|
55
|
+
:empty?,
|
56
|
+
:flat_map,
|
57
|
+
:keys,
|
58
|
+
:select,
|
59
|
+
:values
|
60
60
|
|
61
61
|
def add(key, value)
|
62
62
|
(container[key] ||= Set.new).add(value)
|
data/lib/mime/types/logger.rb
CHANGED
data/test/test_mime_type.rb
CHANGED
@@ -46,15 +46,15 @@ describe MIME::Type do
|
|
46
46
|
|
47
47
|
it 'does not remove x- prefixes by default' do
|
48
48
|
assert_equal 'application/x-msword',
|
49
|
-
|
49
|
+
MIME::Type.simplified('application/x-msword')
|
50
50
|
assert_equal 'x-xyz/abc', MIME::Type.simplified('x-xyz/abc')
|
51
51
|
end
|
52
52
|
|
53
53
|
it 'removes x- prefixes when requested' do
|
54
54
|
assert_equal 'application/msword',
|
55
|
-
|
55
|
+
MIME::Type.simplified('application/x-msword', remove_x_prefix: true)
|
56
56
|
assert_equal 'xyz/abc',
|
57
|
-
|
57
|
+
MIME::Type.simplified('x-xyz/abc', remove_x_prefix: true)
|
58
58
|
end
|
59
59
|
|
60
60
|
it 'lowercases mixed-case types' do
|
@@ -73,7 +73,7 @@ describe MIME::Type do
|
|
73
73
|
|
74
74
|
it 'does not remove x-prefixes' do
|
75
75
|
assert_equal 'application.x-msword',
|
76
|
-
|
76
|
+
MIME::Type.i18n_key('application/x-msword')
|
77
77
|
end
|
78
78
|
|
79
79
|
it 'converts text/vCard to text.vcard' do
|
@@ -436,12 +436,12 @@ describe MIME::Type do
|
|
436
436
|
|
437
437
|
it 'has the extensions key if set' do
|
438
438
|
assert_has_keys mime_type(t) { |v| v.extensions = 'a' }.to_h,
|
439
|
-
|
439
|
+
'extensions'
|
440
440
|
end
|
441
441
|
|
442
442
|
it 'has the preferred-extension key if set' do
|
443
443
|
assert_has_keys mime_type(t) { |v| v.preferred_extension = 'a' }.to_h,
|
444
|
-
|
444
|
+
'preferred-extension'
|
445
445
|
end
|
446
446
|
|
447
447
|
it 'has the obsolete key if set' do
|
@@ -472,7 +472,7 @@ describe MIME::Type do
|
|
472
472
|
|
473
473
|
describe '#to_s, #to_str' do
|
474
474
|
it 'represents itself as a string of the canonical content_type' do
|
475
|
-
assert_equal 'text/plain',
|
475
|
+
assert_equal 'text/plain', text_plain.to_s
|
476
476
|
end
|
477
477
|
|
478
478
|
it 'acts like a string of the canonical content_type for comparison' do
|
@@ -587,7 +587,7 @@ describe MIME::Type do
|
|
587
587
|
assert_equal expected, text_plain.friendly(['en', 'Text files'])
|
588
588
|
expected.update('fr' => 'des fichiers texte')
|
589
589
|
assert_equal expected,
|
590
|
-
|
590
|
+
text_plain.friendly(['fr', 'des fichiers texte'])
|
591
591
|
end
|
592
592
|
|
593
593
|
it 'merges new values from a hash parameter' do
|
@@ -604,7 +604,7 @@ describe MIME::Type do
|
|
604
604
|
end
|
605
605
|
|
606
606
|
assert_equal 'Expected a language or translation set, not 1',
|
607
|
-
|
607
|
+
exception.message
|
608
608
|
end
|
609
609
|
end
|
610
610
|
end
|
data/test/test_mime_types.rb
CHANGED
@@ -7,18 +7,18 @@ describe MIME::Types do
|
|
7
7
|
def mime_types
|
8
8
|
@mime_types ||= MIME::Types.new.tap { |mt|
|
9
9
|
mt.add MIME::Type.new(['text/plain', %w(txt)]),
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
10
|
+
MIME::Type.new(['image/jpeg', %w(jpg jpeg)]),
|
11
|
+
MIME::Type.new('application/x-wordperfect6.1'),
|
12
|
+
MIME::Type.new(
|
13
|
+
'content-type' => 'application/x-www-form-urlencoded',
|
14
|
+
'registered' => true
|
15
|
+
),
|
16
|
+
MIME::Type.new(['application/x-gzip', %w(gz)]),
|
17
|
+
MIME::Type.new(
|
18
|
+
'content-type' => 'application/gzip',
|
19
|
+
'extensions' => 'gz',
|
20
|
+
'registered' => true
|
21
|
+
)
|
22
22
|
}
|
23
23
|
end
|
24
24
|
|
@@ -136,7 +136,7 @@ describe MIME::Types do
|
|
136
136
|
describe '#type_for' do
|
137
137
|
it 'finds all types for a given extension' do
|
138
138
|
assert_equal %w(application/gzip application/x-gzip),
|
139
|
-
|
139
|
+
mime_types.type_for('gz')
|
140
140
|
end
|
141
141
|
|
142
142
|
it 'separates the extension from filenames' do
|
@@ -145,7 +145,7 @@ describe MIME::Types do
|
|
145
145
|
|
146
146
|
it 'finds multiple extensions' do
|
147
147
|
assert_equal %w(image/jpeg text/plain),
|
148
|
-
|
148
|
+
mime_types.type_for(%w(foo.txt foo.jpeg))
|
149
149
|
end
|
150
150
|
|
151
151
|
it 'does not find unknown extensions' do
|
@@ -79,7 +79,7 @@ describe MIME::Types, 'registry' do
|
|
79
79
|
describe '.type_for' do
|
80
80
|
it 'finds all types for a given extension' do
|
81
81
|
assert_equal %w(application/gzip application/x-gzip),
|
82
|
-
|
82
|
+
MIME::Types.type_for('gz')
|
83
83
|
end
|
84
84
|
|
85
85
|
it 'separates the extension from filenames' do
|
@@ -88,7 +88,7 @@ describe MIME::Types, 'registry' do
|
|
88
88
|
|
89
89
|
it 'finds multiple extensions' do
|
90
90
|
assert_equal %w(image/jpeg text/plain),
|
91
|
-
|
91
|
+
MIME::Types.type_for(%w(foo.txt foo.jpeg))
|
92
92
|
end
|
93
93
|
|
94
94
|
it 'does not find unknown extensions' do
|
@@ -16,7 +16,7 @@ describe MIME::Types::Loader do
|
|
16
16
|
refute(types['audio/webm'].first.registered?)
|
17
17
|
|
18
18
|
assert_equal('Fixes a bug with IE6 and progressive JPEGs',
|
19
|
-
|
19
|
+
types['image/pjpeg'].first.docs)
|
20
20
|
|
21
21
|
assert(types['audio/vnd.qcelp'].first.obsolete?)
|
22
22
|
assert_equal('audio/QCELP', types['audio/vnd.qcelp'].first.use_instead)
|
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:
|
4
|
+
version: 3.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Austin Ziegler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-12-26 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.
|
33
|
+
version: '5.13'
|
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.
|
40
|
+
version: '5.13'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: hoe-doofus
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -252,14 +252,14 @@ dependencies:
|
|
252
252
|
requirements:
|
253
253
|
- - "~>"
|
254
254
|
- !ruby/object:Gem::Version
|
255
|
-
version: '3.
|
255
|
+
version: '3.20'
|
256
256
|
type: :development
|
257
257
|
prerelease: false
|
258
258
|
version_requirements: !ruby/object:Gem::Requirement
|
259
259
|
requirements:
|
260
260
|
- - "~>"
|
261
261
|
- !ruby/object:Gem::Version
|
262
|
-
version: '3.
|
262
|
+
version: '3.20'
|
263
263
|
description: |-
|
264
264
|
The mime-types library provides a library and registry for information about
|
265
265
|
MIME content type definitions. It can be used to determine defined filename
|
@@ -319,7 +319,11 @@ files:
|
|
319
319
|
homepage: https://github.com/mime-types/ruby-mime-types/
|
320
320
|
licenses:
|
321
321
|
- MIT
|
322
|
-
metadata:
|
322
|
+
metadata:
|
323
|
+
homepage_uri: https://github.com/mime-types/ruby-mime-types/
|
324
|
+
source_code_uri: https://github.com/mime-types/ruby-mime-types/
|
325
|
+
bug_tracker_uri: https://github.com/mime-types/ruby-mime-types/issues
|
326
|
+
changelog_uri: https://github.com/mime-types/ruby-mime-types/blob/master/History.md
|
323
327
|
post_install_message:
|
324
328
|
rdoc_options:
|
325
329
|
- "--main"
|