mime-types 2.99.3 → 3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/.autotest +35 -0
  3. data/.gemtest +0 -0
  4. data/.gitignore +17 -0
  5. data/.hoerc +20 -0
  6. data/Code-of-Conduct.rdoc +27 -60
  7. data/Contributing.rdoc +0 -1
  8. data/History.rdoc +75 -36
  9. data/Licence.rdoc +2 -16
  10. data/Manifest.txt +10 -18
  11. data/README.rdoc +46 -46
  12. data/Rakefile +112 -58
  13. data/lib/mime-types.rb +0 -2
  14. data/lib/mime/type.rb +183 -415
  15. data/lib/mime/type/columnar.rb +27 -62
  16. data/lib/mime/types.rb +37 -135
  17. data/lib/mime/types/cache.rb +49 -73
  18. data/lib/mime/types/columnar.rb +42 -48
  19. data/lib/mime/types/container.rb +30 -0
  20. data/lib/mime/types/deprecations.rb +1 -22
  21. data/lib/mime/types/full.rb +17 -0
  22. data/lib/mime/types/loader.rb +10 -137
  23. data/lib/mime/types/logger.rb +2 -0
  24. data/lib/mime/types/registry.rb +81 -0
  25. data/support/benchmarks/load.rb +27 -26
  26. data/support/benchmarks/load_allocations.rb +14 -7
  27. data/support/benchmarks/object_counts.rb +6 -4
  28. data/support/profile/columnar.rb +5 -0
  29. data/support/profile/columnar_full.rb +5 -0
  30. data/support/profile/full.rb +5 -0
  31. data/test/minitest_helper.rb +3 -12
  32. data/test/test_mime_type.rb +461 -454
  33. data/test/test_mime_types.rb +126 -86
  34. data/test/test_mime_types_cache.rb +55 -45
  35. data/test/test_mime_types_class.rb +113 -97
  36. data/test/test_mime_types_lazy.rb +19 -23
  37. data/test/test_mime_types_loader.rb +5 -32
  38. metadata +67 -44
  39. data/History-Types.rdoc +0 -454
  40. data/data/mime-types.json +0 -1
  41. data/data/mime.content_type.column +0 -1980
  42. data/data/mime.docs.column +0 -1980
  43. data/data/mime.encoding.column +0 -1980
  44. data/data/mime.friendly.column +0 -1980
  45. data/data/mime.obsolete.column +0 -1980
  46. data/data/mime.registered.column +0 -1980
  47. data/data/mime.signature.column +0 -1980
  48. data/data/mime.use_instead.column +0 -1980
  49. data/data/mime.xrefs.column +0 -1980
  50. data/docs/COPYING.txt +0 -339
  51. data/docs/artistic.txt +0 -127
  52. data/lib/mime/types/loader_path.rb +0 -15
  53. data/support/apache_mime_types.rb +0 -108
  54. data/support/convert.rb +0 -158
  55. data/support/convert/columnar.rb +0 -88
  56. data/support/iana_registry.rb +0 -172
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6fc8f9668b867116a596617ef0c7a3deb6525d4f
4
- data.tar.gz: da57ee98722d4b5cee6ae754df620202a3d4a7db
3
+ metadata.gz: 7023816dbfc18473c51bed6f14864322167273fe
4
+ data.tar.gz: d29e9c15601cca71c991bc5cc1b50b31c1864d74
5
5
  SHA512:
