Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for IANA provisional media registries #45

Merged
merged 3 commits into from
Nov 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 37 additions & 15 deletions .hoerc
Original file line number Diff line number Diff line change
@@ -1,28 +1,50 @@
---
exclude: !ruby/regexp '/
\.(tmp|swp)$
|
\.(?:autotest|gemtest|gitignore|hoerc|minitest.rb|simplecov-prelude.rb)
|
^(?i:TAGS)
\.(?:
tmp
| swp
)$
|
\.(?:
DS_Store|
bundle|
git|
hg|
idea|
svn|
vagrant
bundle
| git
| github
| hg
| idea
| svn
| vagrant
)\/
|
[gG]emfile(?:\.lock)?
|
support\/
(?:
support
)\/
|
\.(?:coveralls|pullreview|travis|rubocop.*)\.yml
\.(?:
appveyor
| coveralls
| fasterer
| pullreview
| rubocop.*
| standard.*
| travis
| unused
)\.yml$
|
(?i:TAGS)$
|
.byebug_history
\.(?:
DS_Store
| autotest
| byebug_history
| gemtest
| gitattributes
| gitignore
| hoerc
| minitest.rb
| simplecov-prelude.rb
)$
|
\.gemspec$
/x'
134 changes: 0 additions & 134 deletions .rubocop.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .standard.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
parallel: true
ruby_version: 2.0
ignore:
- 'mime-types-data.gemspec'
- '*.gemspec'
24 changes: 12 additions & 12 deletions Code-of-Conduct.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age,
body size, disability, ethnicity, gender identity and expression, level of
experience, nationality, personal appearance, race, religion, or sexual
identity and orientation.
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of
experience, nationality, personal appearance, race, religion, or sexual identity
and orientation.

## Our Standards

Expand Down Expand Up @@ -37,20 +37,20 @@ Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
Project maintainers have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, or to ban temporarily or permanently any
contributor for other behaviors that they deem inappropriate, threatening,
offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an
appointed representative at an online or offline event. Representation of a
project may be further defined and clarified by project maintainers.
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Expand Down
50 changes: 30 additions & 20 deletions Contributing.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Contributing

Contributions to mime-types-data is encouraged in any form: a bug report, new
MIME type defintions, or additional code to help manage the MIME types. As with
MIME type definitions, or additional code to help manage the MIME types. As with
many of my projects, I have a few suggestions for improving the chance of
acceptance of your code contributions:

Expand All @@ -26,12 +26,12 @@ other languages.
The Ruby mime-types gem loads its data from files encoded in the `data`
directory in this gem by loading `mime-types-data` and reading
MIME::Types::Data::PATH. These files are compiled files from the collection of
data in the `types` directory. Pull requests that include changes to these
files will require amendment to revert these files.
data in the `types` directory. Pull requests that include changes to these files
will require amendment to revert these files.

New or modified MIME types should be edited in the appropriate YAML file under
`types`. The format is as shown below for the `application/xml` MIME type
in `types/application.yml`.
`types`. The format is as shown below for the `application/xml` MIME type in
`types/application.yml`.

```yaml
- !ruby/object:MIME::Type
Expand All @@ -43,18 +43,18 @@ in `types/application.yml`.
references:
- IANA
- RFC3023
xrefs: !ruby/hash:MIME::Types::Container
xrefs:
rfc:
- rfc3023
registered: true
```

There are other fields that can be added, matching the fields discussed in the
documentation for MIME::Type. Pull requests for MIME types should just contain
the changes to the YAML files for the new or modified MIME types; I will
convert the YAML files to JSON prior to a new release. I would rather not have
to verify that the JSON matches the YAML changes, which is why it is not
necessary to convert for the pull request.
the changes to the YAML files for the new or modified MIME types; I will convert
the YAML files to JSON prior to a new release. I would rather not have to verify
that the JSON matches the YAML changes, which is why it is not necessary to
convert for the pull request.

If you are making a change for a private fork, use `rake convert:yaml:json` to
convert the YAML to JSON, or `rake convert:yaml:columnar` to convert it to the
Expand All @@ -70,6 +70,16 @@ $ rake mime:iana
$ rake mime:apache
```

##### A Note on Provisional Types

The file `types/provisional-standard-types.yaml` contains the provisionally
registered types from IANA. Whenever IANA types are updated, the existing
provisional types should be reviewed in the event that they have been promoted
to standard types.

It is recommended that customization _not_ be made to provisional types; the
provisional types file is rewritten on update.

### Development Dependencies

mime-types-data uses Ryan Davis’s {Hoe}[https://github.com/seattlerb/hoe] to
Expand Down Expand Up @@ -132,10 +142,10 @@ Here's the most direct way to get your work merged into the project:
The release process needs automation; as it includes generating code and
committing to the repository, it is not clear how this will happen safely.

1. Review any outstanding issues or pull requests to see if anything needs to
be addressed. This is necessary because there is currently no automated
source for extensions for the thousands of MIME entries. (Suggestions and/or
pull requests for same would be deeply appreciated.)
1. Review any outstanding issues or pull requests to see if anything needs to be
addressed. This is necessary because there is currently no automated source
for extensions for the thousands of MIME entries. (Suggestions and/or pull
requests for same would be deeply appreciated.)
2. `bundle install`
3. `bundle exec rake mime:apache`
4. `bundle exec rake mime:iana`
Expand All @@ -145,18 +155,18 @@ committing to the repository, it is not clear how this will happen safely.
category.)
6. `bundle exec rake convert`
7. `bundle exec rake update:version`
8. Write up the changes in History.md. If any PRs have been merged, these
should be noted specifically.
8. Write up the changes in History.md. If any PRs have been merged, these should
be noted specifically.
9. Commit the changes and push to GitHub.
10. `bundle exec rake release VERSION=newversion`

### Automating the Release

If anyone wishes to provide suggestions on automation, this would be a
two-phase process:
If anyone wishes to provide suggestions on automation, this would be a two-phase
process:

1. A system would need to periodically create PRs to the GitHub repository
with the output of the following commands (steps 2, 3, and 4):
1. A system would need to periodically create PRs to the GitHub repository with
the output of the following commands (steps 2, 3, and 4):

```sh
bundle install
Expand Down
4 changes: 4 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
- Added conversion utilities that support the `mini_mime` data format. These
have been ported from the [mini_mime] repository. [#47]

- Added IANA provisional media registries. Added some notes to Contributing.md
about the transient nature of the provisional registration data. [#45]

## 3.2021.0901 / 2021-09-01

- Updated the Apache and IANA media registry entries as of release date.
Expand Down Expand Up @@ -481,6 +484,7 @@
[#35]: https://github.com/mime-types/mime-types-data/pull/35
[#36]: https://github.com/mime-types/mime-types-data/pull/36
[#40]: https://github.com/mime-types/mime-types-data/pull/40
[#45]: https://github.com/mime-types/mime-types-data/pull/45
[#46]: https://github.com/mime-types/mime-types-data/pull/46
[#47]: https://github.com/mime-types/mime-types-data/pull/47
[rmt]: https://github.com/mime-types/ruby-mime-types
Expand Down
Loading