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

Consider switching to YAML or CSV #37

Closed
postmodern opened this issue Jul 24, 2013 · 2 comments
Closed

Consider switching to YAML or CSV #37

postmodern opened this issue Jul 24, 2013 · 2 comments
Assignees
Labels
Milestone

Comments

@postmodern
Copy link
Contributor

Consider storing your type lists in YAML or CSV. This would make it easier to edit in the future. It took me a while to understand the structure of your type lists.

@halostatue
Copy link
Member

I'm honestly not sure whether I want to do this or not. Switching to CSV introduces a massive readability problem and forces empty fields for optional values, so that's not even open for discussion.

Switching to a YAML (or other tagged) structure…it'll be somewhat more humane to edit, but I'm unconvinced that it's what I want. The format I use is both dense and documented—possibly not where you expect it to be, but it is documented (as a function comment on MIME::Types.load_from_file). YAML is clearer because it's tagged, but information density is lost (the current format is also a fairly simple transform from the official IANA-registered MIME types pages, but that's not an argument because I could also make the transform write to the YAML format fairly easily). When I'm comparing changes to the IANA-registered MIME types, the information density is fairly important (in no small part because the IANA registration pages do not typically include the extensions used by the MIME types).

I am willing to be convinced, but the workflow that I've built around the current format (which has been through two or three revisions) is fairly efficient for me, the maintainer, to add/remove MIME types in bulk.

Would it be acceptable to have a human-readable transform that I can document in Contributing.rdoc as a form that can be used for people who do more ad-hoc one-off changes? As that gets used, and as I play with it and build tools around it, it could potentially replace the current format. I won't pretend that my regex-parser for the format that I have is more efficient than Psych for performance purposes.

      # Build the type list from a file in the format:
      #
      #   [*][!][os:]mt/st[<ws>@ext][<ws>:enc][<ws>'url-list][<ws>=docs]
      #
      # == *
      # An unofficial MIME type. This should be used if and only if the MIME type
      # is not properly specified (that is, not under either x-type or
      # vnd.name.type).
      #
      # == !
      # An obsolete MIME type. May be used with an unofficial MIME type.
      #
      # == os:
      # Platform-specific MIME type definition.
      #
      # == mt
      # The media type.
      #
      # == st
      # The media subtype.
      #
      # == <ws>@ext
      # The list of comma-separated extensions.
      #
      # == <ws>:enc
      # The encoding.
      #
      # == <ws>'url-list
      # The list of comma-separated URLs.
      #
      # == <ws>=docs
      # The documentation string.
      #
      # That is, everything except the media type and the subtype is optional. The
      # more information that's available, though, the richer the values that can
      # be provided.

@halostatue
Copy link
Member

The shipped format will be JSON. However, the repo will also have a set of YAML files that will be used to compile into the JSON format for editing purposes.

halostatue added a commit that referenced this issue Oct 20, 2013
A substantial upgrade to the mime-types library. Major features:

- No longer compatible with Ruby 1.8.
- Several major API changes and deprecations.
- The default mime-types registry is now stored as JSON.
- Improved developer tools.
- Improved repackager tools.
- Resolves #28, #36, #37, #43, and #44.
halostatue added a commit that referenced this issue Oct 20, 2013
A substantial upgrade to the mime-types library. Major features:

- No longer compatible with Ruby 1.8.
- Several major API changes and deprecations.
- The default mime-types registry is now stored as JSON.
- Improved developer tools.
- Improved repackager tools.
- Resolves #28.
- Resolves #36.
- Resolves #37.
- Resolves #43.
- Resolves #44.
halostatue added a commit that referenced this issue Oct 20, 2013
A substantial upgrade to the mime-types library. Major features:

- No longer compatible with Ruby 1.8.
- Several major API changes and deprecations.
- The default mime-types registry is now stored as JSON.
- Improved developer tools.
- Improved repackager tools.
- Fixes #28.
- Fixes #36.
- Fixes #37.
- Fixes #43.
- Fixes #44.
halostatue added a commit that referenced this issue Oct 20, 2013
A substantial upgrade to the mime-types library. Major features:

- No longer compatible with Ruby 1.8.
- Several major API changes and deprecations.
- The default mime-types registry is now stored as JSON.
- Improved developer tools.
- Improved repackager tools.
- Fixes #28.
- Fixes #36.
- Fixes #37.
- Fixes #42.
- Fixes #43.
- Fixes #44.
halostatue added a commit that referenced this issue Oct 20, 2013
A substantial upgrade to the mime-types library. Major features:

- No longer compatible with Ruby 1.8.
- Several major API changes and deprecations.
- The default mime-types registry is now stored as JSON.
- Improved developer tools.
- Improved repackager tools.
- Fixes #28.
- Fixes #36.
- Fixes #37.
- Fixes #42.
- Fixes #43.
- Fixes #44.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants