mime-types 2.5 → 2.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/Contributing.rdoc +72 -20
  4. data/History-Types.rdoc +11 -0
  5. data/History.rdoc +31 -1
  6. data/Manifest.txt +18 -1
  7. data/README.rdoc +142 -61
  8. data/Rakefile +59 -91
  9. data/data/mime-types.json +1 -1
  10. data/data/mime.content_type.column +1907 -0
  11. data/data/mime.docs.column +1907 -0
  12. data/data/mime.encoding.column +1907 -0
  13. data/data/mime.friendly.column +1907 -0
  14. data/data/mime.obsolete.column +1907 -0
  15. data/data/mime.references.column +1907 -0
  16. data/data/mime.registered.column +1907 -0
  17. data/data/mime.signature.column +1907 -0
  18. data/data/mime.system.column +1907 -0
  19. data/data/mime.use_instead.column +1907 -0
  20. data/data/mime.xrefs.column +1907 -0
  21. data/lib/mime/type.rb +192 -119
  22. data/lib/mime/type/columnar.rb +112 -0
  23. data/lib/mime/types.rb +39 -25
  24. data/lib/mime/types/cache.rb +41 -35
  25. data/lib/mime/types/columnar.rb +160 -0
  26. data/lib/mime/types/deprecations.rb +53 -0
  27. data/lib/mime/types/loader.rb +60 -20
  28. data/lib/mime/types/loader_path.rb +2 -3
  29. data/lib/mime/types/logger.rb +35 -0
  30. data/support/apache_mime_types.rb +8 -1
  31. data/support/benchmarks/load.rb +17 -8
  32. data/support/benchmarks/load_allocations.rb +83 -0
  33. data/support/benchmarks/object_counts.rb +41 -0
  34. data/support/convert.rb +44 -24
  35. data/support/convert/columnar.rb +90 -0
  36. data/support/iana_registry.rb +18 -8
  37. data/test/fixture/json.json +1 -1
  38. data/test/fixture/yaml.yaml +3 -6
  39. data/test/minitest_helper.rb +9 -10
  40. data/test/test_mime_type.rb +126 -62
  41. data/test/test_mime_types.rb +15 -11
  42. data/test/test_mime_types_class.rb +16 -14
  43. data/test/test_mime_types_lazy.rb +7 -1
  44. data/test/test_mime_types_loader.rb +17 -8
  45. metadata +54 -12
  46. data/lib/mime.rb +0 -51
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3023bc21b31749c2bff1ad6ee0292dc9c31bcf50
4
- data.tar.gz: e9bd5ffbd736396869836738617dd3237b0f7e5b
3
+ metadata.gz: 393ac8426babd4f63f6cd7dd13ec79df643c4dcf
4
+ data.tar.gz: 39b333003a9c9d4fe5b211893fa3f286e41cd6c4
5
5
  SHA512:
6
- metadata.gz: eebe0699ef7e179305c3af7b087e9b2d4f3e384b9d58789bb4547678ea9105d0eb6318a7c6473b520bb899b0c6f785c9315d01e9de976178722af5d12e2cce84
7
- data.tar.gz: db62f865e8b7375e970d49ace20d983946d04aad8127c241e05b2ac87623c1b654d21de313086152fa38b9aae03140eb4c793f765b6ab4d865820303fe362b35
6
+ metadata.gz: 147fe43e230dc0eba2e3197622388ee79ca26e59aa111e4eabc484dd81eb66770e1d769434656e2bccef020dcddd7af3cf5487c05ead2e04b99fde37a86ffce8
7
+ data.tar.gz: 6bda16873866db44e312bfbafe985b1fac2b482fddb0b0c03a53838a7ba691e436601e9bb37d24aafcf1cb07dfdcce2d7fabd0464a321d9a50637f35afc3ae59
data/.gitignore CHANGED
@@ -12,3 +12,4 @@ html
12
12
  pkg
13
13
  publish
14
14
  test/cache.tst
15
+ tmp/
@@ -3,7 +3,7 @@
3
3
  I value any contribution to mime-types you can provide: a bug report, a feature
4
4
  request, or code contributions.
5
5
 
6
- As mime-types is a mature codebase, there are a few guidelines:
6
+ There are a few guidelines for contributing to mime-types:
7
7
 
8
8
  * Code changes *will* *not* be accepted without tests. The test suite is
9
9
  written with {Minitest}[https://github.com/seattlerb/minitest].
@@ -18,9 +18,12 @@ As mime-types is a mature codebase, there are a few guidelines:
18
18
 
19
19
  === Adding or Modifying MIME Types
20
20
 
21
- The mime-types registry is loaded from a JSON file in +data+, but this file is
22
- not considered editable and cannot be compared in a pull request. New or
23
- modified MIME types should be edited in the appropriate YAML file under
21
+ The mime-types registry is loaded from encoded files in +data+. These are not
22
+ editable and cannot be compared meaningfully in a pull request; pull requests
23
+ that include changes to these files will require amendment to revert these
24
+ files.
25
+
26
+ New or modified MIME types should be edited in the appropriate YAML file under
24
27
  +type-lists+. The format is as shown below for the +application/xml+ MIME type
25
28
  in +type-lists/application.yml+.
26
29
 
@@ -46,7 +49,20 @@ to verify that the JSON matches the YAML changes, which is why it is not
46
49
  necessary to convert for the pull request.
47
50
 
48
51
  If you are making a change for a private fork, use <tt>rake
49
- convert:yaml:json</tt> to convert the YAML to JSON.
52
+ convert:yaml:json</tt> to convert the YAML to JSON, or <tt>rake
53
+ convert:yaml:columnar</tt> to convert it to the new columnar format.
54
+
55
+ ==== Updating Types from the IANA or Apache Lists
56
+
57
+ If you are maintaining a private fork and wish to update your copy of the MIME
58
+ types registry used by this gem, you can do this with the rake tasks:
59
+
60
+ $ rake mime:iana
61
+ $ rake mime:apache
62
+
63
+ Both of these require
64
+ {Nokogiri}[http://www.nokogiri.org/tutorials/installing_nokogiri.html], which
65
+ is not installed by default. Install it in the usual way for your Ruby.
50
66
 
51
67
  === Test Dependencies
52
68
 
@@ -77,12 +93,41 @@ can accomplish the same thing with:
77
93
  This task will install any missing dependencies, run the tests/specs, and
78
94
  generate the RDoc.
79
95
 
96
+ You can run tests with code coverage analysis by running:
97
+
98
+ $ rake test:coverage
99
+
100
+ === Benchmarks
101
+
102
+ mime-types offers several benchmark tasks to measure different measures of
103
+ performance.
104
+
105
+ There is a repeated load test, measuring how long it takes to start and load
106
+ mime-types with its full registry. By default, it runs fifty loops and uses the
107
+ built-in benchmark library.
108
+
109
+ $ rake benchmark:load
110
+
111
+ There are two allocation tracing benchmarks (for normal and columnar loads).
112
+ These can only be run on Ruby 2.1 or better and requires the
113
+ {allocation_tracer}[https://github.com/ko1/allocation_tracer] gem (not
114
+ installed by default).
115
+
116
+ $ rake benchmark:allocations
117
+ $ rake benchmark:allocations:columnar
118
+
119
+ There are two loaded object count benchmarks (for normal and columnar loads).
120
+ These use <tt>ObjectSpace.count_objects</tt>.
121
+
122
+ $ rake benchmark:objects
123
+ $ rake benchmark:objects:columnar
124
+
80
125
  === Workflow
81
126
 
82
127
  Here's the most direct way to get your work merged into the project:
83
128
 
84
129
  * Fork the project.
85
- * Clone down your fork (<tt>git clone git://github.com/<username>/mime-types.git</tt>).
130
+ * Clone down your fork (<tt>git clone git://github.com/<username>/ruby-mime-types.git</tt>).
86
131
  * Create a topic branch to contain your change (<tt>git checkout -b my\_awesome\_feature</tt>).
87
132
  * Hack away, add tests. Not necessarily in that order.
88
133
  * Make sure everything still passes by running +rake+.
@@ -97,24 +142,31 @@ Here's the most direct way to get your work merged into the project:
97
142
 
98
143
  Thanks to everyone else who has contributed to mime-types:
99
144
 
145
+ * Aaron Patterson
146
+ * Aggelos Avgerinos
100
147
  * Andre Pankratz
101
- * Mauricio Linhares
102
- * Richard Hirner
103
- * Todd Carrico
148
+ * Andy Brody
149
+ * Arnaud Meuret
150
+ * Brandon Galbraith
151
+ * Chris Gat
152
+ * David Genord
153
+ * Eric Marden
104
154
  * Garret Alfert
155
+ * Godfrey Chan
156
+ * Greg Brockman
105
157
  * Hans de Graaff
106
158
  * Henrik Hodne
107
- * Martin d'Allens
108
- * Chris Gat
109
- * Greg Brockman
110
- * Łukasz Śliwa (for the friendly names)
159
+ * Jeremy Evans
160
+ * Juanito Fatas
161
+ * Łukasz Śliwa
111
162
  * Keerthi Siva
112
- * Aaron Patterson
113
- * Godfrey Chan
114
- * Tibor Szolár
115
163
  * Ken Ip
116
- * David Genord
117
- * Juanito Fatas
118
- * Andy Brody
119
- * Aggelow Avgerinos
164
+ * Martin d'Allens
165
+ * Mauricio Linhares
166
+ * nycvotes-dev
167
+ * Postmodern
168
+ * Richard Hirner
169
+ * Richard Hurt
120
170
  * Richard Schneeman
171
+ * Tibor Szolár
172
+ * Todd Carrico
@@ -1,5 +1,16 @@
1
1
  = MIME Types Changes by Version
2
2
 
3
+ == 2.6 / 2015-05-25
4
+
5
+ * Steven Michael Thomas (@stevenmichaelthomas) added +woff2+ as an extension to
6
+ application/font-woff,
7
+ {#99}[https://github.com/mime-types/ruby-mime-types/pull/99].
8
+ * Updated the IANA media registry entries as of release date:
9
+ * Updated metadata for application/jose, application/jose\+json,
10
+ application/jwk\+json, applicatoin/jwk-set\+json, application/jwt to
11
+ reflect the adoption of RFC7519.
12
+ * Added application/vnd.balsamiq.bmpr.
13
+
3
14
  == 2.5 / 2015-04-25
4
15
 
5
16
  * Updated the IANA media registry entries as of release date:
@@ -1,7 +1,37 @@
1
+ == 2.6 / 2015-05-25
2
+
3
+ * New Feature:
4
+ * Columnar data storage for the MIME::Types registry, contributed by Jeremy
5
+ Evans (@jeremyevans). Reduces default memory use substantially (the mail
6
+ gem drops from 19 Mib to about 3 Mib). Resolves
7
+ {#96}[https://github.com/mime-types/ruby-mime-types/pull/96],
8
+ {#94}[https://github.com/mime-types/ruby-mime-types/issues/94],
9
+ {#83}[https://github.com/mime-types/ruby-mime-types/issues/83]. Partially
10
+ addresses {#64}[https://github.com/mime-types/ruby-mime-types/issues/64]
11
+ and {#62}[https://github.com/mime-types/ruby-mime-types/issues/62].
12
+ * Development:
13
+ * Removed caching of deprecation messages in preparation for mime-types 3.0.
14
+ Now, deprecated methods will always warn their deprecation instead of only
15
+ warning once.
16
+ * Added a logger for deprecation messages.
17
+ * Renamed <tt>lib/mime.rb</tt> to <tt>lib/mime/deprecations.rb</tt> to not
18
+ conflict with the {mime}[https://rubygems.org/gems/mime] gem on behalf of
19
+ the maintainers of the {Praxis Framework}[http://praxis-framework.io/].
20
+ Provided by Josep M. Blanquer (@blanquer),
21
+ {#100}[https://github.com/mime-types/ruby-mime-types/pull/100].
22
+ * Added the columnar data conversion tool, also provided by Jeremy Evans.
23
+ * Documentation:
24
+ * Improved documentation and ensured that all deprecated methods are marked
25
+ as such in the documentation.
26
+ * Development:
27
+ * Added more Ruby variants to Travis CI.
28
+ * Silenced deprecation messages for internal tools. Noisy deprecations are
29
+ noisy, but that's the point.
30
+
1
31
  == 2.5 / 2015-04-25
2
32
 
3
33
  * Bugs:
4
- * David Genord (@albus522) fixed a bug in loading MIME::types cache where a
34
+ * David Genord (@albus522) fixed a bug in loading MIME::Types cache where a
5
35
  container loaded from cache did not have the expected +default_proc+,
6
36
  {#86}[https://github.com/mime-types/ruby-mime-types/pull/86].
7
37
  * Richard Schneeman (@schneems) provided a patch that substantially reduces
@@ -10,18 +10,35 @@ Manifest.txt
10
10
  README.rdoc
11
11
  Rakefile
12
12
  data/mime-types.json
13
+ data/mime.content_type.column
14
+ data/mime.docs.column
15
+ data/mime.encoding.column
16
+ data/mime.friendly.column
17
+ data/mime.obsolete.column
18
+ data/mime.references.column
19
+ data/mime.registered.column
20
+ data/mime.signature.column
21
+ data/mime.system.column
22
+ data/mime.use_instead.column
23
+ data/mime.xrefs.column
13
24
  docs/COPYING.txt
14
25
  docs/artistic.txt
15
26
  lib/mime-types.rb
16
- lib/mime.rb
17
27
  lib/mime/type.rb
28
+ lib/mime/type/columnar.rb
18
29
  lib/mime/types.rb
19
30
  lib/mime/types/cache.rb
31
+ lib/mime/types/columnar.rb
32
+ lib/mime/types/deprecations.rb
20
33
  lib/mime/types/loader.rb
21
34
  lib/mime/types/loader_path.rb
35
+ lib/mime/types/logger.rb
22
36
  support/apache_mime_types.rb
23
37
  support/benchmarks/load.rb
38
+ support/benchmarks/load_allocations.rb
39
+ support/benchmarks/object_counts.rb
24
40
  support/convert.rb
41
+ support/convert/columnar.rb
25
42
  support/iana_registry.rb
26
43
  test/bad-fixtures/malformed
27
44
  test/fixture/json.json
@@ -18,33 +18,43 @@ MIME content types are used in MIME-compliant communications, as in e-mail or
18
18
  HTTP traffic, to indicate the type of content which is transmitted. The
19
19
  mime-types library provides the ability for detailed information about MIME
20
20
  entities (provided as an enumerable collection of MIME::Type objects) to be
21
- determined and used programmatically. There are many types defined by RFCs and
22
- vendors, so the list is long but by definition incomplete; don't hesitate to
23
- add additional type definitions (see Contributing.rdoc). The primary sources
24
- for MIME type definitions found in mime-types is the
25
- {IANA Media Types registry}[https://www.iana.org/assignments/media-types/media-types.xhtml],
26
- RFCs, and W3C recommendations. It conforms to RFCs 2045 and 2231.
27
-
28
- This is release 2.5 with a couple of bug fixes, updating to the latest IANA
29
- type registry, and adding a user-contributed type. mime-types 2.x supports Ruby
30
- 1.9.2 or later.
21
+ determined and used. There are many types defined by RFCs and vendors, so the
22
+ list is long but by definition incomplete; don't hesitate to add additional
23
+ type definitions. MIME type definitions found in mime-types are from RFCs, W3C
24
+ recommendations, the {IANA Media Types
25
+ registry}[https://www.iana.org/assignments/media-types/media-types.xhtml], and
26
+ user contributions. It conforms to RFCs 2045 and 2231.
27
+
28
+ This is release 2.6 with two new experimental features. The first new feature
29
+ is a new default registry storage format that greatly reduces the initial
30
+ memory use of the mime-types library. This feature is enabled by requiring
31
+ +mime/types/columnar+ instead of +mime/types+ with a small performance cost and
32
+ no change in *total* memory use if certain methods are called (see {Columnar
33
+ Store}[#columnar-store] for more details). The second new feature is a logger
34
+ interface that conforms to the expectations of an ActiveSupport::Logger so that
35
+ warnings can be written to an application's log rather than the default
36
+ location for +warn+. This interface may be used for other logging purposes in
37
+ the future.
38
+
39
+ mime-types 2.6 is the last planned version of mime-types 2.x, so deprecation
40
+ warnings are no longer cached but provided every time the method is called.
41
+ mime-types 2.6 supports Ruby 1.9.2 or later.
31
42
 
32
43
  === mime-types 1.x End of Life
33
44
 
34
45
  mime-types 2.0 was released in late 2013, and as of early 2015 there have been
35
46
  no reported security issues for mime-types 1.x. With the release of mime-types
36
- 2.5, I setting the formal End of Life for mime-types 1.x for 2015-10-27 (the
37
- second anniversary of the release of mime-types 2.0). After this date,
38
- absolutely no pull requests for mime-types 1.x will be accepted.
47
+ 2.5, I set the formal End of Life for mime-types 1.x for 2015-10-27 (the second
48
+ anniversary of the release of mime-types 2.0). After this date, absolutely no
49
+ pull requests for mime-types 1.x will be accepted.
39
50
 
40
51
  === mime-types Future
41
52
 
42
- Even though there are a number of issues open, it is clear to me that there are
43
- some fundamental changes that need to happen to both the data representation
44
- and the API provided by mime-types. This cannot happen under the current
45
- release, so all new development is focussing on an upcoming 3.0 release. The
46
- target for the release is on or before the beginning of RubyConf 2015
47
- (2015-11-15).
53
+ There are a number of issues open that make clear to me that there are some
54
+ fundamental changes that need to happen to both the data representation and the
55
+ API provided by mime-types. This cannot happen under the current release, so
56
+ all new development is focussing on an upcoming 3.0 release. The target for the
57
+ release is on or before the beginning of RubyConf 2015 (2015-11-15).
48
58
 
49
59
  When 3.0 is released, mime-types 2.x will receive regular updates of the IANA
50
60
  registry for two years following the release. It will also receive security
@@ -52,9 +62,15 @@ updates, if needed, for the same period. There will be no further feature
52
62
  development on mime-types 2.x following the 3.0 release.
53
63
 
54
64
  Coincident with the 3.0 release, I will release mime-types 2.99.0 that no
55
- longer imports the data to fields that have been deprecated. If they work
56
- because they derive data from that which is imported, they will continue to
57
- work. The quarterly updates will be against 2.99.x.
65
+ longer imports the data to fields that have been deprecated, or exports it if
66
+ it is present. If they work because they derive data from the data that is
67
+ still present, the will continue to work. The quarterly updates will be against
68
+ 2.99.x.
69
+
70
+ If the possible loss of this deprecated data matters, be sure to set your
71
+ dependency appropriately:
72
+
73
+ gem 'mime-types', '~> 2.6, < 2.99'
58
74
 
59
75
  == Synopsis
60
76
 
@@ -62,44 +78,109 @@ MIME types are used in MIME entities, as in email or HTTP traffic. It is useful
62
78
  at times to have information available about MIME types (or, inversely, about
63
79
  files). A MIME::Type stores the known information about one MIME type.
64
80
 
65
- require 'mime/types'
66
-
67
- plaintext = MIME::Types['text/plain'] # => [ text/plain ]
68
- text = plaintext.first
69
- puts text.media_type # => 'text'
70
- puts text.sub_type # => 'plain'
71
-
72
- puts text.extensions.join(" ") # => 'txt asc c cc h hh cpp hpp dat hlp'
73
- puts text.preferred_extension # => 'txt'
74
- puts text.friendly # => 'Text Document'
75
- puts text.i18n_key # => 'text.plain'
76
-
77
- puts text.encoding # => quoted-printable
78
- puts text.binary? # => false
79
- puts text.ascii? # => true
80
- puts text.obsolete? # => false
81
- puts text.registered? # => true
82
- puts text == 'text/plain' # => true
83
- puts 'text/plain' == text # => true
84
- puts MIME::Type.simplified('x-appl/x-zip')
85
- # => 'appl/zip'
86
-
87
- puts MIME::Types.any? { |type|
88
- type.content_type == 'text/plain'
89
- } # => true
90
- puts MIME::Types.all?(&:registered?)
91
- # => false
92
-
93
- # Various string representations of MIME types
94
-
95
- qcelp = MIME::Types['audio/QCELP'].first # => audio/QCELP
96
- puts qcelp.content_type # => 'audio/QCELP'
97
- puts qcelp.simplified # => 'audio/qcelp'
98
-
99
- xwingz = MIME::Types['application/x-Wingz'].first # => application/x-Wingz
100
- puts xwingz.content_type # => 'application/x-Wingz'
101
- puts xwingz.simplified # => 'application/wingz'
102
-
81
+ require 'mime/types'
82
+
83
+ plaintext = MIME::Types['text/plain'] # => [ text/plain ]
84
+ text = plaintext.first
85
+ puts text.media_type # => 'text'
86
+ puts text.sub_type # => 'plain'
87
+
88
+ puts text.extensions.join(' ') # => 'txt asc c cc h hh cpp hpp dat hlp'
89
+ puts text.preferred_extension # => 'txt'
90
+ puts text.friendly # => 'Text Document'
91
+ puts text.i18n_key # => 'text.plain'
92
+
93
+ puts text.encoding # => quoted-printable
94
+ puts text.default_encoding # => quoted-printable
95
+ puts text.binary? # => false
96
+ puts text.ascii? # => true
97
+ puts text.obsolete? # => false
98
+ puts text.registered? # => true
99
+ puts text.complete? # => true
100
+
101
+ puts text # => 'text/plain'
102
+
103
+ puts text == 'text/plain' # => true
104
+ puts 'text/plain' == text # => true
105
+ puts text == 'text/x-plain' # => false
106
+ puts 'text/x-plain' == text # => false
107
+
108
+ puts MIME::Type.simplified('x-appl/x-zip') # => 'appl/zip'
109
+ puts MIME::Type.i18n_key('x-appl/x-zip') # => 'appl.zip'
110
+
111
+ puts text.like?('text/x-plain') # => true
112
+ puts text.like?(MIME::Type.new('x-text/x-plain')) # => true
113
+
114
+ puts text.xrefs.inspect # => { "rfc" => [ "rfc2046", "rfc3676", "rfc5147" ] }
115
+ puts text.urls # => [ "http://www.iana.org/go/rfc2046",
116
+ # "http://www.iana.org/go/rfc3676",
117
+ # "http://www.iana.org/go/rfc5147" ]
118
+
119
+ xtext = MIME::Type.new('x-text/x-plain')
120
+ puts xtext.media_type # => 'text'
121
+ puts xtext.raw_media_type # => 'x-text'
122
+ puts xtext.sub_type # => 'plain'
123
+ puts xtext.raw_sub_type # => 'x-plain'
124
+ puts xtext.complete? # => false
125
+
126
+ puts MIME::Types.any? { |type| type.content_type == 'text/plain' } # => true
127
+ puts MIME::Types.all?(&:registered?) # => false
128
+
129
+ # Various string representations of MIME types
130
+ qcelp = MIME::Types['audio/QCELP'].first # => audio/QCELP
131
+ puts qcelp.content_type # => 'audio/QCELP'
132
+ puts qcelp.simplified # => 'audio/qcelp'
133
+
134
+ xwingz = MIME::Types['application/x-Wingz'].first # => application/x-Wingz
135
+ puts xwingz.content_type # => 'application/x-Wingz'
136
+ puts xwingz.simplified # => 'application/wingz'
137
+
138
+ === Columnar Store
139
+
140
+ mime-types 2.6 has an experimental columnar storage format that reduces the
141
+ default memory footprint. It does this by selectively loading data. When a
142
+ registry is first loaded from a columnar store, only the canonical MIME type
143
+ and registered extensions will be loaded and the MIME type will be connected to
144
+ its registry. When extended data is required (including #registered, #obsolete,
145
+ #use_instead), that data is loaded from its own column file for all types in
146
+ the registry. This load is done with a Mutex to ensure that the types are
147
+ updated safely in a multithreaded environment.
148
+
149
+ Columnar storage is slated to become the default storage format for mime-types
150
+ 3.0, but until that is released, the default is still to use the JSON storage
151
+ format. As such, columnar storage can only currently be loaded at an
152
+ application level with the following specification in the application Gemfile:
153
+
154
+ gem 'mime-types', require: 'mime/types/columnar'
155
+
156
+ Projects that do not use Bundler, and libraries that wish to suggest this
157
+ behaviour to applications are encouraged to require this directly, but only if
158
+ you specify a dependency on mime-types 2.6.
159
+
160
+ require 'mime/types/columnar'
161
+
162
+ Although this require will not be necessary after mime-types 3, it will work
163
+ through at least {version
164
+ 4}[https://github.com/mime-types/ruby-mime-types/pull/96#issuecomment-100725400]
165
+ and possibly beyond.
166
+
167
+ Note that the new Columnar class (MIME::Type::Columnar) and module
168
+ (MIME::Types::Columnar) are considered private variant implementations of
169
+ MIME::Type and MIME::Types and the specific implementation should not be relied
170
+ upon by consumers of the mime-types library. Instead, depend on the public
171
+ implementations only.
172
+
173
+ === Cached Storage
174
+
175
+ Since version 2.0, mime-types has supported a cache of MIME types based on
176
+ <tt>Marshal.dump</tt>. The cache is invalidated for each released version of
177
+ mime-types so that version 2.5 is not reused for version 2.6. If the
178
+ environment variable +RUBY_MIME_TYPES_CACHE+ is set to a cache file, mime-types
179
+ will attempt to load the MIME type registry from the cache file. If it cannot,
180
+ it will load the types normally and then saves the registry to the cache file.
181
+
182
+ The current mime-types cache is not compatible with the columnar storage
183
+ format. This will be resolved for mime-types 3.
103
184
 
104
185
  == mime-types Modified Semantic Versioning
105
186
 
@@ -129,7 +210,7 @@ In practical terms, there should be a MINOR release roughly monthly to track
129
210
  updated or changed MIME types from the official IANA registry. This does not
130
211
  indicate when new API features have been added, but all minor versions of
131
212
  mime-types 2.x will be backwards compatible; the interfaces marked deprecated
132
- will not be removed until at least mime-types 3.x or possibly later.
213
+ will be removed in mime-types 3.x.
133
214
 
134
215
  :include: Contributing.rdoc
135
216