mime-types-data 3.2021.0225 → 3.2022.0105
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 +12 -12
- data/Contributing.md +37 -20
- data/History.md +46 -12
- data/Licence.md +9 -10
- data/Manifest.txt +3 -0
- data/README.md +11 -1
- data/Rakefile +68 -72
- 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 +69 -1
- data/data/mime.docs.column +68 -0
- data/data/mime.encoding.column +68 -0
- data/data/mime.flags.column +2383 -2315
- data/data/mime.friendly.column +68 -0
- data/data/mime.pext.column +68 -0
- data/data/mime.use_instead.column +71 -3
- data/data/mime.xrefs.column +98 -30
- data/lib/mime/types/data.rb +2 -2
- data/lib/mime-types-data.rb +1 -1
- data/types/application.yaml +390 -24
- data/types/audio.yaml +2 -0
- data/types/image.yaml +4 -3
- data/types/message.yaml +9 -4
- data/types/model.yaml +59 -0
- data/types/multipart.yaml +2 -2
- data/types/provisional-standard-types.yaml +145 -0
- data/types/text.yaml +24 -3
- data/types/video.yaml +27 -0
- metadata +38 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 329d601098ccd4e2d3978e6e323230a2ae19d2349f869711d899207c19b16994
|
4
|
+
data.tar.gz: 1dedab8c410c72bb0c84cb089000b87003a026ac109b9bf7cac165b102720fac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c2c164f48716aebc3caed14a571f783aea3397cb218b6bc494c960561304a593a8e13c7f6362e1d9abd900c3c6b7752fa2cc8bdae6fb41681178fa3186dddbe
|
7
|
+
data.tar.gz: 3272473043d3359581c716e0fff76225219302573f7a1c31c7755b6fce7a4ad40aa0f183889e55f61fb043133562ba2e682b214cb2843df5340bc5ad50b3b8a3
|
data/Code-of-Conduct.md
CHANGED
@@ -4,10 +4,10 @@
|
|
4
4
|
|
5
5
|
In the interest of fostering an open and welcoming environment, we as
|
6
6
|
contributors and maintainers pledge to making participation in our project and
|
7
|
-
our community a harassment-free experience for everyone, regardless of age,
|
8
|
-
|
9
|
-
experience, nationality, personal appearance, race, religion, or sexual
|
10
|
-
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of
|
9
|
+
experience, nationality, personal appearance, race, religion, or sexual identity
|
10
|
+
and orientation.
|
11
11
|
|
12
12
|
## Our Standards
|
13
13
|
|
@@ -37,20 +37,20 @@ Project maintainers are responsible for clarifying the standards of acceptable
|
|
37
37
|
behavior and are expected to take appropriate and fair corrective action in
|
38
38
|
response to any instances of unacceptable behavior.
|
39
39
|
|
40
|
-
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or reject
|
41
|
+
comments, commits, code, wiki edits, issues, and other contributions that are
|
42
|
+
not aligned to this Code of Conduct, or to ban temporarily or permanently any
|
43
|
+
contributor for other behaviors that they deem inappropriate, threatening,
|
44
|
+
offensive, or harmful.
|
45
45
|
|
46
46
|
## Scope
|
47
47
|
|
48
48
|
This Code of Conduct applies both within project spaces and in public spaces
|
49
49
|
when an individual is representing the project or its community. Examples of
|
50
50
|
representing a project or community include using an official project e-mail
|
51
|
-
address, posting via an official social media account, or acting as an
|
52
|
-
|
53
|
-
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
54
|
|
55
55
|
## Enforcement
|
56
56
|
|
data/Contributing.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
## Contributing
|
2
2
|
|
3
3
|
Contributions to mime-types-data is encouraged in any form: a bug report, new
|
4
|
-
MIME type
|
4
|
+
MIME type definitions, or additional code to help manage the MIME types. As with
|
5
5
|
many of my projects, I have a few suggestions for improving the chance of
|
6
6
|
acceptance of your code contributions:
|
7
7
|
|
@@ -26,12 +26,12 @@ other languages.
|
|
26
26
|
The Ruby mime-types gem loads its data from files encoded in the `data`
|
27
27
|
directory in this gem by loading `mime-types-data` and reading
|
28
28
|
MIME::Types::Data::PATH. These files are compiled files from the collection of
|
29
|
-
data in the `types` directory. Pull requests that include changes to these
|
30
|
-
|
29
|
+
data in the `types` directory. Pull requests that include changes to these files
|
30
|
+
will require amendment to revert these files.
|
31
31
|
|
32
32
|
New or modified MIME types should be edited in the appropriate YAML file under
|
33
|
-
`types`. The format is as shown below for the `application/xml` MIME type
|
34
|
-
|
33
|
+
`types`. The format is as shown below for the `application/xml` MIME type in
|
34
|
+
`types/application.yml`.
|
35
35
|
|
36
36
|
```yaml
|
37
37
|
- !ruby/object:MIME::Type
|
@@ -43,7 +43,7 @@ in `types/application.yml`.
|
|
43
43
|
references:
|
44
44
|
- IANA
|
45
45
|
- RFC3023
|
46
|
-
xrefs:
|
46
|
+
xrefs:
|
47
47
|
rfc:
|
48
48
|
- rfc3023
|
49
49
|
registered: true
|
@@ -51,10 +51,10 @@ in `types/application.yml`.
|
|
51
51
|
|
52
52
|
There are other fields that can be added, matching the fields discussed in the
|
53
53
|
documentation for MIME::Type. Pull requests for MIME types should just contain
|
54
|
-
the changes to the YAML files for the new or modified MIME types; I will
|
55
|
-
|
56
|
-
|
57
|
-
|
54
|
+
the changes to the YAML files for the new or modified MIME types; I will convert
|
55
|
+
the YAML files to JSON prior to a new release. I would rather not have to verify
|
56
|
+
that the JSON matches the YAML changes, which is why it is not necessary to
|
57
|
+
convert for the pull request.
|
58
58
|
|
59
59
|
If you are making a change for a private fork, use `rake convert:yaml:json` to
|
60
60
|
convert the YAML to JSON, or `rake convert:yaml:columnar` to convert it to the
|
@@ -70,6 +70,21 @@ $ rake mime:iana
|
|
70
70
|
$ rake mime:apache
|
71
71
|
```
|
72
72
|
|
73
|
+
##### A Note on Provisional Types
|
74
|
+
|
75
|
+
The file `types/provisional-standard-types.yaml` contains the provisionally
|
76
|
+
registered types from IANA. Per IANA,
|
77
|
+
|
78
|
+
> This registry, unlike some other provisional IANA registries, is only for
|
79
|
+
> temporary use. Entries in this registry are either finalized and moved to the
|
80
|
+
> main media types registry or are abandoned and deleted. Entries in this
|
81
|
+
> registry are suitable for use for development and test purposes only.
|
82
|
+
|
83
|
+
The provisional types file is rewritten when updated, so pull requests to
|
84
|
+
manually promote or customize provisional types (such as with extensions). It is
|
85
|
+
recommended that any updates required to the data be performed in your
|
86
|
+
application if you require provisional types.
|
87
|
+
|
73
88
|
### Development Dependencies
|
74
89
|
|
75
90
|
mime-types-data uses Ryan Davis’s {Hoe}[https://github.com/seattlerb/hoe] to
|
@@ -132,10 +147,10 @@ Here's the most direct way to get your work merged into the project:
|
|
132
147
|
The release process needs automation; as it includes generating code and
|
133
148
|
committing to the repository, it is not clear how this will happen safely.
|
134
149
|
|
135
|
-
1. Review any outstanding issues or pull requests to see if anything needs to
|
136
|
-
|
137
|
-
|
138
|
-
|
150
|
+
1. Review any outstanding issues or pull requests to see if anything needs to be
|
151
|
+
addressed. This is necessary because there is currently no automated source
|
152
|
+
for extensions for the thousands of MIME entries. (Suggestions and/or pull
|
153
|
+
requests for same would be deeply appreciated.)
|
139
154
|
2. `bundle install`
|
140
155
|
3. `bundle exec rake mime:apache`
|
141
156
|
4. `bundle exec rake mime:iana`
|
@@ -145,18 +160,18 @@ committing to the repository, it is not clear how this will happen safely.
|
|
145
160
|
category.)
|
146
161
|
6. `bundle exec rake convert`
|
147
162
|
7. `bundle exec rake update:version`
|
148
|
-
8. Write up the changes in History.md. If any PRs have been merged, these
|
149
|
-
|
163
|
+
8. Write up the changes in History.md. If any PRs have been merged, these should
|
164
|
+
be noted specifically.
|
150
165
|
9. Commit the changes and push to GitHub.
|
151
166
|
10. `bundle exec rake release VERSION=newversion`
|
152
167
|
|
153
168
|
### Automating the Release
|
154
169
|
|
155
|
-
If anyone wishes to provide suggestions on automation, this would be a
|
156
|
-
|
170
|
+
If anyone wishes to provide suggestions on automation, this would be a two-phase
|
171
|
+
process:
|
157
172
|
|
158
|
-
1. A system would need to periodically create PRs to the GitHub repository
|
159
|
-
|
173
|
+
1. A system would need to periodically create PRs to the GitHub repository with
|
174
|
+
the output of the following commands (steps 2, 3, and 4):
|
160
175
|
|
161
176
|
```sh
|
162
177
|
bundle install
|
@@ -198,6 +213,8 @@ Thanks to everyone else who has contributed to mime-types:
|
|
198
213
|
- Henrik Hodne
|
199
214
|
- Jeremy Evans
|
200
215
|
- John Gardner
|
216
|
+
- Jon Sneyers
|
217
|
+
- Jonas Petersen
|
201
218
|
- Juanito Fatas
|
202
219
|
- Keerthi Siva
|
203
220
|
- Ken Ip
|
data/History.md
CHANGED
@@ -2,11 +2,39 @@
|
|
2
2
|
|
3
3
|
<!-- automatic-release -->
|
4
4
|
|
5
|
+
## 3.2022.0105 / 2022-01-05
|
6
|
+
|
7
|
+
- Updated the Apache and IANA media registry entries as of release date.
|
8
|
+
|
9
|
+
- Fixed an incorrect definition of `image/bmp`, which had been marked obsolete
|
10
|
+
and later registered. Fixed [#48], found by William T. Nelson.
|
11
|
+
|
12
|
+
## 3.2021.1115 / 2021-11-15
|
13
|
+
|
14
|
+
- Updated the Apache and IANA media registry entries as of release date.
|
15
|
+
|
16
|
+
- Added conversion utilities that support the `mini_mime` data format. These
|
17
|
+
have been ported from the [mini_mime] repository. [#47]
|
18
|
+
|
19
|
+
- Added IANA provisional media registries. Added some notes to Contributing.md
|
20
|
+
about the transient nature of the provisional registration data. This was
|
21
|
+
triggered in part by a pull request by Jon Sneyers. Thanks! [#45], [#43]
|
22
|
+
|
23
|
+
## 3.2021.0901 / 2021-09-01
|
24
|
+
|
25
|
+
- Updated the Apache and IANA media registry entries as of release date.
|
26
|
+
|
27
|
+
- Added file extension for WebVTT text format. [#46]
|
28
|
+
|
29
|
+
## 3.2021.0704 / 2021-07-04
|
30
|
+
|
31
|
+
- Updated the Apache and IANA media registry entries as of release date.
|
32
|
+
|
5
33
|
## 3.2021.0225 / 2021-02-25
|
6
34
|
|
7
35
|
- Updated the Apache and IANA media registry entries as of release date.
|
8
36
|
|
9
|
-
- Added file extension for AVIF video format. [#40]
|
37
|
+
- Added file extension for AVIF video format. [#40]
|
10
38
|
|
11
39
|
## 3.2021.0212 / 2021-02-12
|
12
40
|
|
@@ -21,47 +49,47 @@
|
|
21
49
|
|
22
50
|
- Updated the IANA media registry entries as of release date.
|
23
51
|
|
24
|
-
- Added `application/x-zip-compressed`. [#36]
|
52
|
+
- Added `application/x-zip-compressed`. [#36]
|
25
53
|
|
26
54
|
- Updated the contributing guide to include information about the release
|
27
|
-
process as described in [#18]
|
55
|
+
process as described in [#18]
|
28
56
|
|
29
|
-
- Corrected a misspelling of Yoran Brondsema’s name. Sorry, Yoran. [#35]
|
57
|
+
- Corrected a misspelling of Yoran Brondsema’s name. Sorry, Yoran. [#35]
|
30
58
|
|
31
59
|
## 3.2020.0512 / 2020-05-12
|
32
60
|
|
33
61
|
- Updated the IANA media registry entries as of release date.
|
34
62
|
|
35
|
-
- Added file extensions for HEIC image types. [#34]
|
63
|
+
- Added file extensions for HEIC image types. [#34]
|
36
64
|
|
37
65
|
## 3.2020.0425 / 2020-04-25
|
38
66
|
|
39
67
|
- Updated the IANA media registry entries as of release date.
|
40
68
|
|
41
69
|
- Added several RAW image types based on data from GNOME RAW Thumbnailer.
|
42
|
-
[#33] fixing [#32]
|
70
|
+
[#33] fixing [#32]
|
43
71
|
|
44
|
-
- Added `audio/wav`. [#31]
|
72
|
+
- Added `audio/wav`. [#31]
|
45
73
|
|
46
|
-
- Added a type for Smarttech notebook files. [#30]
|
74
|
+
- Added a type for Smarttech notebook files. [#30]
|
47
75
|
|
48
|
-
- Added an alias for audio/m4a files. [#29]
|
76
|
+
- Added an alias for audio/m4a files. [#29]
|
49
77
|
|
50
|
-
- Added application/x-ms-dos-executable. [#28]
|
78
|
+
- Added application/x-ms-dos-executable. [#28]
|
51
79
|
|
52
80
|
## 3.2019.1009 / 2019-10-09
|
53
81
|
|
54
82
|
- Updated the IANA media registry entries as of release date.
|
55
83
|
|
56
84
|
- Reordered the `.ai` extension so that it is not the preferred extension for
|
57
|
-
`application/pdf` [#24]
|
85
|
+
`application/pdf` [#24]
|
58
86
|
|
59
87
|
## 3.2019.0904 / 2019-09-04
|
60
88
|
|
61
89
|
- Updated the IANA media registry entries as of release date.
|
62
90
|
|
63
91
|
- Moved the `.ai` extension from `application/postscript` to `application/pdf`.
|
64
|
-
[#23] fixing [#22]
|
92
|
+
[#23] fixing [#22]
|
65
93
|
|
66
94
|
## 3.2019.0331 / 2019-03-31
|
67
95
|
|
@@ -464,5 +492,11 @@
|
|
464
492
|
[#35]: https://github.com/mime-types/mime-types-data/pull/35
|
465
493
|
[#36]: https://github.com/mime-types/mime-types-data/pull/36
|
466
494
|
[#40]: https://github.com/mime-types/mime-types-data/pull/40
|
495
|
+
[#43]: https://github.com/mime-types/mime-types-data/pull/43
|
496
|
+
[#45]: https://github.com/mime-types/mime-types-data/pull/45
|
497
|
+
[#46]: https://github.com/mime-types/mime-types-data/pull/46
|
498
|
+
[#47]: https://github.com/mime-types/mime-types-data/pull/47
|
499
|
+
[#48]: https://github.com/mime-types/mime-types-data/issues/48
|
467
500
|
[rmt]: https://github.com/mime-types/ruby-mime-types
|
468
501
|
[code of conduct]: Code-of-Conduct.md
|
502
|
+
[mini_mime]: https://github.com/discourse/mini_mime/issues/41
|
data/Licence.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
## Licence
|
2
2
|
|
3
|
-
- Copyright 2003–
|
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
|
@@ -26,6 +28,7 @@ types/image.yaml
|
|
26
28
|
types/message.yaml
|
27
29
|
types/model.yaml
|
28
30
|
types/multipart.yaml
|
31
|
+
types/provisional-standard-types.yaml
|
29
32
|
types/text.yaml
|
30
33
|
types/video.yaml
|
31
34
|
types/world.yaml
|
data/README.md
CHANGED
@@ -24,7 +24,7 @@ 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
29
|
- A YAML format matching the Ruby mime-types library objects (MIME::Type).
|
30
30
|
This is the primary user-editable format for developers. It is _not_
|
@@ -38,6 +38,15 @@ This registry contains the MIME media types in three formats:
|
|
38
38
|
substantially, resulting in a performance improvement at the cost of more
|
39
39
|
complex code for loading the data on-demand. This is the default format for
|
40
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
|
+
```
|
41
50
|
|
42
51
|
## mime-types-data Modified Semantic Versioning
|
43
52
|
|
@@ -61,3 +70,4 @@ the date of the data update: `SCHEMA.YEAR.MONTHDAY`.
|
|
61
70
|
|
62
71
|
[registry]: https://www.iana.org/assignments/media-types/media-types.xhtml
|
63
72
|
[semantic versioning]: http://semver.org/
|
73
|
+
[`mini_mime`]: https://github.com/discourse/mini_mime
|
data/Rakefile
CHANGED
@@ -1,139 +1,135 @@
|
|
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"
|
34
36
|
|
35
37
|
def new_version
|
36
38
|
version =
|
37
|
-
IO.read(
|
39
|
+
IO.read("lib/mime/types/data.rb").scan(/VERSION = ['"](\d\.\d{4}\.\d{4})['"]/).flatten.first
|
38
40
|
|
39
41
|
major = Gem::Version.new(version).canonical_segments.first
|
40
|
-
minor = Date.today.strftime(
|
42
|
+
minor = Date.today.strftime("%Y.%m%d")
|
41
43
|
|
42
44
|
"#{major}.#{minor}"
|
43
45
|
end
|
44
46
|
|
45
47
|
def release_header
|
46
|
-
"#{new_version} / #{Date.today.strftime(
|
48
|
+
"#{new_version} / #{Date.today.strftime("%Y-%m-%d")}"
|
47
49
|
end
|
48
50
|
|
49
51
|
namespace :mime do
|
50
|
-
desc
|
51
|
-
task :iana, [
|
52
|
-
require
|
52
|
+
desc "Download the current MIME type registrations from IANA."
|
53
|
+
task :iana, [:destination] do |_, args|
|
54
|
+
require "iana_registry"
|
53
55
|
IANARegistry.download(to: args.destination)
|
54
56
|
end
|
55
57
|
|
56
|
-
desc
|
57
|
-
task :apache, [
|
58
|
-
require
|
58
|
+
desc "Download the current MIME type configuration from Apache."
|
59
|
+
task :apache, [:destination] do |_, args|
|
60
|
+
require "apache_mime_types"
|
59
61
|
ApacheMIMETypes.download(to: args.destination)
|
60
62
|
end
|
61
63
|
end
|
62
64
|
|
63
65
|
namespace :release do
|
64
|
-
task __pull: %w
|
65
|
-
task __prepare: %w
|
66
|
+
task __pull: %w[mime:apache mime:iana convert]
|
67
|
+
task __prepare: %w[update:version update:history git:manifest]
|
66
68
|
task :__commit do
|
67
|
-
history = IO.read(
|
69
|
+
history = IO.read("History.md")
|
68
70
|
message = history.scan(%r{## (#{release_header}.+?)## \d\.\d{4}\.\d{4} /}m).flatten.first
|
69
71
|
|
70
|
-
IO.popen(
|
72
|
+
IO.popen("git commit -a -F -", "w") { |commit|
|
71
73
|
commit.puts message
|
72
74
|
}
|
73
75
|
end
|
74
76
|
|
75
|
-
desc
|
77
|
+
desc "Prepare a new automatic release"
|
76
78
|
task automatic: :__pull do
|
77
|
-
if system(
|
78
|
-
Rake::Task[
|
79
|
-
Rake::Task[
|
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
|
80
83
|
else
|
81
|
-
warn
|
84
|
+
warn "No changes detected."
|
82
85
|
end
|
83
|
-
|
84
|
-
# file = IO.read('History.md')
|
85
|
-
# note = <<-NOTE
|
86
|
-
# <!-- automatic-release -->
|
87
|
-
|
88
|
-
# ## #{new_version} / #{Date.today.strftime('%Y-%m-%d')}
|
89
|
-
|
90
|
-
# - Updated the IANA media registry entries as of release date.
|
91
|
-
# NOTE
|
92
|
-
|
93
|
-
# updated = file.sub(/<!-- automatic-release -->\n/, note)
|
94
|
-
|
95
|
-
# IO.write('History.md', updated)
|
96
86
|
end
|
97
87
|
end
|
98
88
|
|
99
89
|
namespace :convert do
|
100
90
|
namespace :yaml do
|
101
|
-
desc
|
102
|
-
task :json, [
|
103
|
-
require
|
91
|
+
desc "Convert from YAML to JSON"
|
92
|
+
task :json, [:source, :destination, :multiple_files] => :support do |_, args|
|
93
|
+
require "convert"
|
104
94
|
Convert.from_yaml_to_json(args)
|
105
95
|
end
|
106
96
|
|
107
|
-
desc
|
108
|
-
task :columnar, [
|
109
|
-
require
|
97
|
+
desc "Convert from YAML to Columnar"
|
98
|
+
task :columnar, [:source, :destination] => :support do |_, args|
|
99
|
+
require "convert/columnar"
|
110
100
|
Convert::Columnar.from_yaml_to_columnar(args)
|
111
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
|
112
108
|
end
|
113
109
|
|
114
110
|
namespace :json do
|
115
|
-
desc
|
116
|
-
task :yaml, [
|
117
|
-
require
|
111
|
+
desc "Convert from JSON to YAML"
|
112
|
+
task :yaml, [:source, :destination, :multiple_files] => :support do |_, args|
|
113
|
+
require "convert"
|
118
114
|
Convert.from_json_to_yaml(args)
|
119
115
|
end
|
120
116
|
end
|
121
117
|
end
|
122
118
|
|
123
119
|
namespace :update do
|
124
|
-
desc
|
120
|
+
desc "Update the release version"
|
125
121
|
task :version do
|
126
|
-
file = IO.read(
|
127
|
-
updated = file.sub(/VERSION =
|
122
|
+
file = IO.read("lib/mime/types/data.rb")
|
123
|
+
updated = file.sub(/VERSION = ['"][.0-9]+['"]/, %Q(VERSION = "#{new_version}"))
|
128
124
|
|
129
|
-
IO.write(
|
125
|
+
IO.write("lib/mime/types/data.rb", updated)
|
130
126
|
end
|
131
127
|
|
132
|
-
desc
|
128
|
+
desc "Update the history file with automatic release notes"
|
133
129
|
task :history do
|
134
|
-
history = IO.read(
|
130
|
+
history = IO.read("History.md")
|
135
131
|
|
136
|
-
if
|
132
|
+
if !/^## #{release_header}$/.match?(history)
|
137
133
|
note = <<-NOTE
|
138
134
|
<!-- automatic-release -->
|
139
135
|
|
@@ -144,16 +140,16 @@ namespace :update do
|
|
144
140
|
|
145
141
|
updated = history.sub(/<!-- automatic-release -->\n/, note)
|
146
142
|
|
147
|
-
IO.write(
|
143
|
+
IO.write("History.md", updated)
|
148
144
|
end
|
149
145
|
end
|
150
146
|
end
|
151
147
|
|
152
|
-
desc
|
153
|
-
task convert: [
|
148
|
+
desc "Default conversion from YAML to JSON and Columnar"
|
149
|
+
task convert: ["convert:yaml:json", "convert:yaml:columnar", "convert:yaml:mini_mime"]
|
154
150
|
|
155
|
-
Rake::Task[
|
156
|
-
Rake::Task[
|
157
|
-
Rake::Task[
|
151
|
+
Rake::Task["gem"].prerequisites.unshift("convert")
|
152
|
+
Rake::Task["gem"].prerequisites.unshift("git:manifest")
|
153
|
+
Rake::Task["gem"].prerequisites.unshift("gemspec")
|
158
154
|
|
159
155
|
# vim: syntax=ruby
|