6
- metadata.gz: a82b94ceb52e642b263c8223a55c213220125a576d5abeaa5a72c2ad7941d967921bfc13385a300d4c02f45228d9f9f4fccb9999da6dd16ea29cf5fe8388a3a0
7
- data.tar.gz: c5411c2e67a87c342cde930311d3c3df806e2699f5e27bccd72df1c8ab4095bb81db256b787e354ab13e8ec953b8b8b3aa41b3891a6f749aa0a579419d1a133a
6
+ metadata.gz: 1e7ba49d9b78b1331085a956c9c4c6c24687e7f69443bc00370b4e233874d32d28067d9171d50d14b14ea2bd4885a9b452b6ccc0a1fd179283855aebf9a23a3d
7
+ data.tar.gz: 7aa2a2ff6b297ed18a4feb6029d30b051fcc87bcd6d7aa6be37be3b9caa15e4207756614c729322e62592ae71abc5beeafbae40959194719fb11ac8acbfde2d9
@@ -0,0 +1,35 @@
1
+ # -*- ruby -*-
2
+
3
+ require 'autotest/bundler'
4
+ require 'autotest/restart'
5
+ require 'autotest/timestamp'
6
+
7
+ def require_plugin(resource)
8
+ require resource
9
+ rescue LoadError
10
+ false
11
+ end
12
+
13
+ require_plugin 'autotest/clear'
14
+
15
+ Autotest.add_hook :initialize do |at|
16
+ # at.testlib = "minitest/unit"
17
+ #
18
+ # at.extra_files << "../some/external/dependency.rb"
19
+ #
20
+ # at.libs << ":../some/external"
21
+ #
22
+ # at.add_exception "vendor"
23
+ #
24
+ # at.add_mapping(/dependency.rb/) do |f, _|
25
+ # at.files_matching(/test_.*rb$/)
26
+ # end
27
+ #
28
+ # %w(TestA TestB).each do |klass|
29
+ # at.extra_class_map[klass] = "test/test_misc.rb"
30
+ # end
31
+ end
32
+
33
+ # Autotest.add_hook :run_command do |at|
34
+ # system "rake build"
35
+ # end
File without changes
@@ -0,0 +1,17 @@
1
+ *.md
2
+ *.swp
3
+ *~
4
+ .rake_tasks~
5
+ .source_index
6
+ .vagrant
7
+ Gemfile.lock
8
+ Vagrantfile
9
+ coverage
10
+ doc
11
+ html
12
+ pkg
13
+ publish
14
+ test/cache.tst
15
+ tmp/
16
+ .rubocop.yml
17
+ .byebug_history
data/.hoerc ADDED
@@ -0,0 +1,20 @@
1
+ ---
2
+ exclude: !ruby/regexp '/
3
+ \.(tmp|swp)$
4
+ |
5
+ (CVS|tmp)\/
6
+ |
7
+ (?i:TAGS)
8
+ |
9
+ \.(svn|git|hg|DS_Store|idea|vagrant)\/
10
+ |
11
+ Gemfile(?:\.lock)?
12
+ |
13
+ \.(rubocop|coveralls|pullreview|travis).yml$
14
+ |
15
+ \.gemspec
16
+ |
17
+ \.byebug_history
18
+ |
19
+ Vagrantfile
20
+ /x'
@@ -1,74 +1,41 @@
1
- == Contributor Covenant Code of Conduct
1
+ == Contributor Code of Conduct
2
2
 
3
- ## Our Pledge
3
+ As contributors and maintainers of this project, and in the interest of
4
+ fostering an open and welcoming community, we pledge to respect all people who
5
+ contribute through reporting issues, posting feature requests, updating
6
+ documentation, submitting pull requests or patches, and other activities.
4
7
 
5
- In the interest of fostering an open and welcoming environment, we as
6
- contributors and maintainers pledge to making participation in our project and
7
- our community a harassment-free experience for everyone, regardless of age,
8
- body size, disability, ethnicity, gender identity and expression, level of
9
- experience, nationality, personal appearance, race, religion, or sexual
10
- identity and orientation.
11
-
12
- === Our Standards
13
-
14
- Examples of behavior that contributes to creating a positive environment
15
- include:
16
-
17
- * Using welcoming and inclusive language
18
- * Being respectful of differing viewpoints and experiences
19
- * Gracefully accepting constructive criticism
20
- * Focusing on what is best for the community
21
- * Showing empathy towards other community members
8
+ We are committed to making participation in this project a harassment-free
9
+ experience for everyone, regardless of level of experience, gender, gender
10
+ identity and expression, sexual orientation, disability, personal appearance,
11
+ body size, race, ethnicity, age, religion, or nationality.
22
12
 
23
13
  Examples of unacceptable behavior by participants include:
24
14
 
25
- * The use of sexualized language or imagery and unwelcome sexual attention or
26
- advances
27
- * Trolling, insulting/derogatory comments, and personal or political attacks
15
+ * The use of sexualized language or imagery
16
+ * Personal attacks
17
+ * Trolling or insulting/derogatory comments
28
18
  * Public or private harassment
29
- * Publishing others' private information, such as a physical or electronic
30
- address, without explicit permission
31
- * Other conduct which could reasonably be considered inappropriate in a
32
- professional setting
33
-
34
- === Our Responsibilities
35
-
36
- Project maintainers are responsible for clarifying the standards of acceptable
37
- behavior and are expected to take appropriate and fair corrective action in
38
- response to any instances of unacceptable behavior.
19
+ * Publishing other's private information, such as physical or electronic
20
+ addresses, without explicit permission
21
+ * Other unethical or unprofessional conduct.
39
22
 
40
23
  Project maintainers have the right and responsibility to remove, edit, or
41
24
  reject comments, commits, code, wiki edits, issues, and other contributions
42
- that are not aligned to this Code of Conduct, or to ban temporarily or
43
- permanently any contributor for other behaviors that they deem inappropriate,
44
- threatening, offensive, or harmful.
25
+ that are not aligned to this Code of Conduct. By adopting this Code of Conduct,
26
+ project maintainers commit themselves to fairly and consistently applying these
27
+ principles to every aspect of managing this project. Project maintainers who do
28
+ not follow or enforce the Code of Conduct may be permanently removed from the
29
+ project team.
45
30
 
46
- === Scope
47
-
48
- This Code of Conduct applies both within project spaces and in public spaces
49
- when an individual is representing the project or its community. Examples of
50
- representing a project or community include using an official project e-mail
51
- address, posting via an official social media account, or acting as an
52
- appointed representative at an online or offline event. Representation of a
53
- project may be further defined and clarified by project maintainers.
54
-
55
- === Enforcement
31
+ This code of conduct applies both within project spaces and in public spaces
32
+ when an individual is representing the project or its community.
56
33
 
57
34
  Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
- reported by contacting the project team at [INSERT EMAIL ADDRESS]. All
59
- complaints will be reviewed and investigated and will result in a response that
60
- is deemed necessary and appropriate to the circumstances. The project team is
61
- obligated to maintain confidentiality with regard to the reporter of an
62
- incident. Further details of specific enforcement policies may be posted
63
- separately.
64
-
65
- Project maintainers who do not follow or enforce the Code of Conduct in good
66
- faith may face temporary or permanent repercussions as determined by other
67
- members of the project's leadership.
68
-
69
- === Attribution
35
+ reported by opening an issue or contacting one or more of the project
36
+ maintainers.
70
37
 
71
- This Code of Conduct is adapted from the {Contributor
72
- Covenant}[http://contributor-covenant.org], version 1.4,
38
+ This Code of Conduct is adapted from the
39
+ {Contributor Covenant}[http://contributor-covenant.org], version 1.2.0,
73
40
  available at
74
- {http://contributor-covenant.org/version/1/4/}[http://contributor-covenant.org/version/1/4/].
41
+ {http://contributor-covenant.org/version/1/2/0/}[http://contributor-covenant.org/version/1/2/0/].
@@ -165,6 +165,5 @@ Thanks to everyone else who has contributed to mime-types:
165
165
  * Richard Hirner
166
166
  * Richard Hurt
167
167
  * Richard Schneeman
168
- * Tao Guo
169
168
  * Tibor Szolár
170
169
  * Todd Carrico
@@ -1,39 +1,78 @@
1
- == 2.99.3 / 2016-09-10
2
-
3
- * Data release. This release reflects updates to the embedded MIME type data on
4
- the specified quarterly schedule.
5
-
6
- * Minor improvement to the support build script to only extract supported MIME
7
- type name characters from obsoletion or deprecation notes.
8
-
9
- * Removed SimpleCov from the build process. The code here is no longer
10
- changing, and its presence causes substantial breakage on Travis for Rubies
11
- that are not 2.x-compatible.
12
-
13
- == 2.99.2 / 2016-05-21
14
-
15
- * Data release. This release reflects updates to the embedded MIME type data on
16
- the specified quarterly schedule.
17
-
18
- * Minor improvement to the Rakefile, .hoerc, and Manifest to ensure that builds
19
- work correctly on Travis.
20
-
21
- * Updated to {Contributor Covenant 1.4}[Code-of-Conduct_rdoc.html].
22
-
23
- == 2.99.1 / 2016-02-21
24
-
25
- * Data release. This release reflects only updates to the embedded MIME type
26
- data on the specified quarterly schedule.
27
-
28
- == 2.99 / 2015-11-21
29
-
30
- * 1 governance change
31
-
32
- * This project now has a {Code of Conduct}[Code-of-Conduct_rdoc.html]
33
-
34
- * 1 major change
35
-
36
- * Replaced deprecated fields for MIME types with fixed empty responses.
1
+ == 3.0 / 2015-11-21
2
+
3
+ * 2 governance changes
4
+
5
+ * This project and the related mime-types-data project are now exclusively
6
+ MIT licensed. Resolves
7
+ {#95}[https://github.com/mime-types/ruby-mime-types/issues/95].
8
+
9
+ * All projects under the mime-types organization now have a standard code of
10
+ conduct adapted from the {Contributor
11
+ Covenant}[http://contributor-covenant.org]. This text can be found in the
12
+ {Code-of-Conduct.rdoc}[Code-of-Conduct_rdoc.html] file.
13
+
14
+ * 3 major changes
15
+
16
+ * All methods deprecated in mime-types 2.x have been removed.
17
+ * mime-types now requires Ruby 2.0 compatibility or later. Resolves
18
+ {#97}[https://github.com/mime-types/ruby-mime-types/issues/97].
19
+ * The registry data has been removed from mime-types and put into
20
+ mime-types-data, maintained and released separately. It can be found at
21
+ {mime-types-data}[https://github.com/mime-types/mime-types-data].
22
+
23
+ * 17 minor changes:
24
+
25
+ * MIME::Type changes:
26
+
27
+ * Changed the way that simplified types representations are creatd to
28
+ reflect the fact that +x-+ prefixes are no longer considered special
29
+ according to IANA. A simplified MIME type is case-folded to lowercase. A
30
+ new keyword parameter, +remove_x_prefix+, can be provided to remove +x-+
31
+ prefixes.
32
+ * Improved initialization with an Array works so that extensions do not
33
+ need to be wrapped in another array. This means that <tt>%w(text/yaml
34
+ yaml yml)</tt> works in the same way that <tt>['text/yaml', %w(yaml
35
+ yml)]</tt> did (and still does).
36
+ * Changed +priority_compare+ to conform with attributes that no longer
37
+ exist.
38
+ * Changed the internal implementation of extensions to use a frozen Set.
39
+ * When extensions are set or modified with +add_extensions+, the primary
40
+ registry will be informed of a need to reindex extensions. Resolves
41
+ {#84}[https://github.com/mime-types/ruby-mime-types/issues/84].
42
+ * The preferred extension can be set explicitly. If not set, it will be the
43
+ first extension. If the preferred extension is not in the extension list,
44
+ it will be added.
45
+ * Improved how xref URLs are generated.
46
+ * Converted +obsolete+, +registered+ and +signature+ to attr_accessors.
47
+
48
+ * MIME::Types changes:
49
+
50
+ * Modified MIME::Types.new to track instances of MIME::Types so that they
51
+ can be told to reindex the extensions as necessary.
52
+ * Removed +data_version+ attribute.
53
+ * Changed #[] so that the +complete+ and +registered+ flags are keywords
54
+ instead of a generic options parameter.
55
+ * Extracted the class methods to a separate file.
56
+ * Changed the container implementation to use a Set instead of an Array to
57
+ prevent data duplication. Resolves
58
+ {#79}[https://github.com/mime-types/ruby-mime-types/issues/79].
59
+
60
+ * MIME::Types::Cache changes:
61
+
62
+ * Caching is now based on the data gem version instead of the mime-types
63
+ version.
64
+ * Caching is compatible with columnar registry stores.
65
+
66
+ * MIME::Types::Loader changes:
67
+
68
+ * MIME::Types::Loader::PATH has been removed and replaced with
69
+ MIME::Types::Data::PATH from the mime-types-data gem. The environment
70
+ variable RUBY_MIME_TYPES_DATA is still used.
71
+ * Support for the long-deprecated mime-types v1 format has been removed.
72
+ * The registry is default loaded from the columnar store by default. The
73
+ internal format of the columnar store has changed; many of the boolean
74
+ flags are now loaded from a single file. Resolves
75
+ {#85}[https://github.com/mime-types/ruby-mime-types/85].
37
76
 
38
77
  == 2.6.2 / 2015-09-13
39
78
 
@@ -1,16 +1,8 @@
1
1
  == Licence
2
2
 
3
- This software is available under three licences: the GNU GPL version 2 (or at
4
- your option, a later version), the Perl Artistic License, or the MIT License.
5
- The licence preferred by me is the MIT licence.
3
+ * Copyright 2003–2015 Austin Ziegler.
6
4
 
7
- The original Perl MIME::Types was dually originally licensed with the Perl
8
- Artistic Licence and the GNU GPL ("the same terms as Perl itself") and given
9
- that the Ruby implementation originally hewed pretty closely to the Perl
10
- version, I chose to maintain the additional licensing terms.
11
-
12
- * Copyright 2003–2016 Austin Ziegler and other contributors.
13
- * Adapted from MIME::Types (Perl) by Mark Overmeer.
5
+ The software in this repository is made available under the MIT license.
14
6
 
15
7
  === MIT License
16
8
 
@@ -31,9 +23,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
31
23
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
32
24
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
33
25
  SOFTWARE.
34
-
35
- === Perl Artistic License (version 2)
36
- See the file docs/artistic.txt in the main distribution.
37
-
38
- === GNU GPL version 2
39
- See the file docs/COPYING.txt in the main distribution.
@@ -1,40 +1,32 @@
1
+ .autotest
2
+ .gemtest
3
+ .gitignore
4
+ .hoerc
1
5
  Code-of-Conduct.rdoc
2
6
  Contributing.rdoc
3
- History-Types.rdoc
4
7
  History.rdoc
5
8
  Licence.rdoc
6
9
  Manifest.txt
7
10
  README.rdoc
8
11
  Rakefile
9
- data/mime-types.json
10
- data/mime.content_type.column
11
- data/mime.docs.column
12
- data/mime.encoding.column
13
- data/mime.friendly.column
14
- data/mime.obsolete.column
15
- data/mime.registered.column
16
- data/mime.signature.column
17
- data/mime.use_instead.column
18
- data/mime.xrefs.column
19
- docs/COPYING.txt
20
- docs/artistic.txt
21
12
  lib/mime-types.rb
22
13
  lib/mime/type.rb
23
14
  lib/mime/type/columnar.rb
24
15
  lib/mime/types.rb
25
16
  lib/mime/types/cache.rb
26
17
  lib/mime/types/columnar.rb
18
+ lib/mime/types/container.rb
27
19
  lib/mime/types/deprecations.rb
20
+ lib/mime/types/full.rb
28
21
  lib/mime/types/loader.rb
29
- lib/mime/types/loader_path.rb
30
22
  lib/mime/types/logger.rb
31
- support/apache_mime_types.rb
23
+ lib/mime/types/registry.rb
32
24
  support/benchmarks/load.rb
33
25
  support/benchmarks/load_allocations.rb
34
26
  support/benchmarks/object_counts.rb
35
- support/convert.rb
36
- support/convert/columnar.rb
37
- support/iana_registry.rb
27
+ support/profile/columnar.rb
28
+ support/profile/columnar_full.rb
29
+ support/profile/full.rb
38
30
  test/bad-fixtures/malformed
39
31
  test/fixture/json.json
40
32
  test/fixture/old-data
@@ -1,4 +1,4 @@
1
- = mime-types
1
+ = mime-types for Ruby
2
2
 
3
3
  home :: https://github.com/mime-types/ruby-mime-types/
4
4
  code :: https://github.com/mime-types/ruby-mime-types/
@@ -14,19 +14,13 @@ MIME content type definitions. It can be used to determine defined filename
14
14
  extensions for MIME types, or to use filename extensions to look up the likely
15
15
  MIME type definitions.
16
16
 
17
- This is release 2.99.1, the first scheduled data update for mime-types 2.x. As
18
- of mime-types 2.99. deprecation warnings are noisy and data that has been
19
- deprecated is now no longer available. The data is both dropped from the data
20
- files and is stubbed out as empty or +nil+ values as appropriate.
21
-
22
- mime-types-2.6 was the last version of mime-types 2.x with newly available
23
- features, and mime-types 2.99 will only receive quarterly updates to the IANA
24
- registered MIME media types plus any security updates that may be required.
25
-
26
- If the loss of the deprecated data matters, be sure to set your dependency
27
- appropriately:
28
-
29
- gem 'mime-types', '~> 2.6, < 2.99'
17
+ Version 3.0 is a major release that requires Ruby 2.0 compatibility and removes
18
+ deprecated functions. The columnar registry format introduced in 2.6 has been
19
+ made the primary format; the registry data has been extracted from this library
20
+ and put into {mime-types-data}[https://github.com/mime-types/mime-types-data].
21
+ Additionally, mime-types is now licensed exclusively under the MIT licence and
22
+ there is a code of conduct in effect. There are a number of other smaller
23
+ changes described in the History file.
30
24
 
31
25
  === About MIME Media Types
32
26
 
@@ -43,8 +37,7 @@ user contributions. It conforms to RFCs 2045 and 2231.
43
37
 
44
38
  === mime-types 1.x End of Life
45
39
 
46
- mime-types 1.x has reached end of life and is no longer supported as of
47
- 2015-10-27 and will receive no updates at all.
40
+ mime-types 1.x is no longer supported as of 2015-10-27.
48
41
 
49
42
  === mime-types 2.x End of Life
50
43
 
@@ -122,50 +115,57 @@ files). A MIME::Type stores the known information about one MIME type.
122
115
 
123
116
  === Columnar Store
124
117
 
125
- mime-types 2.6 introduced an experimental columnar storage format that reduces
126
- the default memory footprint. It does this by selectively loading data. When a
127
- registry is first loaded from a columnar store, only the canonical MIME type
128
- and registered extensions will be loaded and the MIME type will be connected to
129
- its registry. When extended data is required (including +registered+,
130
- +obsolete+, and +use_instead+), that data is loaded from its own column file
131
- for all types in the registry. This load is done with a Mutex to ensure that
132
- the types are updated safely in a multithreaded environment.
118
+ mime-types uses as its primary registry storage format a columnar storage
119
+ format reducing the default memory footprint. This is done by selectively
120
+ loading the data on a per-attribute basis. When the registry is first loaded
121
+ from the columnar store, only the canonical MIME content type and known
122
+ extensions and the MIME type will be connected to its loading registry. When
123
+ other data about the type is required (including +preferred_extension+,
124
+ <tt>obsolete?</tt>, and <tt>registered?</tt>) that data is loaded from its own
125
+ column file for all types in the registry.
133
126
 
134
- Columnar storage is slated to become the default storage format for mime-types
135
- 3.0, but until that is released, the default is still to use the JSON storage
136
- format. As such, columnar storage can only currently be loaded at an
137
- application level with the following specification in the application Gemfile:
127
+ The load of any column data is performed with a Mutex to ensure that types are
128
+ updated safely in a multithreaded environment. Benchmarks show that while
129
+ columnar data loading is slower than the JSON store, it cuts the memory use by
130
+ a third over the JSON store.
138
131
 
139
- gem 'mime-types', require: 'mime/types/columnar'
132
+ If you prefer to load all the data at once, this can be specified in your
133
+ application Gemfile as:
140
134
 
141
- Projects that do not use Bundler, and libraries that wish to suggest this
142
- behaviour to applications are encouraged to require this directly, but only if
143
- you specify a dependency on mime-types 2.6.
135
+ gem 'mime-types', require: 'mime/types/full'
144
136
 
145
- require 'mime/types/columnar'
137
+ Projects that do not use Bundler should +require+ the same:
146
138
 
147
- Although this require will not be necessary after mime-types 3, it will work
148
- through at least {version
139
+ require 'mime/types/full'
140
+
141
+ Libraries that use mime-types are discouraged from choosing the JSON store.
142
+
143
+ For applications and clients that used mime-types 2.6 when the columnar store
144
+ was introduced, the require used previously will still work through at least
145
+ {version
149
146
  4}[https://github.com/mime-types/ruby-mime-types/pull/96#issuecomment-100725400]
150
- and possibly beyond.
147
+ and possibly beyond; it is effectively an empty operation. You are recommended
148
+ to change your Gemfile as soon as is practical.
149
+
150
+ require 'mime/types/columnar'
151
151
 
152
- Note that the new Columnar class (MIME::Type::Columnar) and module
153
- (MIME::Types::Columnar) are considered private variant implementations of
154
- MIME::Type and MIME::Types and the specific implementation should not be relied
155
- upon by consumers of the mime-types library. Instead, depend on the public
156
- implementations only.
152
+ Note that MIME::Type::Columnar and MIME::Types::Columnar are considered private
153
+ variant implementations of MIME::Type and MIME::Types and the specific
154
+ implementation should not be relied upon by consumers of the mime-types
155
+ library. Instead, depend on the public implementations (MIME::Type and
156
+ MIME::Types) only.
157
157
 
158
158
  === Cached Storage
159
159
 
160
- Since version 2.0, mime-types has supported a cache of MIME types based on
161
- <tt>Marshal.dump</tt>. The cache is invalidated for each released version of
162
- mime-types so that version 2.5 is not reused for version 2.6. If the
160
+ mime-types supports a cache of MIME types using <tt>Marshal.dump</tt>. The
161
+ cache is invalidated for each version of the mime-types-data gem so that data
162
+ version 3.2015.1201 will not be reused with data version 3.2016.0101. If the
163
163
  environment variable +RUBY_MIME_TYPES_CACHE+ is set to a cache file, mime-types
164
164
  will attempt to load the MIME type registry from the cache file. If it cannot,
165
165
  it will load the types normally and then saves the registry to the cache file.
166
166
 
167
- The current mime-types cache is not compatible with the columnar storage
168
- format. This will be resolved for mime-types 3.
167
+ The caching works with both full stores and columnar stores. Only the data that
168
+ has been loaded prior to saving the cache will be stored.
169
169
 
170
170
  == mime-types Modified Semantic Versioning
171
171