mime-types-data 3.2016.0521 → 3.2022.0105
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Code-of-Conduct.md +22 -22
- data/Contributing.md +156 -72
- data/History.md +461 -310
- data/Licence.md +9 -10
- data/Manifest.txt +16 -0
- data/README.md +38 -26
- data/Rakefile +114 -39
- data/data/content_type_mime.db +878 -0
- data/data/ext_mime.db +1198 -0
- data/data/mime-types.json +1 -1
- data/data/mime.content_type.column +432 -13
- data/data/mime.docs.column +419 -0
- data/data/mime.encoding.column +419 -0
- data/data/mime.flags.column +2383 -1964
- data/data/mime.friendly.column +419 -0
- data/data/mime.pext.column +419 -0
- data/data/mime.use_instead.column +420 -1
- data/data/mime.xrefs.column +567 -148
- data/lib/mime/types/data.rb +2 -2
- data/lib/mime-types-data.rb +1 -1
- data/types/application.yaml +17299 -0
- data/types/audio.yaml +1716 -0
- data/types/chemical.yaml +71 -0
- data/types/conference.yaml +9 -0
- data/types/drawing.yaml +15 -0
- data/types/font.yaml +65 -0
- data/types/image.yaml +1252 -0
- data/types/message.yaml +205 -0
- data/types/model.yaml +390 -0
- data/types/multipart.yaml +179 -0
- data/types/provisional-standard-types.yaml +145 -0
- data/types/text.yaml +1166 -0
- data/types/video.yaml +1121 -0
- data/types/world.yaml +8 -0
- metadata +86 -25
data/Licence.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
## Licence
|
2
2
|
|
3
|
-
|
3
|
+
- Copyright 2003–2021 Austin Ziegler and other 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
@@ -5,6 +5,8 @@ Licence.md
|
|
5
5
|
Manifest.txt
|
6
6
|
README.md
|
7
7
|
Rakefile
|
8
|
+
data/content_type_mime.db
|
9
|
+
data/ext_mime.db
|
8
10
|
data/mime-types.json
|
9
11
|
data/mime.content_type.column
|
10
12
|
data/mime.docs.column
|
@@ -16,3 +18,17 @@ data/mime.use_instead.column
|
|
16
18
|
data/mime.xrefs.column
|
17
19
|
lib/mime-types-data.rb
|
18
20
|
lib/mime/types/data.rb
|
21
|
+
types/application.yaml
|
22
|
+
types/audio.yaml
|
23
|
+
types/chemical.yaml
|
24
|
+
types/conference.yaml
|
25
|
+
types/drawing.yaml
|
26
|
+
types/font.yaml
|
27
|
+
types/image.yaml
|
28
|
+
types/message.yaml
|
29
|
+
types/model.yaml
|
30
|
+
types/multipart.yaml
|
31
|
+
types/provisional-standard-types.yaml
|
32
|
+
types/text.yaml
|
33
|
+
types/video.yaml
|
34
|
+
types/world.yaml
|
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# mime-types-data
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
- home :: https://github.com/mime-types/mime-types-data/
|
4
|
+
- code :: https://github.com/mime-types/mime-types-data/
|
5
|
+
- issues :: https://github.com/mime-types/mime-types-data/issues
|
6
6
|
|
7
7
|
## Description
|
8
8
|
|
@@ -24,18 +24,29 @@ contributions. It conforms to RFCs 2045 and 2231.
|
|
24
24
|
|
25
25
|
### Data Formats Supported in this Registry
|
26
26
|
|
27
|
-
This registry contains the MIME media types in
|
27
|
+
This registry contains the MIME media types in four formats:
|
28
28
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
29
|
+
- A YAML format matching the Ruby mime-types library objects (MIME::Type).
|
30
|
+
This is the primary user-editable format for developers. It is _not_
|
31
|
+
shipped with the gem due to size considerations.
|
32
|
+
- A JSON format converted from the YAML format. Prior to Ruby mime-types 3.0,
|
33
|
+
this was the main consumption format and is still recommended for any
|
34
|
+
implementation that does not wish to implement the columnar format, which
|
35
|
+
has a significant implementation effort cost.
|
36
|
+
- An encoded text format splitting the data for each MIME type across
|
37
|
+
multiple files. This columnar data format reduces the minimal data load
|
38
|
+
substantially, resulting in a performance improvement at the cost of more
|
39
|
+
complex code for loading the data on-demand. This is the default format for
|
40
|
+
Ruby mime-types 3.0.
|
41
|
+
- An encoded text format for use with [`mini_mime`][] (as of 3.2021.1108). This
|
42
|
+
can be enabled with:
|
43
|
+
|
44
|
+
```ruby
|
45
|
+
MiniMime::Configuration.ext_db_path =
|
46
|
+
File.join(MIME::Types::Data::PATH, "ext_mime.db")
|
47
|
+
MiniMime::Configuration.content_type_db_path =
|
48
|
+
File.join(MIME::Types::Data::PATH, "content_type_mime.db")
|
49
|
+
```
|
39
50
|
|
40
51
|
## mime-types-data Modified Semantic Versioning
|
41
52
|
|
@@ -43,19 +54,20 @@ mime-types-data uses a heavily modified [Semantic Versioning][] scheme to
|
|
43
54
|
indicate that the data formats compatibility based on a `SCHEMA` version and
|
44
55
|
the date of the data update: `SCHEMA.YEAR.MONTHDAY`.
|
45
56
|
|
46
|
-
1.
|
47
|
-
|
48
|
-
|
57
|
+
1. If an incompatible data format change is made to any of the supported
|
58
|
+
formts, `SCHEMA` will be incremented. The current `SCHEMA` is 3, supporting
|
59
|
+
the YAML, JSON, and columnar formats required for Ruby mime-types 3.0.
|
49
60
|
|
50
|
-
2.
|
51
|
-
|
52
|
-
|
61
|
+
2. When the data is updated, the `YEAR.MONTHDAY` combination will be updated.
|
62
|
+
An update on the last day of October 2015 would be written as `2015.1031`,
|
63
|
+
resulting in the full version of `3.2015.1031`.
|
53
64
|
|
54
|
-
3.
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
65
|
+
3. If multiple versions of the data need to be released on the same day due to
|
66
|
+
error, there will be an additional `REVISION` field incremented on the end
|
67
|
+
of the version. Thus, if three revisions need to be published on October
|
68
|
+
31st, 2015, the last release would be `3.2015.1031.2` (remember that the
|
69
|
+
first release has an implied `0`.)
|
59
70
|
|
60
71
|
[registry]: https://www.iana.org/assignments/media-types/media-types.xhtml
|
61
|
-
[
|
72
|
+
[semantic versioning]: http://semver.org/
|
73
|
+
[`mini_mime`]: https://github.com/discourse/mini_mime
|
data/Rakefile
CHANGED
@@ -1,80 +1,155 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
5
|
-
require
|
3
|
+
require "rubygems"
|
4
|
+
require "hoe"
|
5
|
+
require "rake/clean"
|
6
6
|
|
7
7
|
Hoe.plugin :doofus
|
8
8
|
Hoe.plugin :gemspec2
|
9
9
|
Hoe.plugin :git
|
10
10
|
Hoe.plugin :travis
|
11
|
-
Hoe.plugin :email unless ENV[
|
11
|
+
Hoe.plugin :email unless ENV["CI"] || ENV["TRAVIS"]
|
12
12
|
|
13
|
-
Hoe.spec
|
14
|
-
developer(
|
13
|
+
Hoe.spec "mime-types-data" do
|
14
|
+
developer("Austin Ziegler", "halostatue@gmail.com")
|
15
15
|
|
16
|
-
require_ruby_version
|
16
|
+
require_ruby_version ">= 2.0"
|
17
17
|
|
18
|
-
self.history_file =
|
19
|
-
self.readme_file =
|
18
|
+
self.history_file = "History.md"
|
19
|
+
self.readme_file = "README.md"
|
20
20
|
|
21
|
-
license
|
21
|
+
license "MIT"
|
22
22
|
|
23
|
-
extra_dev_deps << [
|
24
|
-
extra_dev_deps << [
|
25
|
-
extra_dev_deps << [
|
26
|
-
extra_dev_deps << [
|
27
|
-
extra_dev_deps << [
|
28
|
-
extra_dev_deps << [
|
29
|
-
extra_dev_deps << [
|
23
|
+
extra_dev_deps << ["nokogiri", "~> 1.6"]
|
24
|
+
extra_dev_deps << ["hoe-doofus", "~> 1.0"]
|
25
|
+
extra_dev_deps << ["hoe-gemspec2", "~> 1.1"]
|
26
|
+
extra_dev_deps << ["hoe-git", "~> 1.6"]
|
27
|
+
extra_dev_deps << ["hoe-rubygems", "~> 1.0"]
|
28
|
+
extra_dev_deps << ["rake", ">= 10.0", "< 14"]
|
29
|
+
extra_dev_deps << ["mime-types", ">= 3.4.0", "< 4"]
|
30
|
+
extra_dev_deps << ["standardrb", "~> 1.0"]
|
31
|
+
extra_dev_deps << ["psych", "~> 3.0"]
|
30
32
|
end
|
31
33
|
|
32
|
-
$LOAD_PATH.unshift
|
33
|
-
$LOAD_PATH.unshift
|
34
|
+
$LOAD_PATH.unshift "lib"
|
35
|
+
$LOAD_PATH.unshift "support"
|
36
|
+
|
37
|
+
def new_version
|
38
|
+
version =
|
39
|
+
IO.read("lib/mime/types/data.rb").scan(/VERSION = ['"](\d\.\d{4}\.\d{4})['"]/).flatten.first
|
40
|
+
|
41
|
+
major = Gem::Version.new(version).canonical_segments.first
|
42
|
+
minor = Date.today.strftime("%Y.%m%d")
|
43
|
+
|
44
|
+
"#{major}.#{minor}"
|
45
|
+
end
|
46
|
+
|
47
|
+
def release_header
|
48
|
+
"#{new_version} / #{Date.today.strftime("%Y-%m-%d")}"
|
49
|
+
end
|
34
50
|
|
35
51
|
namespace :mime do
|
36
|
-
desc
|
37
|
-
task :iana, [
|
38
|
-
require
|
52
|
+
desc "Download the current MIME type registrations from IANA."
|
53
|
+
task :iana, [:destination] do |_, args|
|
54
|
+
require "iana_registry"
|
39
55
|
IANARegistry.download(to: args.destination)
|
40
56
|
end
|
41
57
|
|
42
|
-
desc
|
43
|
-
task :apache, [
|
44
|
-
require
|
58
|
+
desc "Download the current MIME type configuration from Apache."
|
59
|
+
task :apache, [:destination] do |_, args|
|
60
|
+
require "apache_mime_types"
|
45
61
|
ApacheMIMETypes.download(to: args.destination)
|
46
62
|
end
|
47
63
|
end
|
48
64
|
|
65
|
+
namespace :release do
|
66
|
+
task __pull: %w[mime:apache mime:iana convert]
|
67
|
+
task __prepare: %w[update:version update:history git:manifest]
|
68
|
+
task :__commit do
|
69
|
+
history = IO.read("History.md")
|
70
|
+
message = history.scan(%r{## (#{release_header}.+?)## \d\.\d{4}\.\d{4} /}m).flatten.first
|
71
|
+
|
72
|
+
IO.popen("git commit -a -F -", "w") { |commit|
|
73
|
+
commit.puts message
|
74
|
+
}
|
75
|
+
end
|
76
|
+
|
77
|
+
desc "Prepare a new automatic release"
|
78
|
+
task automatic: :__pull do
|
79
|
+
if system("git diff --quiet --exit-code") == false
|
80
|
+
Rake::Task["release:__prepare"].invoke
|
81
|
+
Rake::Task["gemspec"].invoke
|
82
|
+
Rake::Task["release:__commit"].invoke
|
83
|
+
else
|
84
|
+
warn "No changes detected."
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
49
89
|
namespace :convert do
|
50
90
|
namespace :yaml do
|
51
|
-
desc
|
52
|
-
task :json, [
|
53
|
-
require
|
91
|
+
desc "Convert from YAML to JSON"
|
92
|
+
task :json, [:source, :destination, :multiple_files] => :support do |_, args|
|
93
|
+
require "convert"
|
54
94
|
Convert.from_yaml_to_json(args)
|
55
95
|
end
|
56
96
|
|
57
|
-
desc
|
58
|
-
task :columnar, [
|
59
|
-
require
|
97
|
+
desc "Convert from YAML to Columnar"
|
98
|
+
task :columnar, [:source, :destination] => :support do |_, args|
|
99
|
+
require "convert/columnar"
|
60
100
|
Convert::Columnar.from_yaml_to_columnar(args)
|
61
101
|
end
|
102
|
+
|
103
|
+
desc "Convert from YAML to mini_mime db format"
|
104
|
+
task :mini_mime, [:source, :destination] => :support do |_, args|
|
105
|
+
require "convert/mini_mime_db"
|
106
|
+
Convert::MiniMimeDb.from_yaml_to_mini_mime(args)
|
107
|
+
end
|
62
108
|
end
|
63
109
|
|
64
110
|
namespace :json do
|
65
|
-
desc
|
66
|
-
task :yaml, [
|
67
|
-
require
|
111
|
+
desc "Convert from JSON to YAML"
|
112
|
+
task :yaml, [:source, :destination, :multiple_files] => :support do |_, args|
|
113
|
+
require "convert"
|
68
114
|
Convert.from_json_to_yaml(args)
|
69
115
|
end
|
70
116
|
end
|
71
117
|
end
|
72
118
|
|
73
|
-
|
74
|
-
|
119
|
+
namespace :update do
|
120
|
+
desc "Update the release version"
|
121
|
+
task :version do
|
122
|
+
file = IO.read("lib/mime/types/data.rb")
|
123
|
+
updated = file.sub(/VERSION = ['"][.0-9]+['"]/, %Q(VERSION = "#{new_version}"))
|
124
|
+
|
125
|
+
IO.write("lib/mime/types/data.rb", updated)
|
126
|
+
end
|
127
|
+
|
128
|
+
desc "Update the history file with automatic release notes"
|
129
|
+
task :history do
|
130
|
+
history = IO.read("History.md")
|
131
|
+
|
132
|
+
if !/^## #{release_header}$/.match?(history)
|
133
|
+
note = <<-NOTE
|
134
|
+
<!-- automatic-release -->
|
135
|
+
|
136
|
+
## #{release_header}
|
137
|
+
|
138
|
+
- Updated the Apache and IANA media registry entries as of release date.
|
139
|
+
NOTE
|
140
|
+
|
141
|
+
updated = history.sub(/<!-- automatic-release -->\n/, note)
|
142
|
+
|
143
|
+
IO.write("History.md", updated)
|
144
|
+
end
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
148
|
+
desc "Default conversion from YAML to JSON and Columnar"
|
149
|
+
task convert: ["convert:yaml:json", "convert:yaml:columnar", "convert:yaml:mini_mime"]
|
75
150
|
|
76
|
-
Rake::Task[
|
77
|
-
Rake::Task[
|
78
|
-
Rake::Task[
|
151
|
+
Rake::Task["gem"].prerequisites.unshift("convert")
|
152
|
+
Rake::Task["gem"].prerequisites.unshift("git:manifest")
|
153
|
+
Rake::Task["gem"].prerequisites.unshift("gemspec")
|
79
154
|
|
80
155
|
# vim: syntax=ruby
|