mime-types-data 3.2024.1203 → 3.2025.0204
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/{History.md → CHANGELOG.md} +34 -0
- data/CONTRIBUTING.md +150 -0
- data/CONTRIBUTORS.md +53 -0
- data/{Licence.md → LICENCE.md} +1 -1
- data/Manifest.txt +5 -19
- data/README.md +31 -30
- data/Rakefile +40 -116
- data/SECURITY.md +1 -1
- data/data/mime-types.json +1 -1
- data/data/mime.content_type.column +12 -0
- data/data/mime.docs.column +12 -0
- data/data/mime.encoding.column +12 -0
- data/data/mime.flags.column +12 -0
- data/data/mime.friendly.column +12 -0
- data/data/mime.pext.column +12 -0
- data/data/mime.use_instead.column +12 -0
- data/data/mime.xrefs.column +47 -35
- data/lib/mime/types/data.rb +1 -1
- metadata +18 -89
- data/Contributing.md +0 -203
- data/types/application.yaml +0 -19098
- data/types/audio.yaml +0 -1753
- data/types/chemical.yaml +0 -71
- data/types/conference.yaml +0 -9
- data/types/drawing.yaml +0 -15
- data/types/example.yaml +0 -1
- data/types/font.yaml +0 -65
- data/types/haptics.yaml +0 -28
- data/types/image.yaml +0 -1329
- data/types/message.yaml +0 -247
- data/types/model.yaml +0 -454
- data/types/multipart.yaml +0 -187
- data/types/text.yaml +0 -1281
- data/types/video.yaml +0 -1158
- data/types/world.yaml +0 -8
- /data/{Code-of-Conduct.md → CODE_OF_CONDUCT.md} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 840c446d1416a5c5cdce532c70a53873b135ea1006944a4f1fe31e0f27c122ac
|
4
|
+
data.tar.gz: 200600d2dc811ddf4bbb0dbff135779fdb51ffacb59b40aa47d07c7e4a432798
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 140991f337bbd821c48a2d0b34d4af0648139a672a751732a832b468ef2871aa902297e416b233ea8ac9654a6e45efd05ae0e0c7d93a59484df3e342b51aa8b1
|
7
|
+
data.tar.gz: 5dbbe997eeee3f8ddb232666a09037ad275f53b73d7ab6e68434838f258b28c433a408e22ab51659216debcbdfdf8415c8a94944f996c4dcfae1db1d990407db
|
data/{History.md → CHANGELOG.md}
RENAMED
@@ -2,6 +2,38 @@
|
|
2
2
|
|
3
3
|
<!-- automatic-release -->
|
4
4
|
|
5
|
+
## 3.2025.0204 / 2025-02-04
|
6
|
+
|
7
|
+
- Updated the Apache and IANA media registry entries as of release date
|
8
|
+
|
9
|
+
|
10
|
+
- Added the Changelog URL to the README so that RubyGems.org is updated with the
|
11
|
+
`changelog_uri` on release. Contributed by Mark Young in [#96][#96].
|
12
|
+
|
13
|
+
- Fixed an issue with automated releases that added thousands of files because
|
14
|
+
`vendor/` was no longer ignored.
|
15
|
+
|
16
|
+
- Fixed the automated release builder process to handle the case when the
|
17
|
+
`automatic-release` tag is followed by a `## NEXT / YYYY-MM-DD` header so that
|
18
|
+
changes merged normally are picked up on automatic releases. [#98][#98]
|
19
|
+
|
20
|
+
## 3.2025.0107 / 2025-01-07
|
21
|
+
|
22
|
+
- Updated the Apache and IANA media registry entries as of release date
|
23
|
+
- Restructured documentation for how I prefer to manage Hoe projects now.
|
24
|
+
- Reworked the Rakefile because all data updates are now managed by GitHub
|
25
|
+
Actions and should not be managed manually any longer.
|
26
|
+
|
27
|
+
- `rake release:prepare` now does the same work as `rake release:gha`, but
|
28
|
+
does not commit or create a pull request.
|
29
|
+
|
30
|
+
- `rake convert` no longer has any subtasks.
|
31
|
+
|
32
|
+
- `rake update` has been removed with no replacement.
|
33
|
+
|
34
|
+
- Updated `.hoerc` to properly exclude `support/` and `types/` from the
|
35
|
+
manifest.
|
36
|
+
|
5
37
|
## 3.2024.1203 / 2024-12-03
|
6
38
|
|
7
39
|
- Updated the Apache and IANA media registry entries as of release date
|
@@ -612,6 +644,8 @@
|
|
612
644
|
[#55]: https://github.com/mime-types/mime-types-data/issues/55
|
613
645
|
[#77]: https://github.com/mime-types/mime-types-data/pull/77
|
614
646
|
[#81]: https://github.com/mime-types/mime-types-data/pull/81
|
647
|
+
[#96]: https://github.com/mime-types/mime-types-data/pull/96
|
648
|
+
[#98]: https://github.com/mime-types/mime-types-data/pull/98
|
615
649
|
[rmt]: https://github.com/mime-types/ruby-mime-types
|
616
650
|
[code of conduct]: Code-of-Conduct.md
|
617
651
|
[mini_mime]: https://github.com/discourse/mini_mime/issues/41
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,150 @@
|
|
1
|
+
# Contributing
|
2
|
+
|
3
|
+
Contribution to mime-types-data is encouraged in any form: a bug report, new
|
4
|
+
MIME type definitions, or additional code to help manage the MIME types. There
|
5
|
+
are a few DOs and DON'Ts for contributions.
|
6
|
+
|
7
|
+
- DO:
|
8
|
+
|
9
|
+
- Keep the coding style that already exists for any updated Ruby code (support
|
10
|
+
or otherwise). I use [Standard Ruby][standardrb] for linting and formatting.
|
11
|
+
|
12
|
+
- Use thoughtfully-named topic branches for contributions. Rebase your commits
|
13
|
+
into logical chunks as necessary.
|
14
|
+
|
15
|
+
- Use [quality commit messages][qcm].
|
16
|
+
|
17
|
+
- Add your name or GitHub handle to `CONTRIBUTORS.md` and a record in the
|
18
|
+
`CHANGELOG.md` as a separate commit from your main change. (Follow the style
|
19
|
+
in the `CHANGELOG.md` and provide a link to your PR.)
|
20
|
+
|
21
|
+
- DO NOT:
|
22
|
+
|
23
|
+
- Modify `VERSION` in `lib/mime/types/data.rb`. When your patch is accepted
|
24
|
+
and a release is made, the version will be updated at that point. Most
|
25
|
+
likely, once merged, your release will be rolled into the next automatic
|
26
|
+
release.
|
27
|
+
|
28
|
+
- Modify `mime-types-data.gemspec`; it is a generated file. (You _may_ use
|
29
|
+
`rake gemspec` to regenerate it if your change involves metadata related to
|
30
|
+
gem itself).
|
31
|
+
|
32
|
+
- Modify the `Gemfile`.
|
33
|
+
|
34
|
+
- Modify any files in `data/`. Any changes to be captured here will be
|
35
|
+
automatically updated on the next release.
|
36
|
+
|
37
|
+
Although mime-types-data was extracted from the [Ruby mime-types][rmt] gem and
|
38
|
+
the support files are written in Ruby, the _target_ of mime-types-data is any
|
39
|
+
implementation that wishes to use the data as a MIME types registry, so I am
|
40
|
+
particularly interested in tools that will create a mime-types-data package for
|
41
|
+
other languages.
|
42
|
+
|
43
|
+
## Adding or Modifying MIME Types
|
44
|
+
|
45
|
+
The Ruby mime-types gem loads its data from files encoded in the `data`
|
46
|
+
directory in this gem by loading `mime-types-data` and reading
|
47
|
+
MIME::Types::Data::PATH. These files are compiled files from the collection of
|
48
|
+
data in the `types` directory.
|
49
|
+
|
50
|
+
> [!WARNING]
|
51
|
+
>
|
52
|
+
> Pull requests that include changes to files in `data/` will require amendment
|
53
|
+
> to revert these files.
|
54
|
+
|
55
|
+
New or modified MIME types should be edited in the appropriate YAML file under
|
56
|
+
`types`. The format is as shown below for the `application/xml` MIME type in
|
57
|
+
`types/application.yml`.
|
58
|
+
|
59
|
+
```yaml
|
60
|
+
- !ruby/object:MIME::Type
|
61
|
+
content-type: application/xml
|
62
|
+
encoding: 8bit
|
63
|
+
extensions:
|
64
|
+
- xml
|
65
|
+
- xsl
|
66
|
+
references:
|
67
|
+
- IANA
|
68
|
+
- RFC3023
|
69
|
+
xrefs:
|
70
|
+
rfc:
|
71
|
+
- rfc3023
|
72
|
+
registered: true
|
73
|
+
```
|
74
|
+
|
75
|
+
There are other fields that can be added, matching the fields discussed in the
|
76
|
+
documentation for MIME::Type. Pull requests for MIME types should just contain
|
77
|
+
the changes to the YAML files for the new or modified MIME types; I will convert
|
78
|
+
the YAML files to JSON prior to a new release. I would rather not have to verify
|
79
|
+
that the JSON matches the YAML changes, which is why it is not necessary to
|
80
|
+
convert for the pull request.
|
81
|
+
|
82
|
+
If you are making a change for a private fork, use `rake convert:yaml:json` to
|
83
|
+
convert the YAML to JSON, or `rake convert:yaml:columnar` to convert it to the
|
84
|
+
new columnar format.
|
85
|
+
|
86
|
+
### Updating Types from the IANA or Apache Lists
|
87
|
+
|
88
|
+
If you are maintaining a private fork and wish to update your copy of the MIME
|
89
|
+
types registry used by this gem, you can do this with the rake tasks:
|
90
|
+
|
91
|
+
```sh
|
92
|
+
$ rake mime:iana
|
93
|
+
$ rake mime:apache
|
94
|
+
```
|
95
|
+
|
96
|
+
#### A Note on Provisional Types
|
97
|
+
|
98
|
+
Provisionally registered types from IANA are contained in the `types/*.yaml`
|
99
|
+
files. Per IANA,
|
100
|
+
|
101
|
+
> This registry, unlike some other provisional IANA registries, is only for
|
102
|
+
> temporary use. Entries in this registry are either finalized and moved to the
|
103
|
+
> main media types registry or are abandoned and deleted. Entries in this
|
104
|
+
> registry are suitable for use for development and test purposes only.
|
105
|
+
|
106
|
+
Provisional types are rewritten when updated, so pull requests to manually
|
107
|
+
customize provisional types (such as with extensions) are considered lower
|
108
|
+
priority. It is recommended that any updates required to the data be performed
|
109
|
+
in your application if you require provisional types.
|
110
|
+
|
111
|
+
## The Release Process
|
112
|
+
|
113
|
+
The release process is almost completely automated, where upstream MIME types
|
114
|
+
will be updated weekly (on Tuesdays) and be presented in a reviewable pull
|
115
|
+
request. Once merged, I need to perform a release and the update is complete.
|
116
|
+
|
117
|
+
If performing a manual release outside of the update cycle, the IANA updates
|
118
|
+
should be performed manually.
|
119
|
+
|
120
|
+
1. Review any outstanding issues or pull requests to see if anything needs to be
|
121
|
+
addressed. This is necessary because there is no automated source for
|
122
|
+
extensions for the thousands of MIME entries. (Suggestions and/or pull
|
123
|
+
requests for same would be deeply appreciated.)
|
124
|
+
2. `bundle install`
|
125
|
+
3. Review the changes to make sure that the changes are sane. The IANA data
|
126
|
+
source changes from time to time, resulting in big changes or even a broken
|
127
|
+
step 4. (The most recent change was the addition of the `font/*` top-level
|
128
|
+
category.)
|
129
|
+
4. Write up the changes in `CHANGELOG.md`. If any PRs have been merged, these
|
130
|
+
should be noted specifically and contributions should be added in
|
131
|
+
`Contributing.md`.
|
132
|
+
5. Commit the changes and push to GitHub.
|
133
|
+
6. `bundle exec rake release VERSION=newversion`
|
134
|
+
|
135
|
+
This is based on an issue [#18][#18].
|
136
|
+
|
137
|
+
### Help Wanted
|
138
|
+
|
139
|
+
I want to automate this even further. I am **not** switching from Hoe for
|
140
|
+
release management, so the use of [rubygems/release-gem][release-gem] requires
|
141
|
+
some care (perhaps by exporting `VERSION=$(rake version)` to the job), but
|
142
|
+
assistance in getting this action going for an automated release would be
|
143
|
+
greatly appreciated.
|
144
|
+
|
145
|
+
[#18]: https://github.com/mime-types/mime-types-data/issues/18
|
146
|
+
[hoe]: https://github.com/seattlerb/hoe
|
147
|
+
[qcm]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
|
148
|
+
[release-gem]: https://github.com/rubygems/release-gem
|
149
|
+
[rmt]: https://github.com/mime-types/ruby-mime-types/
|
150
|
+
[standardrb]: https://github.com/standardrb/standard
|
data/CONTRIBUTORS.md
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
# Contributors
|
2
|
+
|
3
|
+
- Austin Ziegler created mime-types.
|
4
|
+
|
5
|
+
Thanks to everyone else who has contributed to mime-types:
|
6
|
+
|
7
|
+
- Aaron Patterson
|
8
|
+
- Aggelos Avgerinos
|
9
|
+
- Alessio Parma
|
10
|
+
- Alex Balhatchet
|
11
|
+
- Andre Pankratz
|
12
|
+
- Andrey Eremin
|
13
|
+
- Andy Brody
|
14
|
+
- Arnaud Meuret
|
15
|
+
- Bradley Meck
|
16
|
+
- Brandon Galbraith
|
17
|
+
- Chris Gat
|
18
|
+
- Chris Salzberg
|
19
|
+
- David Genord
|
20
|
+
- Eric Marden
|
21
|
+
- Garret Alfert
|
22
|
+
- Godfrey Chan
|
23
|
+
- Greg Brockman
|
24
|
+
- Hans de Graaff
|
25
|
+
- Henrik Hodne
|
26
|
+
- Jeremy Evans
|
27
|
+
- John Gardner
|
28
|
+
- Jon Sneyers
|
29
|
+
- Jonas Petersen
|
30
|
+
- Juanito Fatas
|
31
|
+
- Keerthi Siva
|
32
|
+
- Ken Ip
|
33
|
+
- Łukasz Śliwa
|
34
|
+
- Lucia
|
35
|
+
- Mark Young
|
36
|
+
- Martin d'Allens
|
37
|
+
- Mauricio Linhares
|
38
|
+
- Mohammed Gad
|
39
|
+
- Myk Klemme
|
40
|
+
- nycvotes-dev
|
41
|
+
- Postmodern
|
42
|
+
- Richard Hirner
|
43
|
+
- Richard Hurt
|
44
|
+
- Richard Schneeman
|
45
|
+
- Robert Buchberger
|
46
|
+
- Samuel Williams
|
47
|
+
- Sergio Baptista
|
48
|
+
- Shane Eskritt
|
49
|
+
- Tao Guo
|
50
|
+
- Thomas Leese
|
51
|
+
- Tibor Szolár
|
52
|
+
- Todd Carrico
|
53
|
+
- Yoran Brondsema
|
data/{Licence.md → LICENCE.md}
RENAMED
data/Manifest.txt
CHANGED
@@ -1,7 +1,8 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
CHANGELOG.md
|
2
|
+
CODE_OF_CONDUCT.md
|
3
|
+
CONTRIBUTING.md
|
4
|
+
CONTRIBUTORS.md
|
5
|
+
LICENCE.md
|
5
6
|
Manifest.txt
|
6
7
|
README.md
|
7
8
|
Rakefile
|
@@ -19,18 +20,3 @@ data/mime.use_instead.column
|
|
19
20
|
data/mime.xrefs.column
|
20
21
|
lib/mime-types-data.rb
|
21
22
|
lib/mime/types/data.rb
|
22
|
-
types/application.yaml
|
23
|
-
types/audio.yaml
|
24
|
-
types/chemical.yaml
|
25
|
-
types/conference.yaml
|
26
|
-
types/drawing.yaml
|
27
|
-
types/example.yaml
|
28
|
-
types/font.yaml
|
29
|
-
types/haptics.yaml
|
30
|
-
types/image.yaml
|
31
|
-
types/message.yaml
|
32
|
-
types/model.yaml
|
33
|
-
types/multipart.yaml
|
34
|
-
types/text.yaml
|
35
|
-
types/video.yaml
|
36
|
-
types/world.yaml
|
data/README.md
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
# mime-types-data
|
2
2
|
|
3
3
|
- home :: https://github.com/mime-types/mime-types-data/
|
4
|
-
- code :: https://github.com/mime-types/mime-types-data/
|
5
4
|
- issues :: https://github.com/mime-types/mime-types-data/issues
|
5
|
+
- code :: https://github.com/mime-types/mime-types-data/
|
6
|
+
- changelog :: https://github.com/mime-types/mime-types-data/blob/main/CHANGELOG.md
|
6
7
|
|
7
8
|
## Description
|
8
9
|
|
@@ -13,11 +14,11 @@ extensions to look up the likely MIME type definitions.
|
|
13
14
|
|
14
15
|
### About MIME Media Types
|
15
16
|
|
16
|
-
MIME media types are used in MIME-compliant communications, as in e-mail or
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
17
|
+
MIME media types are used in MIME-compliant communications, as in e-mail or HTTP
|
18
|
+
traffic, to indicate the type of content which is transmitted. The registry
|
19
|
+
provided in mime-types-data contains detailed information about MIME entities.
|
20
|
+
There are many types defined by RFCs and vendors, so the list is long but
|
21
|
+
invariably; don't hesitate to offer additional type definitions for
|
21
22
|
consideration. MIME type definitions found in mime-types are from RFCs, W3C
|
22
23
|
recommendations, the [IANA Media Types registry][registry], and user
|
23
24
|
contributions. It conforms to RFCs 2045 and 2231.
|
@@ -26,20 +27,20 @@ contributions. It conforms to RFCs 2045 and 2231.
|
|
26
27
|
|
27
28
|
This registry contains the MIME media types in four formats:
|
28
29
|
|
29
|
-
- A YAML format matching the Ruby mime-types library objects (MIME::Type).
|
30
|
-
|
31
|
-
|
30
|
+
- A YAML format matching the Ruby mime-types library objects (MIME::Type). This
|
31
|
+
is the primary user-editable format for developers. It is _not_ shipped with
|
32
|
+
the gem due to size considerations.
|
32
33
|
- A JSON format converted from the YAML format. Prior to Ruby mime-types 3.0,
|
33
34
|
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
|
-
|
36
|
-
- An encoded text format splitting the data for each MIME type across
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
- An encoded text format for use with [`mini_mime`][]
|
42
|
-
|
35
|
+
implementation that does not wish to implement the columnar format, which has
|
36
|
+
a significant implementation effort cost.
|
37
|
+
- An encoded text format splitting the data for each MIME type across multiple
|
38
|
+
files. This columnar data format reduces the minimal data load substantially,
|
39
|
+
resulting in a performance improvement at the cost of more complex code for
|
40
|
+
loading the data on-demand. This is the default format for Ruby mime-types
|
41
|
+
3.0.
|
42
|
+
- An encoded text format for use with [`mini_mime`][minimime]. This can be
|
43
|
+
enabled with:
|
43
44
|
|
44
45
|
```ruby
|
45
46
|
MiniMime::Configuration.ext_db_path =
|
@@ -50,24 +51,24 @@ This registry contains the MIME media types in four formats:
|
|
50
51
|
|
51
52
|
## mime-types-data Modified Semantic Versioning
|
52
53
|
|
53
|
-
mime-types-data uses a heavily modified [Semantic Versioning][] scheme to
|
54
|
-
indicate that the data formats compatibility based on a `SCHEMA` version and
|
55
|
-
|
54
|
+
mime-types-data uses a heavily modified [Semantic Versioning][semver] scheme to
|
55
|
+
indicate that the data formats compatibility based on a `SCHEMA` version and the
|
56
|
+
date of the data update: `SCHEMA.YEAR.MONTHDAY`.
|
56
57
|
|
57
58
|
1. If an incompatible data format change is made to any of the supported
|
58
|
-
|
59
|
+
formats, `SCHEMA` will be incremented. The current `SCHEMA` is 3, supporting
|
59
60
|
the YAML, JSON, and columnar formats required for Ruby mime-types 3.0.
|
60
61
|
|
61
|
-
2. When the data is updated, the `YEAR.MONTHDAY` combination will be updated.
|
62
|
-
|
62
|
+
2. When the data is updated, the `YEAR.MONTHDAY` combination will be updated. An
|
63
|
+
update on the last day of October 2015 would be written as `2015.1031`,
|
63
64
|
resulting in the full version of `3.2015.1031`.
|
64
65
|
|
65
66
|
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
|
-
|
68
|
-
|
69
|
-
|
67
|
+
error, there will be an additional `REVISION` field incremented on the end of
|
68
|
+
the version. Thus, if three revisions need to be published on October 31st,
|
69
|
+
2015, the last release would be `3.2015.1031.2` (remember that the first
|
70
|
+
release has an implied `0`.)
|
70
71
|
|
71
72
|
[registry]: https://www.iana.org/assignments/media-types/media-types.xhtml
|
72
|
-
[
|
73
|
-
[
|
73
|
+
[semver]: http://semver.org/
|
74
|
+
[minimime]: https://github.com/discourse/mini_mime
|
data/Rakefile
CHANGED
@@ -4,51 +4,35 @@ require "rubygems"
|
|
4
4
|
require "hoe"
|
5
5
|
require "rake/clean"
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
Hoe.plugin :
|
7
|
+
$LOAD_PATH.unshift("lib")
|
8
|
+
$LOAD_PATH.unshift("support")
|
9
|
+
|
10
|
+
Hoe.plugin :halostatue
|
11
|
+
|
12
|
+
Hoe.plugins.delete :debug
|
13
|
+
Hoe.plugins.delete :newb
|
14
|
+
Hoe.plugins.delete :publish
|
15
|
+
Hoe.plugins.delete :signing
|
11
16
|
|
12
17
|
Hoe.spec "mime-types-data" do
|
13
18
|
developer("Austin Ziegler", "halostatue@gmail.com")
|
14
19
|
|
15
|
-
|
16
|
-
self.readme_file = "README.md"
|
20
|
+
require_ruby_version ">= 2.0"
|
17
21
|
|
18
22
|
license "MIT"
|
19
23
|
|
20
|
-
|
21
|
-
|
22
|
-
|
24
|
+
spec_extras[:metadata] = ->(val) {
|
25
|
+
val.merge!({"rubygems_mfa_required" => "true"})
|
26
|
+
}
|
23
27
|
|
24
28
|
extra_dev_deps << ["hoe", "~> 4.0"]
|
25
|
-
extra_dev_deps << ["hoe-
|
26
|
-
extra_dev_deps << ["hoe-gemspec2", "~> 1.1"]
|
27
|
-
extra_dev_deps << ["hoe-git2", "~> 1.7"]
|
28
|
-
extra_dev_deps << ["hoe-rubygems", "~> 1.0"]
|
29
|
+
extra_dev_deps << ["hoe-halostatue", "~> 1.0"]
|
29
30
|
extra_dev_deps << ["mime-types", ">= 3.4.0", "< 4"]
|
30
31
|
extra_dev_deps << ["nokogiri", "~> 1.6"]
|
31
32
|
extra_dev_deps << ["rake", ">= 10.0", "< 14"]
|
32
33
|
extra_dev_deps << ["standard", "~> 1.0"]
|
33
34
|
end
|
34
35
|
|
35
|
-
$LOAD_PATH.unshift "lib"
|
36
|
-
$LOAD_PATH.unshift "support"
|
37
|
-
|
38
|
-
def new_version
|
39
|
-
version =
|
40
|
-
IO.read("lib/mime/types/data.rb").scan(/VERSION = ['"](\d\.\d{4}\.\d{4}(?:\.\d+)?)['"]/).flatten.first
|
41
|
-
|
42
|
-
major = Gem::Version.new(version).canonical_segments.first
|
43
|
-
minor = Date.today.strftime("%Y.%m%d")
|
44
|
-
|
45
|
-
"#{major}.#{minor}"
|
46
|
-
end
|
47
|
-
|
48
|
-
def release_header
|
49
|
-
"#{new_version} / #{Date.today.strftime("%Y-%m-%d")}"
|
50
|
-
end
|
51
|
-
|
52
36
|
namespace :mime do
|
53
37
|
desc "Download the current MIME type registrations from IANA."
|
54
38
|
task :iana, [:destination] do |_, args|
|
@@ -63,105 +47,45 @@ namespace :mime do
|
|
63
47
|
end
|
64
48
|
end
|
65
49
|
|
50
|
+
task :version do
|
51
|
+
require "mime/types/data"
|
52
|
+
puts MIME::Types::Data::VERSION
|
53
|
+
end
|
54
|
+
|
66
55
|
namespace :release do
|
67
|
-
|
68
|
-
task
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
56
|
+
desc "Prepare a new release"
|
57
|
+
task :prepare do
|
58
|
+
require "prepare_release"
|
59
|
+
|
60
|
+
PrepareRelease.new
|
61
|
+
.download_and_convert
|
62
|
+
.write_updated_version
|
63
|
+
.write_updated_history
|
64
|
+
.rake_git_manifest
|
65
|
+
.rake_gemspec
|
76
66
|
end
|
77
67
|
|
78
68
|
desc "Prepare a new release for use with GitHub Actions"
|
79
69
|
task :gha do
|
80
70
|
require "prepare_release"
|
81
71
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
end
|
90
|
-
|
91
|
-
desc "Prepare a new automatic release"
|
92
|
-
task automatic: :__pull do
|
93
|
-
if system("git diff --quiet --exit-code") == false
|
94
|
-
Rake::Task["release:__prepare"].invoke
|
95
|
-
Rake::Task["gemspec"].invoke
|
96
|
-
Rake::Task["release:__commit"].invoke
|
97
|
-
else
|
98
|
-
warn "No changes detected."
|
99
|
-
end
|
72
|
+
PrepareRelease.new
|
73
|
+
.download_and_convert
|
74
|
+
.write_updated_version
|
75
|
+
.write_updated_history
|
76
|
+
.rake_git_manifest
|
77
|
+
.rake_gemspec
|
78
|
+
.as_gha_vars
|
100
79
|
end
|
101
80
|
end
|
102
81
|
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
task :json, [:source, :destination, :multiple_files] do |_, args|
|
107
|
-
require "convert"
|
108
|
-
Convert.from_yaml_to_json(from: args.source, to: args.destination, multiple_files: args.multiple_files)
|
109
|
-
end
|
110
|
-
|
111
|
-
desc "Convert from YAML to Columnar"
|
112
|
-
task :columnar, [:source, :destination] do |_, args|
|
113
|
-
require "convert/columnar"
|
114
|
-
Convert::Columnar.from_yaml_to_columnar(from: args.source, to: args.destination)
|
115
|
-
end
|
116
|
-
|
117
|
-
desc "Convert from YAML to mini_mime db format"
|
118
|
-
task :mini_mime, [:source, :destination] do |_, args|
|
119
|
-
require "convert/mini_mime_db"
|
120
|
-
Convert::MiniMimeDb.from_yaml_to_mini_mime(from: args.source, to: args.destination)
|
121
|
-
end
|
122
|
-
end
|
123
|
-
|
124
|
-
namespace :json do
|
125
|
-
desc "Convert from JSON to YAML"
|
126
|
-
task :yaml, [:source, :destination, :multiple_files] do |_, args|
|
127
|
-
require "convert"
|
128
|
-
Convert.from_json_to_yaml(from: args.source, to: args.destination, multiple_files: args.multiple_files)
|
129
|
-
end
|
130
|
-
end
|
131
|
-
end
|
132
|
-
|
133
|
-
namespace :update do
|
134
|
-
desc "Update the release version"
|
135
|
-
task :version do
|
136
|
-
file = IO.read("lib/mime/types/data.rb")
|
137
|
-
updated = file.sub(/VERSION = ['"][.0-9]+['"]/, %(VERSION = "#{new_version}"))
|
138
|
-
|
139
|
-
IO.write("lib/mime/types/data.rb", updated)
|
140
|
-
end
|
141
|
-
|
142
|
-
desc "Update the history file with automatic release notes"
|
143
|
-
task :history do
|
144
|
-
history = IO.read("History.md")
|
145
|
-
|
146
|
-
if !/^## #{release_header}$/.match?(history)
|
147
|
-
note = <<-NOTE
|
148
|
-
<!-- automatic-release -->
|
149
|
-
|
150
|
-
## #{release_header}
|
151
|
-
|
152
|
-
- Updated the Apache and IANA media registry entries as of release date.
|
153
|
-
NOTE
|
154
|
-
|
155
|
-
updated = history.sub("<!-- automatic-release -->\n", note)
|
82
|
+
desc "Default conversion from YAML to JSON and Columnar"
|
83
|
+
task :convert do
|
84
|
+
require "prepare_release"
|
156
85
|
|
157
|
-
|
158
|
-
end
|
159
|
-
end
|
86
|
+
PrepareRelease.new.convert_types
|
160
87
|
end
|
161
88
|
|
162
|
-
desc "Default conversion from YAML to JSON and Columnar"
|
163
|
-
task convert: ["convert:yaml:json", "convert:yaml:columnar", "convert:yaml:mini_mime"]
|
164
|
-
|
165
89
|
Rake::Task["gem"].prerequisites.unshift("convert")
|
166
90
|
Rake::Task["gem"].prerequisites.unshift("git:manifest")
|
167
91
|
Rake::Task["gem"].prerequisites.unshift("gemspec")
|
data/SECURITY.md
CHANGED