mime-types 2.99.3 → 3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.autotest +35 -0
- data/.gemtest +0 -0
- data/.gitignore +17 -0
- data/.hoerc +20 -0
- data/Code-of-Conduct.rdoc +27 -60
- data/Contributing.rdoc +0 -1
- data/History.rdoc +75 -36
- data/Licence.rdoc +2 -16
- data/Manifest.txt +10 -18
- data/README.rdoc +46 -46
- data/Rakefile +112 -58
- data/lib/mime-types.rb +0 -2
- data/lib/mime/type.rb +183 -415
- data/lib/mime/type/columnar.rb +27 -62
- data/lib/mime/types.rb +37 -135
- data/lib/mime/types/cache.rb +49 -73
- data/lib/mime/types/columnar.rb +42 -48
- data/lib/mime/types/container.rb +30 -0
- data/lib/mime/types/deprecations.rb +1 -22
- data/lib/mime/types/full.rb +17 -0
- data/lib/mime/types/loader.rb +10 -137
- data/lib/mime/types/logger.rb +2 -0
- data/lib/mime/types/registry.rb +81 -0
- data/support/benchmarks/load.rb +27 -26
- data/support/benchmarks/load_allocations.rb +14 -7
- data/support/benchmarks/object_counts.rb +6 -4
- data/support/profile/columnar.rb +5 -0
- data/support/profile/columnar_full.rb +5 -0
- data/support/profile/full.rb +5 -0
- data/test/minitest_helper.rb +3 -12
- data/test/test_mime_type.rb +461 -454
- data/test/test_mime_types.rb +126 -86
- data/test/test_mime_types_cache.rb +55 -45
- data/test/test_mime_types_class.rb +113 -97
- data/test/test_mime_types_lazy.rb +19 -23
- data/test/test_mime_types_loader.rb +5 -32
- metadata +67 -44
- data/History-Types.rdoc +0 -454
- data/data/mime-types.json +0 -1
- data/data/mime.content_type.column +0 -1980
- data/data/mime.docs.column +0 -1980
- data/data/mime.encoding.column +0 -1980
- data/data/mime.friendly.column +0 -1980
- data/data/mime.obsolete.column +0 -1980
- data/data/mime.registered.column +0 -1980
- data/data/mime.signature.column +0 -1980
- data/data/mime.use_instead.column +0 -1980
- data/data/mime.xrefs.column +0 -1980
- data/docs/COPYING.txt +0 -339
- data/docs/artistic.txt +0 -127
- data/lib/mime/types/loader_path.rb +0 -15
- data/support/apache_mime_types.rb +0 -108
- data/support/convert.rb +0 -158
- data/support/convert/columnar.rb +0 -88
- data/support/iana_registry.rb +0 -172
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7023816dbfc18473c51bed6f14864322167273fe
|
4
|
+
data.tar.gz: d29e9c15601cca71c991bc5cc1b50b31c1864d74
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e7ba49d9b78b1331085a956c9c4c6c24687e7f69443bc00370b4e233874d32d28067d9171d50d14b14ea2bd4885a9b452b6ccc0a1fd179283855aebf9a23a3d
|
7
|
+
data.tar.gz: 7aa2a2ff6b297ed18a4feb6029d30b051fcc87bcd6d7aa6be37be3b9caa15e4207756614c729322e62592ae71abc5beeafbae40959194719fb11ac8acbfde2d9
|
data/.autotest
ADDED
@@ -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
|
data/.gemtest
ADDED
File without changes
|
data/.gitignore
ADDED
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'
|
data/Code-of-Conduct.rdoc
CHANGED
@@ -1,74 +1,41 @@
|
|
1
|
-
==
|
1
|
+
== Contributor Code of Conduct
|
2
2
|
|
3
|
-
|
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
|
-
|
6
|
-
|
7
|
-
|
8
|
-
body size,
|
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
|
26
|
-
|
27
|
-
* Trolling
|
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
|
30
|
-
|
31
|
-
* Other
|
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
|
43
|
-
|
44
|
-
|
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
|
-
|
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
|
59
|
-
|
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
|
72
|
-
Covenant}[http://contributor-covenant.org], version 1.
|
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/
|
41
|
+
{http://contributor-covenant.org/version/1/2/0/}[http://contributor-covenant.org/version/1/2/0/].
|
data/Contributing.rdoc
CHANGED
data/History.rdoc
CHANGED
@@ -1,39 +1,78 @@
|
|
1
|
-
==
|
2
|
-
|
3
|
-
*
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
*
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
*
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
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
|
|
data/Licence.rdoc
CHANGED
@@ -1,16 +1,8 @@
|
|
1
1
|
== Licence
|
2
2
|
|
3
|
-
|
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
|
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.
|
data/Manifest.txt
CHANGED
@@ -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
|
-
|
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/
|
36
|
-
support/
|
37
|
-
support/
|
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
|
data/README.rdoc
CHANGED
@@ -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
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
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
|
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
|
126
|
-
the default memory footprint.
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
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
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
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
|
-
|
132
|
+
If you prefer to load all the data at once, this can be specified in your
|
133
|
+
application Gemfile as:
|
140
134
|
|
141
|
-
|
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
|
-
|
137
|
+
Projects that do not use Bundler should +require+ the same:
|
146
138
|
|
147
|
-
|
148
|
-
|
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
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
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
|
-
|
161
|
-
|
162
|
-
|
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
|
168
|
-
|
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
|
|