Skip to content

Commit

Permalink
Merge pull request #101 from mime-types/2.6-work
Browse files Browse the repository at this point in the history
Release 2.6

Fixes #83 (Decrease Memory Usage).
Fixes #84 (Requiring mime/types accounts for 2% of all application RAM).
Based on and Fixes #96.
  • Loading branch information
halostatue committed May 25, 2015
2 parents 492f769 + 98a75c0 commit e427f1c
Show file tree
Hide file tree
Showing 50 changed files with 22,532 additions and 641 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ html
pkg
publish
test/cache.tst
tmp/
10 changes: 8 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
---
language: ruby
rvm:
- 2.1.0
- 2.2.2
- 2.1.6
- 2.0.0
- 1.9.3
- ruby-head
- jruby-1.7
- jruby-9.0.0.0.pre2
- jruby-19mode
- jruby-head
- ruby-head
- ruby-head-clang
- rbx-2
matrix:
allow_failures:
- rvm: rbx-2
- rvm: jruby-head
- rvm: jruby-9.0.0.0.pre2
- rvm: ruby-head
- rvm: ruby-head-clang
gemfile:
- Gemfile
before_script:
Expand Down
90 changes: 71 additions & 19 deletions Contributing.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
I value any contribution to mime-types you can provide: a bug report, a feature
request, or code contributions.

As mime-types is a mature codebase, there are a few guidelines:
There are a few guidelines for contributing to mime-types:

* Code changes *will* *not* be accepted without tests. The test suite is
written with {Minitest}[https://github.com/seattlerb/minitest].
Expand All @@ -18,9 +18,12 @@ As mime-types is a mature codebase, there are a few guidelines:

=== Adding or Modifying MIME Types

The mime-types registry is loaded from a JSON file in +data+, but this file is
not considered editable and cannot be compared in a pull request. New or
modified MIME types should be edited in the appropriate YAML file under
The mime-types registry is loaded from encoded files in +data+. These are not
editable and cannot be compared meaningfully in a pull request; 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
+type-lists+. The format is as shown below for the +application/xml+ MIME type
in +type-lists/application.yml+.

Expand All @@ -46,7 +49,20 @@ 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 <tt>rake
convert:yaml:json</tt> to convert the YAML to JSON.
convert:yaml:json</tt> to convert the YAML to JSON, or <tt>rake
convert:yaml:columnar</tt> to convert it to the new columnar format.

==== Updating Types from the IANA or Apache Lists

If you are maintaining a private fork and wish to update your copy of the MIME
types registry used by this gem, you can do this with the rake tasks:

$ rake mime:iana
$ rake mime:apache

Both of these require
{Nokogiri}[http://www.nokogiri.org/tutorials/installing_nokogiri.html], which
is not installed by default. Install it in the usual way for your Ruby.

=== Test Dependencies

Expand Down Expand Up @@ -77,6 +93,35 @@ can accomplish the same thing with:
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.

$ rake benchmark:load

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}[https://github.com/ko1/allocation_tracer] gem (not
installed by default).

$ rake benchmark:allocations
$ rake benchmark:allocations:columnar

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

$ rake benchmark:objects
$ rake benchmark:objects:columnar

=== Workflow

Here's the most direct way to get your work merged into the project:
Expand All @@ -97,24 +142,31 @@ Here's the most direct way to get your work merged into the project:

Thanks to everyone else who has contributed to mime-types:

* Aaron Patterson
* Aggelos Avgerinos
* Andre Pankratz
* Mauricio Linhares
* Richard Hirner
* Todd Carrico
* Andy Brody
* Arnaud Meuret
* Brandon Galbraith
* Chris Gat
* David Genord
* Eric Marden
* Garret Alfert
* Godfrey Chan
* Greg Brockman
* Hans de Graaff
* Henrik Hodne
* Martin d'Allens
* Chris Gat
* Greg Brockman
* Łukasz Śliwa (for the friendly names)
* Jeremy Evans
* Juanito Fatas
* Łukasz Śliwa
* Keerthi Siva
* Aaron Patterson
* Godfrey Chan
* Tibor Szolár
* Ken Ip
* David Genord
* Juanito Fatas
* Andy Brody
* Aggelow Avgerinos
* Martin d'Allens
* Mauricio Linhares
* nycvotes-dev
* Postmodern
* Richard Hirner
* Richard Hurt
* Richard Schneeman
* Tibor Szolár
* Todd Carrico
11 changes: 11 additions & 0 deletions History-Types.rdoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
= MIME Types Changes by Version

== 2.6 / 2015-05-25

* Steven Michael Thomas (@stevenmichaelthomas) added +woff2+ as an extension to
application/font-woff,
{#99}[https://github.com/mime-types/ruby-mime-types/pull/99].
* Updated the IANA media registry entries as of release date:
* Updated metadata for application/jose, application/jose\+json,
application/jwk\+json, applicatoin/jwk-set\+json, application/jwt to
reflect the adoption of RFC7519.
* Added application/vnd.balsamiq.bmpr.

== 2.5 / 2015-04-25

* Updated the IANA media registry entries as of release date:
Expand Down
32 changes: 31 additions & 1 deletion History.rdoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,37 @@
== 2.6 / 2015-05-25

* New Feature:
* Columnar data storage for the MIME::Types registry, contributed by Jeremy
Evans (@jeremyevans). Reduces default memory use substantially (the mail
gem drops from 19 Mib to about 3 Mib). Resolves
{#96}[https://github.com/mime-types/ruby-mime-types/pull/96],
{#94}[https://github.com/mime-types/ruby-mime-types/issues/94],
{#83}[https://github.com/mime-types/ruby-mime-types/issues/83]. Partially
addresses {#64}[https://github.com/mime-types/ruby-mime-types/issues/64]
and {#62}[https://github.com/mime-types/ruby-mime-types/issues/62].
* Development:
* Removed caching of deprecation messages in preparation for mime-types 3.0.
Now, deprecated methods will always warn their deprecation instead of only
warning once.
* Added a logger for deprecation messages.
* Renamed <tt>lib/mime.rb</tt> to <tt>lib/mime/deprecations.rb</tt> to not
conflict with the {mime}[https://rubygems.org/gems/mime] gem on behalf of
the maintainers of the {Praxis Framework}[http://praxis-framework.io/].
Provided by Josep M. Blanquer (@blanquer),
{#100}[https://github.com/mime-types/ruby-mime-types/pull/100].
* Added the columnar data conversion tool, also provided by Jeremy Evans.
* Documentation:
* Improved documentation and ensured that all deprecated methods are marked
as such in the documentation.
* Development:
* Added more Ruby variants to Travis CI.
* Silenced deprecation messages for internal tools. Noisy deprecations are
noisy, but that's the point.

== 2.5 / 2015-04-25

* Bugs:
* David Genord (@albus522) fixed a bug in loading MIME::types cache where a
* David Genord (@albus522) fixed a bug in loading MIME::Types cache where a
container loaded from cache did not have the expected +default_proc+,
{#86}[https://github.com/mime-types/ruby-mime-types/pull/86].
* Richard Schneeman (@schneems) provided a patch that substantially reduces
Expand Down
19 changes: 18 additions & 1 deletion Manifest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,35 @@ Manifest.txt
README.rdoc
Rakefile
data/mime-types.json
data/mime.content_type.column
data/mime.docs.column
data/mime.encoding.column
data/mime.friendly.column
data/mime.obsolete.column
data/mime.references.column
data/mime.registered.column
data/mime.signature.column
data/mime.system.column
data/mime.use_instead.column
data/mime.xrefs.column
docs/COPYING.txt
docs/artistic.txt
lib/mime-types.rb
lib/mime/type.rb
lib/mime/type/columnar.rb
lib/mime/types.rb
lib/mime/types/cache.rb
lib/mime/types/columnar.rb
lib/mime/types/deprecations.rb
lib/mime/types/loader.rb
lib/mime/types/loader_path.rb
lib/mime/types/deprecations.rb
lib/mime/types/logger.rb
support/apache_mime_types.rb
support/benchmarks/load.rb
support/benchmarks/load_allocations.rb
support/benchmarks/object_counts.rb
support/convert.rb
support/convert/columnar.rb
support/iana_registry.rb
test/bad-fixtures/malformed
test/fixture/json.json
Expand Down
Loading

0 comments on commit e427f1c

Please sign in to comment.