mime-types 3.1 → 3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/{Code-of-Conduct.rdoc → Code-of-Conduct.md} +19 -20
- data/{Contributing.rdoc → Contributing.md} +63 -54
- data/History.md +196 -0
- data/{Licence.rdoc → Licence.md} +3 -3
- data/Manifest.txt +4 -4
- data/README.rdoc +5 -7
- data/Rakefile +5 -3
- data/lib/mime-types.rb +2 -0
- data/lib/mime/type.rb +9 -3
- data/lib/mime/type/columnar.rb +2 -0
- data/lib/mime/types.rb +7 -5
- data/lib/mime/types/_columnar.rb +2 -0
- data/lib/mime/types/cache.rb +2 -0
- data/lib/mime/types/columnar.rb +2 -0
- data/lib/mime/types/container.rb +41 -13
- data/lib/mime/types/deprecations.rb +4 -2
- data/lib/mime/types/full.rb +2 -0
- data/lib/mime/types/loader.rb +2 -4
- data/lib/mime/types/logger.rb +2 -0
- data/lib/mime/types/registry.rb +12 -3
- data/test/minitest_helper.rb +2 -0
- data/test/test_mime_type.rb +16 -3
- data/test/test_mime_types.rb +10 -0
- data/test/test_mime_types_cache.rb +15 -4
- data/test/test_mime_types_class.rb +2 -0
- data/test/test_mime_types_lazy.rb +11 -3
- data/test/test_mime_types_loader.rb +2 -0
- metadata +45 -33
- data/History.rdoc +0 -658
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 68be96a28af41a771a3173cd5acd351b1ebf3636f3f1c39f5a17ae7a5423a25a
|
4
|
+
data.tar.gz: dad93f4ca58c9d5e26850bf846692bb5d8673ab63018e9529ca79e18a964d9a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f946e0bb991ff49fa8295e781975a5bf56d865961625dc7a206654ea66679ec3d121b01a857e5dfe752457f72ac74831db08daf580db398ea8824218cfd1d65
|
7
|
+
data.tar.gz: 93fdd664aa8076662f2921bbe18f6e5c9706f1079eda29d7167d0a5df1e100711a69482aee3557fc442c213d8e639fed7377fc0af9ad95fc91d04bc7969d93cf
|
@@ -1,15 +1,15 @@
|
|
1
|
-
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
2
|
|
3
3
|
## Our Pledge
|
4
4
|
|
5
5
|
In the interest of fostering an open and welcoming environment, we as
|
6
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
|
-
|
9
|
-
experience,
|
10
|
-
identity and orientation.
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, sex characteristics, gender identity and expression,
|
9
|
+
level of experience, education, socio-economic status, nationality, personal
|
10
|
+
appearance, race, religion, or sexual identity and orientation.
|
11
11
|
|
12
|
-
|
12
|
+
## Our Standards
|
13
13
|
|
14
14
|
Examples of behavior that contributes to creating a positive environment
|
15
15
|
include:
|
@@ -31,7 +31,7 @@ Examples of unacceptable behavior by participants include:
|
|
31
31
|
* Other conduct which could reasonably be considered inappropriate in a
|
32
32
|
professional setting
|
33
33
|
|
34
|
-
|
34
|
+
## Our Responsibilities
|
35
35
|
|
36
36
|
Project maintainers are responsible for clarifying the standards of acceptable
|
37
37
|
behavior and are expected to take appropriate and fair corrective action in
|
@@ -43,32 +43,31 @@ that are not aligned to this Code of Conduct, or to ban temporarily or
|
|
43
43
|
permanently any contributor for other behaviors that they deem inappropriate,
|
44
44
|
threatening, offensive, or harmful.
|
45
45
|
|
46
|
-
|
46
|
+
## Scope
|
47
47
|
|
48
48
|
This Code of Conduct applies both within project spaces and in public spaces
|
49
49
|
when an individual is representing the project or its community. Examples of
|
50
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
|
-
|
53
|
-
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
54
|
|
55
|
-
|
55
|
+
## Enforcement
|
56
56
|
|
57
57
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
58
|
reported by contacting the project team at [INSERT EMAIL ADDRESS]. All
|
59
59
|
complaints will be reviewed and investigated and will result in a response that
|
60
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
|
-
|
63
|
-
separately.
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
64
63
|
|
65
64
|
Project maintainers who do not follow or enforce the Code of Conduct in good
|
66
65
|
faith may face temporary or permanent repercussions as determined by other
|
67
66
|
members of the project's leadership.
|
68
67
|
|
69
|
-
|
68
|
+
## Attribution
|
70
69
|
|
71
|
-
This Code of Conduct is adapted from the
|
72
|
-
|
73
|
-
|
74
|
-
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
72
|
+
|
73
|
+
[homepage]: https://www.contributor-covenant.org
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
## Contributing
|
2
2
|
|
3
3
|
I value any contribution to mime-types you can provide: a bug report, a feature
|
4
4
|
request, or code contributions.
|
@@ -6,27 +6,25 @@ request, or code contributions.
|
|
6
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
|
-
written with
|
9
|
+
written with [minitest][].
|
10
10
|
* Match my coding style.
|
11
11
|
* Use a thoughtfully-named topic branch that contains your change. Rebase your
|
12
12
|
commits into logical chunks as necessary.
|
13
|
-
* Use
|
13
|
+
* Use [quality commit messages][].
|
14
14
|
* Do not change the version number; when your patch is accepted and a release
|
15
15
|
is made, the version will be updated at that point.
|
16
16
|
* Submit a GitHub pull request with your changes.
|
17
17
|
* New or changed behaviours require new or updated documentation.
|
18
18
|
|
19
|
-
|
19
|
+
### Adding or Modifying MIME Types
|
20
20
|
|
21
21
|
The mime-types registry is no longer contained in mime-types, but in
|
22
|
-
|
23
|
-
that project for contributions there.
|
22
|
+
[mime-types-data][]. Please see that project for contributions there.
|
24
23
|
|
25
|
-
|
24
|
+
### Test Dependencies
|
26
25
|
|
27
|
-
mime-types uses Ryan Davis’s
|
28
|
-
|
29
|
-
interested in:
|
26
|
+
mime-types uses Ryan Davis’s [Hoe][] to manage the release process, and it adds
|
27
|
+
a number of rake tasks. You will mostly be interested in:
|
30
28
|
|
31
29
|
$ rake
|
32
30
|
|
@@ -39,7 +37,7 @@ will do.
|
|
39
37
|
|
40
38
|
To assist with the installation of the development dependencies for mime-types,
|
41
39
|
I have provided the simplest possible Gemfile pointing to the (generated)
|
42
|
-
|
40
|
+
`mime-types.gemspec` file. This will permit you to do:
|
43
41
|
|
44
42
|
$ bundle install
|
45
43
|
|
@@ -55,7 +53,7 @@ You can run tests with code coverage analysis by running:
|
|
55
53
|
|
56
54
|
$ rake test:coverage
|
57
55
|
|
58
|
-
|
56
|
+
### Benchmarks
|
59
57
|
|
60
58
|
mime-types offers several benchmark tasks to measure different measures of
|
61
59
|
performance.
|
@@ -68,63 +66,74 @@ built-in benchmark library.
|
|
68
66
|
|
69
67
|
There are two allocation tracing benchmarks (for normal and columnar loads).
|
70
68
|
These can only be run on Ruby 2.1 or better and requires the
|
71
|
-
|
72
|
-
installed by default).
|
69
|
+
[allocation\_tracer][] gem (not installed by default).
|
73
70
|
|
74
71
|
$ rake benchmark:allocations
|
75
72
|
$ rake benchmark:allocations:columnar
|
76
73
|
|
77
74
|
There are two loaded object count benchmarks (for normal and columnar loads).
|
78
|
-
These use
|
75
|
+
These use `ObjectSpace.count_objects`.
|
79
76
|
|
80
77
|
$ rake benchmark:objects
|
81
78
|
$ rake benchmark:objects:columnar
|
82
79
|
|
83
|
-
|
80
|
+
### Workflow
|
84
81
|
|
85
82
|
Here's the most direct way to get your work merged into the project:
|
86
83
|
|
87
84
|
* Fork the project.
|
88
|
-
* Clone down your fork (
|
89
|
-
* Create a topic branch to contain your change (
|
85
|
+
* Clone down your fork (`git clone git://github.com/<username>/ruby-mime-types.git`).
|
86
|
+
* Create a topic branch to contain your change (`git checkout -b my_awesome_feature`).
|
90
87
|
* Hack away, add tests. Not necessarily in that order.
|
91
|
-
* Make sure everything still passes by running
|
88
|
+
* Make sure everything still passes by running `rake`.
|
92
89
|
* If necessary, rebase your commits into logical chunks, without errors.
|
93
|
-
* Push the branch up (
|
90
|
+
* Push the branch up (`git push origin my_awesome_feature`).
|
94
91
|
* Create a pull request against mime-types/ruby-mime-types and describe what
|
95
92
|
your change does and the why you think it should be merged.
|
96
93
|
|
97
|
-
|
98
|
-
|
99
|
-
*
|
100
|
-
|
101
|
-
Thanks to everyone else who has contributed to mime-types:
|
102
|
-
|
103
|
-
*
|
104
|
-
*
|
105
|
-
*
|
106
|
-
*
|
107
|
-
*
|
108
|
-
*
|
109
|
-
*
|
110
|
-
*
|
111
|
-
*
|
112
|
-
*
|
113
|
-
*
|
114
|
-
*
|
115
|
-
*
|
116
|
-
*
|
117
|
-
*
|
118
|
-
*
|
119
|
-
*
|
120
|
-
*
|
121
|
-
*
|
122
|
-
*
|
123
|
-
*
|
124
|
-
*
|
125
|
-
*
|
126
|
-
*
|
127
|
-
*
|
128
|
-
*
|
129
|
-
*
|
130
|
-
*
|
94
|
+
### Contributors
|
95
|
+
|
96
|
+
* Austin Ziegler created mime-types.
|
97
|
+
|
98
|
+
Thanks to everyone else who has contributed to mime-types over the years:
|
99
|
+
|
100
|
+
* Aaron Patterson
|
101
|
+
* Aggelos Avgerinos
|
102
|
+
* Andre Pankratz
|
103
|
+
* Andy Brody
|
104
|
+
* Arnaud Meuret
|
105
|
+
* Brandon Galbraith
|
106
|
+
* Burke Libbey
|
107
|
+
* Chris Gat
|
108
|
+
* David Genord
|
109
|
+
* Dillon Welch
|
110
|
+
* Eric Marden
|
111
|
+
* Edward Betts
|
112
|
+
* Garret Alfert
|
113
|
+
* Godfrey Chan
|
114
|
+
* Greg Brockman
|
115
|
+
* Hans de Graaff
|
116
|
+
* Henrik Hodne
|
117
|
+
* Janko Marohnić
|
118
|
+
* Jeremy Evans
|
119
|
+
* Juanito Fatas
|
120
|
+
* Jun Aruga
|
121
|
+
* Łukasz Śliwa
|
122
|
+
* Keerthi Siva
|
123
|
+
* Ken Ip
|
124
|
+
* Martin d'Allens
|
125
|
+
* Mauricio Linhares
|
126
|
+
* Nicolas Leger
|
127
|
+
* nycvotes-dev
|
128
|
+
* Postmodern
|
129
|
+
* Richard Hirner
|
130
|
+
* Richard Hurt
|
131
|
+
* Richard Schneeman
|
132
|
+
* Tibor Szolár
|
133
|
+
* Todd Carrico
|
134
|
+
|
135
|
+
[minitest]: https://github.com/seattlerb/minitest
|
136
|
+
[quality commit messages]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
|
137
|
+
[mime-types-data]: https://github.com/mime-types/mime-types-data
|
138
|
+
[Hoe]: https://github.com/seattlerb/hoe
|
139
|
+
[allocation\_tracer]: https://github.com/ko1/allocation_tracer
|
data/History.md
ADDED
@@ -0,0 +1,196 @@
|
|
1
|
+
## 3.2 / 2018-08-12
|
2
|
+
|
3
|
+
* 2 minor enhancements
|
4
|
+
|
5
|
+
* Janko Marohnić contributed a change to `MIME::Type#priority_order` that
|
6
|
+
should improve on strict sorting when dealing with MIME types that
|
7
|
+
appear to be in the same family even if strict sorting would cause an
|
8
|
+
unregistered type to be sorted first. [#132][]
|
9
|
+
|
10
|
+
* Dillon Welch contributed a change that added `frozen_string_literal:
|
11
|
+
true` to files so that modern Rubies can automatically reduce duplicate
|
12
|
+
string allocations. [#135][]
|
13
|
+
|
14
|
+
* 2 bug fixes
|
15
|
+
|
16
|
+
* Burke Libbey fixed a problem with cached data loading. [#126][]
|
17
|
+
|
18
|
+
* Resolved an issue where Enumerable#inject returns +nil+ when provided
|
19
|
+
an empty enumerable and a default value has not been provided. This is
|
20
|
+
because when Enumerable#inject isn't provided a starting value, the
|
21
|
+
first value is used as the default value. In every case where this
|
22
|
+
error was happening, the result was supposed to be an array containing
|
23
|
+
Set objects so they can be reduced to a single Set. [#117][], [#127][],
|
24
|
+
[#134][].
|
25
|
+
|
26
|
+
* Fixed an uncontrolled growth bug in MIME::Types::Container where a key
|
27
|
+
miss would create a new entry with an empty Set in the container. This
|
28
|
+
was working as designed (this particular feature was heavily used
|
29
|
+
during MIME::Type registry construction), but the design was flawed in
|
30
|
+
that it did not have any way of determining the difference between
|
31
|
+
construction and querying. This would mean that, if you have a function
|
32
|
+
in your web app that queries the MIME::Types registry by extension, the
|
33
|
+
extension registry would grow uncontrollably. [#136][]
|
34
|
+
|
35
|
+
* Deprecations:
|
36
|
+
|
37
|
+
* Lazy loading (`$RUBY_MIME_TYPES_LAZY_LOAD`) has been deprecated.
|
38
|
+
|
39
|
+
* Documentation Changes:
|
40
|
+
|
41
|
+
* Supporting files are now Markdown instead of rdoc, except for the
|
42
|
+
README.
|
43
|
+
|
44
|
+
* The history file has been modified to remove all history prior to 3.0.
|
45
|
+
This history can be found in previous commits.
|
46
|
+
|
47
|
+
* A spelling error was corrected by Edward Betts ([#129][]).
|
48
|
+
|
49
|
+
* Administrivia:
|
50
|
+
|
51
|
+
* CI configuration for more modern versions of Ruby were added by Nicolas
|
52
|
+
Leger ([#130][]), Jun Aruga ([#125][]), and Austin Ziegler. Removed
|
53
|
+
ruby-head-clang and rbx (Rubinius) from CI.
|
54
|
+
|
55
|
+
* Fixed tests which were asserting equality against nil, which will
|
56
|
+
become an error in Minitest 6.
|
57
|
+
|
58
|
+
## 3.1 / 2016-05-22
|
59
|
+
|
60
|
+
* 1 documentation change:
|
61
|
+
|
62
|
+
* Tim Smith (@tas50) updated the build badges to be SVGs to improve
|
63
|
+
readability on high-density (retina) screens with pull request
|
64
|
+
[#112][].
|
65
|
+
|
66
|
+
* 3 bug fixes
|
67
|
+
|
68
|
+
* A test for `MIME::Types::Cache` fails under Ruby 2.3 because of frozen
|
69
|
+
strings, [#118][]. This has been fixed.
|
70
|
+
|
71
|
+
* The JSON data has been incorrectly encoded since the release of
|
72
|
+
mime-types 3 on the `xrefs` field, because of the switch to using a Set
|
73
|
+
to store cross-reference information. This has been fixed.
|
74
|
+
|
75
|
+
* A tentative fix for [#117][] has been applied, removing the only
|
76
|
+
circular require dependencies that exist (and for which there was code
|
77
|
+
to prevent, but the current fix is simpler). I have no way to verify
|
78
|
+
this fix and depending on how things are loaded by `delayed_job`, this
|
79
|
+
fix may not be sufficient.
|
80
|
+
|
81
|
+
* 1 governance change
|
82
|
+
|
83
|
+
* Updated to Contributor Covenant 1.4.
|
84
|
+
|
85
|
+
## 3.0 / 2015-11-21
|
86
|
+
|
87
|
+
* 2 governance changes
|
88
|
+
|
89
|
+
* This project and the related mime-types-data project are now
|
90
|
+
exclusively MIT licensed. Resolves [#95][].
|
91
|
+
|
92
|
+
* All projects under the mime-types organization now have a standard code
|
93
|
+
of conduct adapted from the [Contributor Covenant][]. This text can be
|
94
|
+
found in the [Code-of-Conduct.md][] file.
|
95
|
+
|
96
|
+
* 3 major changes
|
97
|
+
|
98
|
+
* All methods deprecated in mime-types 2.x have been removed.
|
99
|
+
|
100
|
+
* mime-types now requires Ruby 2.0 compatibility or later. Resolves
|
101
|
+
[#97][].
|
102
|
+
|
103
|
+
* The registry data has been removed from mime-types and put into
|
104
|
+
mime-types-data, maintained and released separately. It can be found at
|
105
|
+
[mime-types-data][].
|
106
|
+
|
107
|
+
* 17 minor changes:
|
108
|
+
|
109
|
+
* `MIME::Type` changes:
|
110
|
+
|
111
|
+
* Changed the way that simplified types representations are created
|
112
|
+
to reflect the fact that `x-` prefixes are no longer considered
|
113
|
+
special according to IANA. A simplified MIME type is case-folded to
|
114
|
+
lowercase. A new keyword parameter, `remove_x_prefix`, can be
|
115
|
+
provided to remove `x-` prefixes.
|
116
|
+
|
117
|
+
* Improved initialization with an Array works so that extensions do
|
118
|
+
not need to be wrapped in another array. This means that
|
119
|
+
`%w(text/yaml yaml yml)` works in the same way that
|
120
|
+
`['text/yaml', %w(yaml yml)]` did (and still does).
|
121
|
+
|
122
|
+
* Changed `priority_compare` to conform with attributes that no
|
123
|
+
longer exist.
|
124
|
+
|
125
|
+
* Changed the internal implementation of extensions to use a frozen
|
126
|
+
Set.
|
127
|
+
|
128
|
+
* When extensions are set or modified with `add_extensions`, the
|
129
|
+
primary registry will be informed of a need to reindex extensions.
|
130
|
+
Resolves [#84][].
|
131
|
+
|
132
|
+
* The preferred extension can be set explicitly. If not set, it will
|
133
|
+
be the first extension. If the preferred extension is not in the
|
134
|
+
extension list, it will be added.
|
135
|
+
|
136
|
+
* Improved how xref URLs are generated.
|
137
|
+
|
138
|
+
* Converted `obsolete`, `registered` and `signature` to
|
139
|
+
`attr_accessors`.
|
140
|
+
|
141
|
+
* `MIME::Types` changes:
|
142
|
+
|
143
|
+
* Modified `MIME::Types.new` to track instances of `MIME::Types` so
|
144
|
+
that they can be told to reindex the extensions as necessary.
|
145
|
+
|
146
|
+
* Removed `data_version` attribute.
|
147
|
+
|
148
|
+
* Changed `#[]` so that the `complete` and `registered` flags are
|
149
|
+
keywords instead of a generic options parameter.
|
150
|
+
|
151
|
+
* Extracted the class methods to a separate file.
|
152
|
+
|
153
|
+
* Changed the container implementation to use a Set instead of an
|
154
|
+
Array to prevent data duplication. Resolves [#79][].
|
155
|
+
|
156
|
+
* `MIME::Types::Cache` changes:
|
157
|
+
|
158
|
+
* Caching is now based on the data gem version instead of the
|
159
|
+
mime-types version.
|
160
|
+
|
161
|
+
* Caching is compatible with columnar registry stores.
|
162
|
+
|
163
|
+
* `MIME::Types::Loader` changes:
|
164
|
+
|
165
|
+
* `MIME::Types::Loader::PATH` has been removed and replaced with
|
166
|
+
`MIME::Types::Data::PATH` from the mime-types-data gem. The
|
167
|
+
environment variable `RUBY_MIME_TYPES_DATA` is still used.
|
168
|
+
|
169
|
+
* Support for the long-deprecated mime-types v1 format has been
|
170
|
+
removed.
|
171
|
+
|
172
|
+
* The registry is default loaded from the columnar store by default.
|
173
|
+
The internal format of the columnar store has changed; many of the
|
174
|
+
boolean flags are now loaded from a single file. Resolves [#85][].
|
175
|
+
|
176
|
+
[#79]: https://github.com/mime-types/ruby-mime-types/pull/79
|
177
|
+
[#84]: https://github.com/mime-types/ruby-mime-types/pull/84
|
178
|
+
[#85]: https://github.com/mime-types/ruby-mime-types/pull/85
|
179
|
+
[#95]: https://github.com/mime-types/ruby-mime-types/pull/95
|
180
|
+
[#97]: https://github.com/mime-types/ruby-mime-types/pull/97
|
181
|
+
[#112]: https://github.com/mime-types/ruby-mime-types/pull/112
|
182
|
+
[#117]: https://github.com/mime-types/ruby-mime-types/issues/117
|
183
|
+
[#118]: https://github.com/mime-types/ruby-mime-types/pull/118
|
184
|
+
[#125]: https://github.com/mime-types/ruby-mime-types/pull/125
|
185
|
+
[#126]: https://github.com/mime-types/ruby-mime-types/pull/126
|
186
|
+
[#127]: https://github.com/mime-types/ruby-mime-types/issues/127
|
187
|
+
[#129]: https://github.com/mime-types/ruby-mime-types/pull/129
|
188
|
+
[#130]: https://github.com/mime-types/ruby-mime-types/pull/130
|
189
|
+
[#127]: https://github.com/mime-types/ruby-mime-types/issues/127
|
190
|
+
[#132]: https://github.com/mime-types/ruby-mime-types/pull/132
|
191
|
+
[#134]: https://github.com/mime-types/ruby-mime-types/issues/134
|
192
|
+
[#135]: https://github.com/mime-types/ruby-mime-types/pull/135
|
193
|
+
[#136]: https://github.com/mime-types/ruby-mime-types/issues/136
|
194
|
+
[Code-of-Conduct.md]: Code-of-Conduct_md.html
|
195
|
+
[Contributor Covenant]: http://contributor-covenant.org
|
196
|
+
[mime-types-data]: https://github.com/mime-types/mime-types-data
|