summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAustin Ziegler <austin@zieglers.ca>2019-12-26 14:59:10 -0500
committerAustin Ziegler <austin@zieglers.ca>2019-12-26 14:59:10 -0500
commit44e6ed5a5b7697d3f7b0c0fb795d9b8e2494534b (patch)
tree6fc9102d48d2dd5742111f3aa71dbd844a6671a1
parent2969a1a788a2d891e2bd16d0027f84084835297e (diff)
downloadmime-types-44e6ed5a5b7697d3f7b0c0fb795d9b8e2494534b.tar.gz
Reformatted documentation
-rw-r--r--Code-of-Conduct.md20
-rw-r--r--Contributing.md164
-rw-r--r--History.md272
-rw-r--r--Licence.md6
4 files changed, 222 insertions, 240 deletions
diff --git a/Code-of-Conduct.md b/Code-of-Conduct.md
index 5b6ac4d..306de4e 100644
--- a/Code-of-Conduct.md
+++ b/Code-of-Conduct.md
@@ -14,21 +14,21 @@ appearance, race, religion, or sexual identity and orientation.
Examples of behavior that contributes to creating a positive environment
include:
-* Using welcoming and inclusive language
-* Being respectful of differing viewpoints and experiences
-* Gracefully accepting constructive criticism
-* Focusing on what is best for the community
-* Showing empathy towards other community members
+- Using welcoming and inclusive language
+- Being respectful of differing viewpoints and experiences
+- Gracefully accepting constructive criticism
+- Focusing on what is best for the community
+- Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
-* The use of sexualized language or imagery and unwelcome sexual attention or
+- The use of sexualized language or imagery and unwelcome sexual attention or
advances
-* Trolling, insulting/derogatory comments, and personal or political attacks
-* Public or private harassment
-* Publishing others' private information, such as a physical or electronic
+- Trolling, insulting/derogatory comments, and personal or political attacks
+- Public or private harassment
+- Publishing others' private information, such as a physical or electronic
address, without explicit permission
-* Other conduct which could reasonably be considered inappropriate in a
+- Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
diff --git a/Contributing.md b/Contributing.md
index c06ead2..405c09b 100644
--- a/Contributing.md
+++ b/Contributing.md
@@ -1,22 +1,22 @@
-## Contributing
+# Contributing
I value any contribution to mime-types you can provide: a bug report, a feature
request, or code contributions.
There are a few guidelines for contributing to mime-types:
-* Code changes *will* *not* be accepted without tests. The test suite is
+- Code changes _will_ _not_ be accepted without tests. The test suite is
written with [minitest][].
-* Match my coding style.
-* Use a thoughtfully-named topic branch that contains your change. Rebase your
+- Match my coding style.
+- Use a thoughtfully-named topic branch that contains your change. Rebase your
commits into logical chunks as necessary.
-* Use [quality commit messages][].
-* Do not change the version number; when your patch is accepted and a release
+- Use [quality commit messages][].
+- Do not change the version number; when your patch is accepted and a release
is made, the version will be updated at that point.
-* Submit a GitHub pull request with your changes.
-* New or changed behaviours require new or updated documentation.
+- Submit a GitHub pull request with your changes.
+- New or changed behaviours require new or updated documentation.
-### Adding or Modifying MIME Types
+## Adding or Modifying MIME Types
The mime-types registry is no longer contained in mime-types, but in
[mime-types-data][]. Please see that project for contributions there.
@@ -24,120 +24,106 @@ The mime-types registry is no longer contained in mime-types, but in
### Test Dependencies
mime-types uses Ryan Davis’s [Hoe][] to manage the release process, and it adds
-a number of rake tasks. You will mostly be interested in:
+a number of rake tasks. You will mostly be interested in `rake`, which runs
+the tests the same way that `rake test` or `rake travis` will do.
- $ rake
-
-which runs the tests the same way that:
-
- $ rake test
- $ rake travis
-
-will do.
-
-To assist with the installation of the development dependencies for mime-types,
-I have provided the simplest possible Gemfile pointing to the (generated)
-`mime-types.gemspec` file. This will permit you to do:
-
- $ bundle install
-
-to get the development dependencies. If you aleady have +hoe+ installed, you
-can accomplish the same thing with:
-
- $ rake newb
+To assist with the installation of the development dependencies for
+mime-types, I have provided the simplest possible Gemfile pointing to the
+(generated) `mime-types.gemspec` file. This will permit you to do `bundle
+install` to get the development dependencies. If you aleady have `hoe`
+installed, you can accomplish the same thing with `rake newb`.
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
+You can run tests with code coverage analysis by running `rake
+test:coverage`.
-### Benchmarks
+## 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.
+built-in benchmark library:
- $ rake benchmark:load
+- `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][] gem (not installed by default).
- $ rake benchmark:allocations
- $ rake benchmark:allocations:columnar
+- `rake benchmark:allocations`
+- `rake benchmark:allocations:columnar`
There are two loaded object count benchmarks (for normal and columnar loads).
These use `ObjectSpace.count_objects`.
- $ rake benchmark:objects
- $ rake benchmark:objects:columnar
+- `rake benchmark:objects`
+- `rake benchmark:objects:columnar`
-### Workflow
+## Workflow
Here's the most direct way to get your work merged into the project:
-* Fork the project.
-* Clone down your fork (`git clone git://github.com/<username>/ruby-mime-types.git`).
-* Create a topic branch to contain your change (`git checkout -b my_awesome_feature`).
-* Hack away, add tests. Not necessarily in that order.
-* Make sure everything still passes by running `rake`.
-* If necessary, rebase your commits into logical chunks, without errors.
-* Push the branch up (`git push origin my_awesome_feature`).
-* Create a pull request against mime-types/ruby-mime-types and describe what
+- Fork the project.
+- Clone down your fork (`git clone git://github.com/<username>/ruby-mime-types.git`).
+- Create a topic branch to contain your change (`git checkout -b my_awesome_feature`).
+- Hack away, add tests. Not necessarily in that order.
+- Make sure everything still passes by running `rake`.
+- If necessary, rebase your commits into logical chunks, without errors.
+- Push the branch up (`git push origin my_awesome_feature`).
+- Create a pull request against mime-types/ruby-mime-types and describe what
your change does and the why you think it should be merged.
-### Contributors
+## Contributors
-* Austin Ziegler created mime-types.
+- Austin Ziegler created mime-types.
Thanks to everyone else who has contributed to mime-types over the years:
-* Aaron Patterson
-* Aggelos Avgerinos
-* Al Snow
-* Andre Pankratz
-* Andy Brody
-* Arnaud Meuret
-* Brandon Galbraith
-* Burke Libbey
-* Chris Gat
-* David Genord
-* Dillon Welch
-* Eric Marden
-* Edward Betts
-* Garret Alfert
-* Godfrey Chan
-* Greg Brockman
-* Hans de Graaff
-* Henrik Hodne
-* Janko Marohnić
-* Jean Boussier
-* Jeremy Evans
-* Juanito Fatas
-* Jun Aruga
-* Łukasz Śliwa
-* Keerthi Siva
-* Ken Ip
-* Martin d'Allens
-* Mauricio Linhares
-* Nicolas Leger
-* Nicholas La Roux
-* nycvotes-dev
-* Olle Jonsson
-* Postmodern
-* Richard Hirner
-* Richard Hurt
-* Richard Schneeman
-* Tibor Szolár
-* Todd Carrico
+- Aaron Patterson
+- Aggelos Avgerinos
+- Al Snow
+- Andre Pankratz
+- Andy Brody
+- Arnaud Meuret
+- Brandon Galbraith
+- Burke Libbey
+- Chris Gat
+- David Genord
+- Dillon Welch
+- Eric Marden
+- Edward Betts
+- Garret Alfert
+- Godfrey Chan
+- Greg Brockman
+- Hans de Graaff
+- Henrik Hodne
+- Janko Marohnić
+- Jean Boussier
+- Jeremy Evans
+- Juanito Fatas
+- Jun Aruga
+- Łukasz Śliwa
+- Keerthi Siva
+- Ken Ip
+- Martin d'Allens
+- Mauricio Linhares
+- Nicolas Leger
+- Nicholas La Roux
+- nycvotes-dev
+- Olle Jonsson
+- Postmodern
+- Richard Hirner
+- Richard Hurt
+- Richard Schneeman
+- Tibor Szolár
+- Todd Carrico
[minitest]: https://github.com/seattlerb/minitest
[quality commit messages]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
[mime-types-data]: https://github.com/mime-types/mime-types-data
-[Hoe]: https://github.com/seattlerb/hoe
+[hoe]: https://github.com/seattlerb/hoe
[allocation\_tracer]: https://github.com/ko1/allocation_tracer
diff --git a/History.md b/History.md
index 50d5944..ca8ef20 100644
--- a/History.md
+++ b/History.md
@@ -1,216 +1,212 @@
+# Changelog
+
## 3.3.1 / 2019-12-26
-* 1 minor bugfix:
+- 1 minor bugfix:
- * Al Snow fixed a warning with MIME::Types::Logger producing a warning
- because Ruby 2.7 introduces numbered block parameters. Because of the
- way that the MIME::Types::Logger works for deprecation messages, the
- initializer parameters had been named `_1`, `_2`, and `_3`. This has
- now been resolved. [#146][]
+ - Al Snow fixed a warning with MIME::Types::Logger producing a warning
+ because Ruby 2.7 introduces numbered block parameters. Because of the way
+ that the MIME::Types::Logger works for deprecation messages, the
+ initializer parameters had been named `_1`, `_2`, and `_3`. This has now
+ been resolved. [#146][]
-* Administrivia:
+- Administrivia:
- * Olle Jonsson removed an outdated Travis configuration option (`sudo:
- false`). [#142][]
+ - Olle Jonsson removed an outdated Travis configuration option (`sudo:
+ false`). [#142][]
## 3.3 / 2019-09-04
-* 1 minor enhancement
+- 1 minor enhancement
- * Jean Boussier reduced memory usage for Ruby versions 2.3 or higher by
- interning various string values in each type. This is done with a
- backwards-compatible call that _freezes_ the strings on older
- versions of Ruby. [#141][]
+ - Jean Boussier reduced memory usage for Ruby versions 2.3 or higher by
+ interning various string values in each type. This is done with a
+ backwards-compatible call that _freezes_ the strings on older versions of
+ Ruby. [#141][]
-* Administrivia:
+- Administrivia:
- * Nicholas La Roux updated Travis build configurations. [#139][]
+ - Nicholas La Roux updated Travis build configurations. [#139][]
## 3.2.2 / 2018-08-12
-* Hiroto Fukui removed a stray `debugger` statement that I had used in
- producing v3.2.1. [#137][]
+- Hiroto Fukui removed a stray `debugger` statement that I had used in
+ producing v3.2.1. [#137][]
## 3.2.1 / 2018-08-12
-* A few bugs related to MIME::Types::Container and its use in the
- mime-types-data helper tools reared their head because I released 3.2
- before verifying against mime-types-data.
+- A few bugs related to MIME::Types::Container and its use in the
+ mime-types-data helper tools reared their head because I released 3.2
+ before verifying against mime-types-data.
## 3.2 / 2018-08-12
-* 2 minor enhancements
+- 2 minor enhancements
- * Janko Marohnić contributed a change to `MIME::Type#priority_order` that
- should improve on strict sorting when dealing with MIME types that
- appear to be in the same family even if strict sorting would cause an
- unregistered type to be sorted first. [#132][]
+ - Janko Marohnić contributed a change to `MIME::Type#priority_order` that
+ should improve on strict sorting when dealing with MIME types that appear
+ to be in the same family even if strict sorting would cause an
+ unregistered type to be sorted first. [#132][]
- * Dillon Welch contributed a change that added `frozen_string_literal:
- true` to files so that modern Rubies can automatically reduce duplicate
- string allocations. [#135][]
+ - Dillon Welch contributed a change that added `frozen_string_literal:
+ true` to files so that modern Rubies can automatically reduce duplicate
+ string allocations. [#135][]
-* 2 bug fixes
+- 2 bug fixes
- * Burke Libbey fixed a problem with cached data loading. [#126][]
+ - Burke Libbey fixed a problem with cached data loading. [#126][]
- * Resolved an issue where Enumerable#inject returns +nil+ when provided
- an empty enumerable and a default value has not been provided. This is
- because when Enumerable#inject isn't provided a starting value, the
- first value is used as the default value. In every case where this
- error was happening, the result was supposed to be an array containing
- Set objects so they can be reduced to a single Set. [#117][], [#127][],
- [#134][].
+ - Resolved an issue where Enumerable#inject returns `nil` when provided an
+ empty enumerable and a default value has not been provided. This is
+ because when Enumerable#inject isn't provided a starting value, the first
+ value is used as the default value. In every case where this error was
+ happening, the result was supposed to be an array containing Set objects
+ so they can be reduced to a single Set. [#117][], [#127][], [#134][].
- * Fixed an uncontrolled growth bug in MIME::Types::Container where a key
- miss would create a new entry with an empty Set in the container. This
- was working as designed (this particular feature was heavily used
- during MIME::Type registry construction), but the design was flawed in
- that it did not have any way of determining the difference between
- construction and querying. This would mean that, if you have a function
- in your web app that queries the MIME::Types registry by extension, the
- extension registry would grow uncontrollably. [#136][]
+ - Fixed an uncontrolled growth bug in MIME::Types::Container where a key
+ miss would create a new entry with an empty Set in the container. This
+ was working as designed (this particular feature was heavily used during
+ MIME::Type registry construction), but the design was flawed in that it
+ did not have any way of determining the difference between construction
+ and querying. This would mean that, if you have a function in your web
+ app that queries the MIME::Types registry by extension, the extension
+ registry would grow uncontrollably. [#136][]
-* Deprecations:
+- Deprecations:
- * Lazy loading (`$RUBY_MIME_TYPES_LAZY_LOAD`) has been deprecated.
+ - Lazy loading (`$RUBY_MIME_TYPES_LAZY_LOAD`) has been deprecated.
-* Documentation Changes:
+- Documentation Changes:
- * Supporting files are now Markdown instead of rdoc, except for the
- README.
+ - Supporting files are now Markdown instead of rdoc, except for the README.
- * The history file has been modified to remove all history prior to 3.0.
- This history can be found in previous commits.
+ - The history file has been modified to remove all history prior to 3.0.
+ This history can be found in previous commits.
- * A spelling error was corrected by Edward Betts ([#129][]).
+ - A spelling error was corrected by Edward Betts ([#129][]).
-* Administrivia:
+- Administrivia:
- * CI configuration for more modern versions of Ruby were added by Nicolas
- Leger ([#130][]), Jun Aruga ([#125][]), and Austin Ziegler. Removed
- ruby-head-clang and rbx (Rubinius) from CI.
+ - CI configuration for more modern versions of Ruby were added by Nicolas
+ Leger ([#130][]), Jun Aruga ([#125][]), and Austin Ziegler. Removed
+ ruby-head-clang and rbx (Rubinius) from CI.
- * Fixed tests which were asserting equality against nil, which will
- become an error in Minitest 6.
+ - Fixed tests which were asserting equality against nil, which will become
+ an error in Minitest 6.
## 3.1 / 2016-05-22
-* 1 documentation change:
+- 1 documentation change:
- * Tim Smith (@tas50) updated the build badges to be SVGs to improve
- readability on high-density (retina) screens with pull request
- [#112][].
+ - Tim Smith (@tas50) updated the build badges to be SVGs to improve
+ readability on high-density (retina) screens with pull request [#112][].
-* 3 bug fixes
+- 3 bug fixes
- * A test for `MIME::Types::Cache` fails under Ruby 2.3 because of frozen
- strings, [#118][]. This has been fixed.
+ - A test for `MIME::Types::Cache` fails under Ruby 2.3 because of frozen
+ strings, [#118][]. This has been fixed.
- * The JSON data has been incorrectly encoded since the release of
- mime-types 3 on the `xrefs` field, because of the switch to using a Set
- to store cross-reference information. This has been fixed.
+ - The JSON data has been incorrectly encoded since the release of
+ mime-types 3 on the `xrefs` field, because of the switch to using a Set
+ to store cross-reference information. This has been fixed.
- * A tentative fix for [#117][] has been applied, removing the only
- circular require dependencies that exist (and for which there was code
- to prevent, but the current fix is simpler). I have no way to verify
- this fix and depending on how things are loaded by `delayed_job`, this
- fix may not be sufficient.
+ - A tentative fix for [#117][] has been applied, removing the only circular
+ require dependencies that exist (and for which there was code to prevent,
+ but the current fix is simpler). I have no way to verify this fix and
+ depending on how things are loaded by `delayed_job`, this fix may not be
+ sufficient.
-* 1 governance change
+- 1 governance change
- * Updated to Contributor Covenant 1.4.
+ - Updated to Contributor Covenant 1.4.
## 3.0 / 2015-11-21
-* 2 governance changes
+- 2 governance changes
- * This project and the related mime-types-data project are now
- exclusively MIT licensed. Resolves [#95][].
+ - This project and the related mime-types-data project are now exclusively
+ MIT licensed. Resolves [#95][].
- * All projects under the mime-types organization now have a standard code
- of conduct adapted from the [Contributor Covenant][]. This text can be
- found in the [Code-of-Conduct.md][] file.
+ - All projects under the mime-types organization now have a standard code
+ of conduct adapted from the [Contributor Covenant][]. This text can be
+ found in the [Code-of-Conduct.md][] file.
-* 3 major changes
+- 3 major changes
- * All methods deprecated in mime-types 2.x have been removed.
+ - All methods deprecated in mime-types 2.x have been removed.
- * mime-types now requires Ruby 2.0 compatibility or later. Resolves
- [#97][].
+ - mime-types now requires Ruby 2.0 compatibility or later. Resolves
+ [#97][].
- * The registry data has been removed from mime-types and put into
- mime-types-data, maintained and released separately. It can be found at
- [mime-types-data][].
+ - The registry data has been removed from mime-types and put into
+ mime-types-data, maintained and released separately. It can be found at
+ [mime-types-data][].
-* 17 minor changes:
+- 17 minor changes:
- * `MIME::Type` changes:
+ - `MIME::Type` changes:
- * Changed the way that simplified types representations are created
- to reflect the fact that `x-` prefixes are no longer considered
- special according to IANA. A simplified MIME type is case-folded to
- lowercase. A new keyword parameter, `remove_x_prefix`, can be
- provided to remove `x-` prefixes.
+ - Changed the way that simplified types representations are created to
+ reflect the fact that `x-` prefixes are no longer considered special
+ according to IANA. A simplified MIME type is case-folded to lowercase.
+ A new keyword parameter, `remove_x_prefix`, can be provided to remove
+ `x-` prefixes.
- * Improved initialization with an Array works so that extensions do
- not need to be wrapped in another array. This means that
- `%w(text/yaml yaml yml)` works in the same way that
- `['text/yaml', %w(yaml yml)]` did (and still does).
+ - Improved initialization with an Array works so that extensions do not
+ need to be wrapped in another array. This means that `%w(text/yaml yaml
+ yml)` works in the same way that `['text/yaml', %w(yaml yml)]` did (and
+ still does).
- * Changed `priority_compare` to conform with attributes that no
- longer exist.
+ - Changed `priority_compare` to conform with attributes that no longer
+ exist.
- * Changed the internal implementation of extensions to use a frozen
- Set.
+ - Changed the internal implementation of extensions to use a frozen Set.
- * When extensions are set or modified with `add_extensions`, the
- primary registry will be informed of a need to reindex extensions.
- Resolves [#84][].
+ - When extensions are set or modified with `add_extensions`, the primary
+ registry will be informed of a need to reindex extensions. Resolves
+ [#84][].
- * The preferred extension can be set explicitly. If not set, it will
- be the first extension. If the preferred extension is not in the
- extension list, it will be added.
+ - The preferred extension can be set explicitly. If not set, it will be
+ the first extension. If the preferred extension is not in the extension
+ list, it will be added.
- * Improved how xref URLs are generated.
+ - Improved how xref URLs are generated.
- * Converted `obsolete`, `registered` and `signature` to
- `attr_accessors`.
+ - Converted `obsolete`, `registered` and `signature` to `attr_accessors`.
- * `MIME::Types` changes:
+ - `MIME::Types` changes:
- * Modified `MIME::Types.new` to track instances of `MIME::Types` so
- that they can be told to reindex the extensions as necessary.
+ - Modified `MIME::Types.new` to track instances of `MIME::Types` so that
+ they can be told to reindex the extensions as necessary.
- * Removed `data_version` attribute.
+ - Removed `data_version` attribute.
- * Changed `#[]` so that the `complete` and `registered` flags are
- keywords instead of a generic options parameter.
+ - Changed `#[]` so that the `complete` and `registered` flags are
+ keywords instead of a generic options parameter.
- * Extracted the class methods to a separate file.
+ - Extracted the class methods to a separate file.
- * Changed the container implementation to use a Set instead of an
- Array to prevent data duplication. Resolves [#79][].
+ - Changed the container implementation to use a Set instead of an Array
+ to prevent data duplication. Resolves [#79][].
- * `MIME::Types::Cache` changes:
+ - `MIME::Types::Cache` changes:
- * Caching is now based on the data gem version instead of the
- mime-types version.
+ - Caching is now based on the data gem version instead of the mime-types
+ version.
- * Caching is compatible with columnar registry stores.
+ - Caching is compatible with columnar registry stores.
- * `MIME::Types::Loader` changes:
+ - `MIME::Types::Loader` changes:
- * `MIME::Types::Loader::PATH` has been removed and replaced with
- `MIME::Types::Data::PATH` from the mime-types-data gem. The
- environment variable `RUBY_MIME_TYPES_DATA` is still used.
+ - `MIME::Types::Loader::PATH` has been removed and replaced with
+ `MIME::Types::Data::PATH` from the mime-types-data gem. The environment
+ variable `RUBY_MIME_TYPES_DATA` is still used.
- * Support for the long-deprecated mime-types v1 format has been
- removed.
+ - Support for the long-deprecated mime-types v1 format has been removed.
- * The registry is default loaded from the columnar store by default.
- The internal format of the columnar store has changed; many of the
- boolean flags are now loaded from a single file. Resolves [#85][].
+ - The registry is default loaded from the columnar store by default. The
+ internal format of the columnar store has changed; many of the boolean
+ flags are now loaded from a single file. Resolves [#85][].
[#79]: https://github.com/mime-types/ruby-mime-types/pull/79
[#84]: https://github.com/mime-types/ruby-mime-types/pull/84
@@ -235,6 +231,6 @@
[#141]: https://github.com/mime-types/ruby-mime-types/pull/141
[#142]: https://github.com/mime-types/ruby-mime-types/pull/142
[#146]: https://github.com/mime-types/ruby-mime-types/pull/146
-[Code-of-Conduct.md]: Code-of-Conduct_md.html
-[Contributor Covenant]: http://contributor-covenant.org
+[code-of-conduct.md]: Code-of-Conduct_md.html
+[contributor covenant]: http://contributor-covenant.org
[mime-types-data]: https://github.com/mime-types/mime-types-data
diff --git a/Licence.md b/Licence.md
index 5cbeeb4..d928f71 100644
--- a/Licence.md
+++ b/Licence.md
@@ -1,10 +1,10 @@
-## Licence
+# Licence
-* Copyright 2003–2019 Austin Ziegler and contributors.
+- Copyright 2003–2019 Austin Ziegler and contributors.
The software in this repository is made available under the MIT license.
-### MIT License
+## MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in