Contributing

I value any contribution to mime-types you can provide: a bug report, a feature request, or code contributions.

There are a few guidelines for contributing to mime-types:

Adding or Modifying MIME Types

The mime-types registry is no longer contained in mime-types, but in mime-types-data. Please see that project for contributions there.

Test Dependencies

mime-types uses Ryan Davis’s [Hoe] to manage the release process, and it adds a number of rake tasks. You will mostly be interested in rake, which runs the tests the same way that rake test or rake travis will do.

To assist with the installation of the development dependencies for mime-types, I have provided the simplest possible Gemfile pointing to the (generated) mime-types.gemspec file. This will permit you to do bundle install to get the development dependencies. If you aleady have hoe installed, you can accomplish the same thing with rake newb.

This task will install any missing dependencies, run the tests/specs, and generate the RDoc.

You can run tests with code coverage analysis by running rake test:coverage.

Benchmarks

mime-types offers several benchmark tasks to measure different measures of performance.

There is a repeated load test, measuring how long it takes to start and load mime-types with its full registry. By default, it runs fifty loops and uses the built-in benchmark library:

There are two allocation tracing benchmarks (for normal and columnar loads). These can only be run on Ruby 2.1 or better and requires the allocation_tracer gem (not installed by default).

There are two loaded object count benchmarks (for normal and columnar loads). These use ObjectSpace.count_objects.

Workflow

Here’s the most direct way to get your work merged into the project:

Contributors

Thanks to everyone else who has contributed to mime-types over the years: