From d5d7c57609d90c2113f4d52d29b7218b42236dcb Mon Sep 17 00:00:00 2001 From: Austin Ziegler Date: Sun, 12 Aug 2018 01:45:03 -0400 Subject: Perform some maintenance for v3.2 --- Code-of-Conduct.md | 73 +++++ Code-of-Conduct.rdoc | 74 ----- Contributing.md | 139 +++++++++ Contributing.rdoc | 130 -------- History.md | 170 +++++++++++ History.rdoc | 658 ----------------------------------------- Licence.md | 25 ++ Licence.rdoc | 25 -- Manifest.txt | 8 +- README.rdoc | 10 +- Rakefile | 6 +- lib/mime/type.rb | 2 +- lib/mime/types/deprecations.rb | 4 +- lib/mime/types/loader.rb | 4 - lib/mime/types/registry.rb | 8 +- mime-types.gemspec | 22 +- test/test_mime_types_cache.rb | 6 +- test/test_mime_types_lazy.rb | 12 +- 18 files changed, 451 insertions(+), 925 deletions(-) create mode 100644 Code-of-Conduct.md delete mode 100644 Code-of-Conduct.rdoc create mode 100644 Contributing.md delete mode 100644 Contributing.rdoc create mode 100644 History.md delete mode 100644 History.rdoc create mode 100644 Licence.md delete mode 100644 Licence.rdoc diff --git a/Code-of-Conduct.md b/Code-of-Conduct.md new file mode 100644 index 0000000..5b6ac4d --- /dev/null +++ b/Code-of-Conduct.md @@ -0,0 +1,73 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +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 + +Examples of unacceptable behavior by participants include: + +* 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 + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at [INSERT EMAIL ADDRESS]. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org diff --git a/Code-of-Conduct.rdoc b/Code-of-Conduct.rdoc deleted file mode 100644 index d7be506..0000000 --- a/Code-of-Conduct.rdoc +++ /dev/null @@ -1,74 +0,0 @@ -== Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, -body size, disability, ethnicity, gender identity and expression, level of -experience, nationality, personal appearance, race, religion, or sexual -identity and orientation. - -=== Our Standards - -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 - -Examples of unacceptable behavior by participants include: - -* 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 - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -=== Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. - -=== Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an -appointed representative at an online or offline event. Representation of a -project may be further defined and clarified by project maintainers. - -=== Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at [INSERT EMAIL ADDRESS]. All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an -incident. Further details of specific enforcement policies may be posted -separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. - -=== Attribution - -This Code of Conduct is adapted from the {Contributor -Covenant}[http://contributor-covenant.org], version 1.4, -available at -{http://contributor-covenant.org/version/1/4/}[http://contributor-covenant.org/version/1/4/]. diff --git a/Contributing.md b/Contributing.md new file mode 100644 index 0000000..4914f81 --- /dev/null +++ b/Contributing.md @@ -0,0 +1,139 @@ +## 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 + written with [minitest][]. +* 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 + 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. + +### 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. + +### 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: + + $ 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 + +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 + +### 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. + + $ 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 + +There are two loaded object count benchmarks (for normal and columnar loads). +These use `ObjectSpace.count_objects`. + + $ rake benchmark:objects + $ rake benchmark:objects:columnar + +### 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//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 + +* Austin Ziegler created mime-types. + +Thanks to everyone else who has contributed to mime-types over the years: + +* Aaron Patterson +* Aggelos Avgerinos +* 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ć +* Jeremy Evans +* Juanito Fatas +* Jun Aruga +* Łukasz Śliwa +* Keerthi Siva +* Ken Ip +* Martin d'Allens +* Mauricio Linhares +* Nicolas Leger +* nycvotes-dev +* 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 +[allocation\_tracer]: https://github.com/ko1/allocation_tracer diff --git a/Contributing.rdoc b/Contributing.rdoc deleted file mode 100644 index 3cdffa7..0000000 --- a/Contributing.rdoc +++ /dev/null @@ -1,130 +0,0 @@ -== 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 - written with {Minitest}[https://github.com/seattlerb/minitest]. -* 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}[http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html]. -* 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. - -=== Adding or Modifying MIME Types - -The mime-types registry is no longer contained in mime-types, but in -{mime-types-data}[https://github.com/mime-types/mime-types-data]. Please see -that project for contributions there. - -=== Test Dependencies - -mime-types uses Ryan Davis’s {Hoe}[https://github.com/seattlerb/hoe] to manage -the release process, and it adds a number of rake tasks. You will mostly be -interested in: - - $ 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 - -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 - -=== 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. - - $ 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}[https://github.com/ko1/allocation_tracer] gem (not -installed by default). - - $ 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 - -=== 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//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 - -* Austin Ziegler created mime-types. - -Thanks to everyone else who has contributed to mime-types: - -* Aaron Patterson -* Aggelos Avgerinos -* Andre Pankratz -* Andy Brody -* Arnaud Meuret -* Brandon Galbraith -* Chris Gat -* David Genord -* Eric Marden -* Garret Alfert -* Godfrey Chan -* Greg Brockman -* Hans de Graaff -* Henrik Hodne -* Jeremy Evans -* Juanito Fatas -* Łukasz Śliwa -* Keerthi Siva -* Ken Ip -* Martin d'Allens -* Mauricio Linhares -* nycvotes-dev -* Postmodern -* Richard Hirner -* Richard Hurt -* Richard Schneeman -* Tibor Szolár -* Todd Carrico diff --git a/History.md b/History.md new file mode 100644 index 0000000..d910fec --- /dev/null +++ b/History.md @@ -0,0 +1,170 @@ +## 3.2 / 2018-08-12 + +* 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][] + + * Dillon Welch contributed a change that added `frozen_string_literal: + true` to files so that modern Rubies can automatically reduce duplicate + string allocations. [#135][] + +* 1 bug fix + + * Burke Libbey fixed a problem with cached data loading. [#126][] + +* Deprecations: + + * Lazy loading (`$RUBY_MIME_TYPES_LAZY_LOAD`) has been deprecated. + +* Documentation Changes: + + * 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. + + * A spelling error was corrected by Edward Betts ([#129][]). + +* Administrivia: + + * CI configuration for more modern versions of Ruby were added by Nicolas + Leger ([#130][]) and Jun Aruga ([#125][]). + + * Fixed test which were asserting equality against nil, which will become + an error in Minitest 6. + +## 3.1 / 2016-05-22 + +* 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][]. + +* 3 bug fixes + + * 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. + + * 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 + + * Updated to Contributor Covenant 1.4. + +## 3.0 / 2015-11-21 + +* 2 governance changes + + * 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. + +* 3 major changes + + * All methods deprecated in mime-types 2.x have been removed. + + * 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][]. + +* 17 minor 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. + + * 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 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][]. + + * 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. + + * Converted `obsolete`, `registered` and `signature` to + `attr_accessors`. + + * `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. + + * Removed `data_version` attribute. + + * Changed `#[]` so that the `complete` and `registered` flags are + keywords instead of a generic options parameter. + + * 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][]. + + * `MIME::Types::Cache` changes: + + * Caching is now based on the data gem version instead of the + mime-types version. + + * Caching is compatible with columnar registry stores. + + * `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. + + * 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][]. + +[#112]: https://github.com/mime-types/ruby-mime-types/pull/112 +[#117]: https://github.com/mime-types/ruby-mime-types/pull/117 +[#118]: https://github.com/mime-types/ruby-mime-types/pull/118 +[#132]: https://github.com/mime-types/ruby-mime-types/pull/132 +[#135]: https://github.com/mime-types/ruby-mime-types/pull/135 +[#79]: https://github.com/mime-types/ruby-mime-types/pull/79 +[#84]: https://github.com/mime-types/ruby-mime-types/pull/84 +[#85]: https://github.com/mime-types/ruby-mime-types/pull/85 +[#95]: https://github.com/mime-types/ruby-mime-types/pull/95 +[#97]: https://github.com/mime-types/ruby-mime-types/pull/97 +[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/History.rdoc b/History.rdoc deleted file mode 100644 index 22dcf2d..0000000 --- a/History.rdoc +++ /dev/null @@ -1,658 +0,0 @@ -== 3.1 / 2016-05-22 - -* 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}[https://github.com/mime-types/ruby-mime-types/pull/112]. - -* 3 bug fixes - - * A test for MIME::Types::Cache fails under Ruby 2.3 because of frozen - strings, {#118}[https://github.com/mime-types/ruby-mime-types/issues/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. - - * A tentative fix for - {#117}[https://github.com/mime-types/ruby-mime-types/issues/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 - - * Updated to {Contributor Covenant 1.4}[Code-of-Conduct_rdoc.html]. - -== 3.0 / 2015-11-21 - -* 2 governance changes - - * This project and the related mime-types-data project are now exclusively - MIT licensed. Resolves - {#95}[https://github.com/mime-types/ruby-mime-types/issues/95]. - - * All projects under the mime-types organization now have a standard code of - conduct adapted from the {Contributor - Covenant}[http://contributor-covenant.org]. This text can be found in the - {Code-of-Conduct.rdoc}[Code-of-Conduct_rdoc.html] file. - -* 3 major changes - - * All methods deprecated in mime-types 2.x have been removed. - * mime-types now requires Ruby 2.0 compatibility or later. Resolves - {#97}[https://github.com/mime-types/ruby-mime-types/issues/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}[https://github.com/mime-types/mime-types-data]. - -* 17 minor changes: - - * MIME::Type changes: - - * Changed the way that simplified types representations are creatd 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). - * Changed +priority_compare+ to conform with attributes that no longer - exist. - * 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}[https://github.com/mime-types/ruby-mime-types/issues/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. - * Improved how xref URLs are generated. - * Converted +obsolete+, +registered+ and +signature+ to attr_accessors. - - * 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. - * Removed +data_version+ attribute. - * Changed #[] so that the +complete+ and +registered+ flags are keywords - instead of a generic options parameter. - * 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}[https://github.com/mime-types/ruby-mime-types/issues/79]. - - * MIME::Types::Cache changes: - - * Caching is now based on the data gem version instead of the mime-types - version. - * Caching is compatible with columnar registry stores. - - * 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. - * 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}[https://github.com/mime-types/ruby-mime-types/85]. - -== 2.6.2 / 2015-09-13 - -* Bugs: - * Emilio Losada (@losadaem) fixed an error where +each_with_object+'s block - parameters are the inverse of those used by +inject+. Resolves - {#107}[https://github.com/mime-types/ruby-mime-types/issues/107] with pull - request {#108}[https://github.com/mime-types/ruby-mime-types/pull/108]. - * Matt Beedle (@mattbeedle) fixed a typo in MIME::Type::Columnar negatively - affecting people who use the +use_instead+ functionality. Resolved in - {#109}[https://github.com/mime-types/ruby-mime-types/pull/109]. -* Documentation: - * Juanito Fatas (@JuanitoFatas) fixed a documentation issue with the README - not properly linking internally on the generated rdoc source. Resolved with - {#105}[https://github.com/mime-types/ruby-mime-types/pull/105]. -* Development: - * Fixed a minor issue in the IANA registry parser that would generate empty - +text+ xrefs if the +text+ section was empty. - -== 2.6.1 / 2015-05-25 - -* Bugs: - * Make columnar store handle all supported extensions, not just the first. - Resolved in {#103}[https://github.com/mime-types/ruby-mime-types/pull/103] - by Jeremy Evans (@jeremyevans). - * Avoid circular require when using the columnar store. Resolved in - {#102}[https://github.com/mime-types/ruby-mime-types/pull/102] by - Jeremy Evans (@jeremyevans). - -== 2.6 / 2015-05-25 - -* New Feature: - * Columnar data storage for the MIME::Types registry, contributed by Jeremy - Evans (@jeremyevans). Reduces default memory use substantially (the mail - gem drops from 19 Mib to about 3 Mib). Resolves - {#96}[https://github.com/mime-types/ruby-mime-types/pull/96], - {#94}[https://github.com/mime-types/ruby-mime-types/issues/94], - {#83}[https://github.com/mime-types/ruby-mime-types/issues/83]. Partially - addresses {#64}[https://github.com/mime-types/ruby-mime-types/issues/64] - and {#62}[https://github.com/mime-types/ruby-mime-types/issues/62]. -* Development: - * Removed caching of deprecation messages in preparation for mime-types 3.0. - Now, deprecated methods will always warn their deprecation instead of only - warning once. - * Added a logger for deprecation messages. - * Renamed lib/mime.rb to lib/mime/deprecations.rb to not - conflict with the {mime}[https://rubygems.org/gems/mime] gem on behalf of - the maintainers of the {Praxis Framework}[http://praxis-framework.io/]. - Provided by Josep M. Blanquer (@blanquer), - {#100}[https://github.com/mime-types/ruby-mime-types/pull/100]. - * Added the columnar data conversion tool, also provided by Jeremy Evans. -* Documentation: - * Improved documentation and ensured that all deprecated methods are marked - as such in the documentation. -* Development: - * Added more Ruby variants to Travis CI. - * Silenced deprecation messages for internal tools. Noisy deprecations are - noisy, but that's the point. - -== 2.5 / 2015-04-25 - -* Bugs: - * David Genord (@albus522) fixed a bug in loading MIME::Types cache where a - container loaded from cache did not have the expected +default_proc+, - {#86}[https://github.com/mime-types/ruby-mime-types/pull/86]. - * Richard Schneeman (@schneems) provided a patch that substantially reduces - unnecessary allocations. -* Documentation: - * Tibor Szolár (@flexik) fixed a typo in the README, - {#82}[https://github.com/mime-types/ruby-mime-types/pull/82] - * Fixed {#80}[https://github.com/mime-types/ruby-mime-types/issues/80], - clarifying the relationship of MIME::Type#content_type and - MIME::Type#simplified, with Ken Ip (@kenips). -* Development: - * Juanito Fatas (@JuanitoFatas) enabled container mode on Travis CI, - {#87}[https://github.com/mime-types/ruby-mime-types/pull/87]. -* Moved development to a mime-types organization under - {mime-types/ruby-mime-types}[https://github.com/mime-types/ruby-mime-types]. - -== 2.4.3 / 2014-10-21 - -* Bugs: - * Restored Ruby 1.9.2 support by using +private_constant+ conditionally. - Fixes {#77}[https://github.com/mime-types/ruby-mime-types/issues/77] found by - Kris Leech (@krisleech). The conditional use of +private_constant+ here - will be removed for mime-types 3.0, when Ruby 1.9.2 support will be - unconditionally removed. - -== 2.4.2 / 2014-10-15 - -* Bugs: - * Aaron Patterson (@tenderlove) found a loading bug and provided a fix that - nearly doubled registry load performance - ({#74}[https://github.com/mime-types/ruby-mime-types/pull/74]). - * Godfrey Chan (@chancancode) provided a prophylactic security fix to use - JSON.parse instead of JSON.load in - {#75}[https://github.com/mime-types/ruby-mime-types/pull/75]. This provides a - 20% improvement over the already improved result, resulting in a total 55% - performance boost. - -== 2.4.1 / 2014-10-07 - -mime-types 2.4 was pulled. - -* Bugs: - * Restored the extension sort order from mime-types 1.25.1 and modified - MIME::Type#extensions= to no longer sort extensions when set. This resolves - {#71}[https://github.com/mime-types/ruby-mime-types/issues/71] and should fix - Paperclip. -* API Changes: - * Added MIME::Type#preferred_extension to return the preferred extension for - the MIME type. This should be used in preference to the current mechanism - used by many clients, type.extensions.first. This will allow the - implementation to change over time. - * Added MIME::Type#friendly based on the concept presented by Łukasz Śliwa’s - {friendly_mime}[https://github.com/lukaszsliwa/friendly_mime] gem. The - initial English data for this is pulled from +friendly_mime+. - * Added MIME::Type#i18n_key and MIME::Type.i18n_key to represent and convert - MIME content types as translation keys for the I18n library. - -* MIME Type Development Tools: - * Adding documentation to conversion methods. - * Adding some robustness to missing Nokogiri support. - * Extending coverage to fully cover new code. Tests now cover all of - mime-types. - -== 2.3 / 2014-05-23 - -* Bugs: - * Fixed a bug in MIME::Types#type_for where type specifications that - did not match a MIME::Type would be returned as +nil+ inside the returned - array. This was incorrect behaviour as those values should not have been - returned, resulting in an empty array. -* MIME Type Development Tools: - * As always, there are bugs in the IANA registry because it's manually - maintained. Some robustness has been added to properly writing file - template references where the file template reference is not a full media - type specification (e.g., 'amr-wb\+' instead of 'audio/amr-wb\+'). - * Both the IANA and Apache import tools were unnecessarily case-sensitive in - matching against already-existing MIME types, resulting in extra work to - weed out duplicates that differed only in the case of the canonical content - type. This has been fixed. - -== 2.2 / 2014-03-14 - -* Clarified contribution guidelines for MIME types. Resolves - {#57}[https://github.com/mime-types/ruby-mime-types/issues/57]. -* Fixed a small bug where deprecated methods would warn of deprecation when - called by internal methods. Resolves - {#60}[https://github.com/mime-types/ruby-mime-types/issues/60]. -* Dropped Code Climate; added Coveralls for test coverage reports. -* Removing external references to RubyForge, as it is shutting down. Resolves - {#59}[https://github.com/mime-types/ruby-mime-types/issues/59]. - -== 2.1 / 2014-01-25 - -* API Changes (MIME::Type): - * Added MIME::Type#xrefs and MIME::Type#xref_urls that have better handling - of types of reference information. MIME::Type#references= has been - deprecated. In a future release, both MIME::Type#references will be turned - into a short-hand view on MIME::Type#xrefs, MIME::Type#urls will be an - alias for MIME::Type#xref_urls, and MIME::Type#references= will be removed. -* New or Updated MIME Types: - * This information is now tracked in History-Types.rdoc. -* MIME Type Development Tools: - * The IANA registry format changed, breaking the IANA registry tool - previously used. Rewrote IANADownloader and IANADownloader::Parser as - IANARegistryParser using the XML form. - * The LTSW list has been dropped as it has not been updated since 2002. - * The default Apache MIME types configuration list is now used to enrich MIME - type data with additional extension information. - -== 2.0 / 2013-10-27 - -* API Changes (General): - * mime-types is no longer compatible with Ruby 1.8. Additionally, for its - YAML operations (normally development and test), it requires a YAML parser - that conforms to the Psych parser, not the Syck parser. This would only be - a problem with an alternative Ruby 1.9.2 interpreter that does not - implement the Psych parser conventions by requiring +psych+. - * MIME::InvalidContentType has been renamed to - MIME::Type::InvalidContentType. -* API Changes (MIME::Type): - * Construction of a MIME::Type can be with any of the following objects: - * An array containing a valid content type identifier and an optional array - of extensions. This allows MIME::Type.new to be used instead of - MIME::Type.from_array for the most common use-case. Fixes - {#43}[https://github.com/mime-types/ruby-mime-types/pull/43]. - * A Hash containing the output of MIME::Type#to_h, as would be deserialized - from the JSON representation of a MIME::Type. This replaces - MIME::Type.from_hash using a different parameter set. - * Another MIME::Type. - * A content type identifier string. - * Assignment of an invalid encoding to MIME::Type#encoding= will raise a - MIME::Type::InvalidEncoding exception rather than a plain ArgumentError. - * MIME::Type#url has been renamed to MIME::Type#references. - * MIME::Type#use_instead is now tracked as its own attribute, not as part of - MIME::Type#docs. - * MIME::Type#system, MIME::Type#system?, MIME::Type#platform?, - MIME::Type#to_a, MIME::Type#to_hash, MIME::Type.from_array, - MIME::Type.from_hash, and MIME::Type.from_mime_type have been deprecated - for removal. - * Implemented YAML object encoding and decoding methods, - MIME::Type#encode_with and MIME::Type#init_with. - * Implemented JSON hash encoding methods. - * Added MIME::Type#add_extensions to easily add extensions to a MIME::Type. - Fixes {#44}[https://github.com/mime-types/ruby-mime-types/pull/44]. -* API Changes (MIME::Types): - * MIME type caching has been extracted to its own class. It is structurally - similar to what was introduced with mime-types 1.25, but is no longer - considered an experimental interface. - * MIME type loading has been extracted to its own class. Loading has changed - substantially. - * MIME::Types#[] accepts a new filter flag, :registered. The :platform flag - has been deprecated. - * The MIME::Types#type_for platform parameter has been deprecated. - * Added the ability for MIME::Types#type_for produce results for multiple - filenames or extensions by providing an array as the first parameter. Fixes - {#42}[https://github.com/mime-types/ruby-mime-types/pull/42]. - * MIME::Types#add_type_variant and MIME::Types#index_extensions have been - deprecated as public methods. They will be private in a future version. - * MIME::Types#defined_types, MIME::Types.cache_file, - MIME::Types.add_type_variant, and MIME::Types.index_extensions have been - deprecated for removal. -* Default Registry Changes: - * The default registry is now a file in the directory data/, located via - MIME::Types::Loader::PATH. +PATH+ is defined in the file - lib/mime/types/path.rb so that system packagers only have to modify one - file in order to put the registry in a location that is not where a gem - version of mime-types would expect it. This resolves issue - {#36}[https://github.com/mime-types/ruby-mime-types/pull/36], reported by - @postmodern. - * The default registry is now a single file in JSON format. This resolves - issue {#28}[https://github.com/mime-types/ruby-mime-types/pull/28] reported - by @jasonlor (an error with mime-types in MacRuby). - * The default registry is compiled from YAML files in type-lists/, resolving - issue {#37}[https://github.com/mime-types/ruby-mime-types/pull/37] - reported by @postmodern requesting an easier-to-edit format. -* New or Updated MIME Types: - * Major updates to the registered MIME type list from IANA using the improved - developer tools. - * Added: - * application/xhtml\+xml (HTML5) - * multipart/x-mixed-replace (HTML5) - * application/vnd.apple.pkpass (Apple PassBook) with extension pkpass. - * Modified: - * application/gzip (RFC6713) added extension (gz) and encoding. - * application/epub\+zip is not a registered MIME type. - * application/rss\+xml is not a registered MIME type. - * application/x-director reported incorrect extensions. - * application/x-gzip marked as obsolete (use application/gzip instead). - * application/x-maker marked as obsolete (use application/vnd.framemaker - instead). - * image/webp is not a registered MIME type; added a URL to Google's - proposed standard document. - * text/html added URL to the HTML5 specification. - * text/cache-manifest added URL to the HTML5 specification. - * text/plain (VMS .doc files) marked as non-standard. This type will be - merged with the standard text/plain type in a future release. - * Added md, markdown, rst, and textile extensions to text/plain. -* MIME Type Development Tools: - * The benchmarking task has been moved mostly to support/benchmarker.rb. - * A task for SimpleCov coverage has been added (rake test:coverage). - * IANA type registry downloading has been substantially improved and the - implementation no longer resides in the Rakefile; it has instead been moved - to support/iana_downloader.rb. This takes advantage of the new YAML - encoding functionality to update added or modified MIME types - non-destructively in type-lists/ by default. - * Rake tasks convert:yaml:json and convert:json:yaml - provide functionality to convert the human-editable YAML format in - type-lists/ to the JSON format in data/ and vice-versa. - This is powered by support/convert.rb. - -== 1.25 / 2013-08-30 - -* New Features: - * Adding lazy loading and caching functionality to the default data based on - work done by Greg Brockman (gdb). -* Bugs: - * Force the default internal application encoding to be used when reading the - MIME types database. Based on a change by briangamble, found in the rapid7 - fork. -* New extensions: - * mjpeg (video/x-motion-jpeg) based on a change by punkrats, found in the - vidibus fork. -* Modernized Minitest configuration. - -== 1.24 / 2013-08-14 - -* Code Climate: - * Working on improving the quality of the mime-types codebase through the use - of Code Climate. - * Simplified MIME::Type.from_array to make more assumptions about assignment. -* Documentation: - * LeoYoung pointed out that the README.rdoc contained - examples that could never possibly work because MIME::Types#[] returns (for - all the versions I have handy) an array, not a single type. I have updated - README.rdoc to reflect this. -* Removed Nokogiri as a declared development dependency. It is still required - if you're going to use the IANA parser functionality, but it is not necessary - for most development purposes. This has been removed to ensure that Travis CI - passes on Ruby 1.8.7. -* New MIME Types: - * 7zip (application/x-7z-compressed). Fixes a request by @kodram. - {#32}[https://github.com/mime-types/ruby-mime-types/issues/32] - * application/x-www-form-urlencoded. Fixes a request by @alexkwolfe. - {#39}[https://github.com/mime-types/ruby-mime-types/issues/39] - * Various new MIME types from IANA: - * application/mbms-schedule\+xml from 3GPP and Turcotte. - * application/provenance\+xml from W3C and Herman. - * application/session-info from 3GPP and Firmin. - * application/urc-grpsheet\+xml, application/urc-targetdesc\+xml, - application/uisocketdesc\+xml from Zimmermann. - * application/api\+json from Klabnik. - * application/vnd.etsi.pstn\+xml from Han and Belling. - * application/vnd.fujixerox.docuworks.container from Tashiro. - * application/vnd.windows.devicepairing from Dandawate. - * video/vnd.radgamettools.bink and video/vnd.radgamettools.smacker from - Andersson. -* Updated MIME Types: - * RFC 6960 was adopted (application/ocsp-request and application/ocsp-response). - -== 1.23 / 2013-04-20 - -* New Feature: - * Arnaud Meuret (@ameuret) suggested that it could be useful if the MIME type - collection was enumerable, so he implemented it in - {#30}[https://github.com/mime-types/ruby-mime-types/pull/30]. Thanks for - the contribution! -* Updated MIME Types: - * RFC6910 was adopted (application/call-completion). - * RFC6902 was adopted (application/json-patch\+json). - * RFC6917 was adopted (application/mrb-consumer\+xml, - application/mrb-publish\+xml). - * RFC6922 was adopted (application/sql). - * RFC2560 is being - {updated}[http://tools.ietf.org/html/draft-ietf-pkix-rfc2560bis]. -* Administrivia: - * The gemspec now includes information about the licenses under which the - mime-types gem is available. - * Using hoe-gemspec2 instead of hoe-gemspec. - -== 1.22 / 2013-03-30 - -* New MIME Types: - * Added support for 3FR (Hasselblad raw images) files. MIME-Type was obtained - by looking at exif data with exiftool. Thanks to cgat for these changes. - {#27}[https://github.com/mime-types/ruby-mime-types/pull/27] -* Updated MIME Types: - * Pulled the latest updates from the IANA MIME-Type registry. -* Added support for Ruby 2.0 with Travis CI. - -== 1.21 / 2013-02-09 - -* New MIME Types: - * Various new or updated MIME types by Garret Alfert: - application/vnd.ms-fontobject, .eot; application/x-chrome-extension, .crx; - application/x-web-app-manifest\+json, .webapp; application/x-xpinstall, - .xpi; image/svg\+xml, .svg, .svgz; image/webp, .webp; text/cache-manifest, - .appcache, .manifest. - #{24}[https://github.com/mime-types/ruby-mime-types/pull/24] -* Fixed some Manifest.txt related madness on Travis. - -== 1.20.1 / 2013-01-26 - -* New MIME Types: - * Apple iWork document types added by Hans de Graaff - (application/x-iwork-keynote-sffkey, .key; - application/x-iwork-pages-sffpages, .pages; - application/x-iwork-numbers-sffnumbers, .numbers). - {#20}[https://github.com/mime-types/ruby-mime-types/issue/20] - * epub, ibooks, mobi, and DMG content types by Mauricio - Linhares (mac:application/x-apple-diskimage, .dmg; application/epub\+zip, - .epub; application/x-ibooks\+zip, .ibooks; application/x-mobipocket-ebook, - .mobi). {#22}[https://github.com/mime-types/ruby-mime-types/issue/22] - * rss content type by Garret Alfert (application/rss\+xml, .rss). - {#23}[https://github.com/mime-types/ruby-mime-types/issue/23] - * Added or updated MIME types from the latest IANA list. -* Fixed MIME Types: - * Excel macro-enabled spreadsheets had an incorrect extension. Thanks to - Rafael Belvederese for reporting this issue. - {#21}[https://github.com/mime-types/ruby-mime-types/issue/21] -* Enabled for use with travis. -* Enabled gem signing. -* Fixed an error related to MIME type downloads. -* This was previously published as 1.20, but I had forgotten some attributions. - -== 1.19 / 2012-06-20 -* New MIME Types: - * XCF Gnome Images (image/x-xcf, image/x-compressed-xcf; .xcf). - {#17}[https://github.com/mime-types/ruby-mime-types/issue/17] - * Types reported in - {#12}[https://github.com/mime-types/ruby-mime-types/issues/12]: - * DV (video/x-dv; .dv) - * IVF (video/x-ivf; .ivf) - * Matroska (video/x-matroska; .mkv) - * Motion JPEG (video/x-motion-jpeg; .mjpg) - * RealMedia (official; application/vnd.rn-realmedia; .rm) -* New extensions: - * dcm (application/dicom); - {#16}[https://github.com/mime-types/ruby-mime-types/issue/16]. - * Types reported in - {#12}[https://github.com/mime-types/ruby-mime-types/issues/12]: - * 3g2, 3gpp2 (video/3gpp2) - * mpeg (video/mpeg) - * mxf (application/mxf) - * ts (video/MP2T) - * ogg (video/ogg) -* Fixed MIME Types: - * Adobe AIR application installer packages was missing a hyphen. - {#13}[https://github.com/mime-types/ruby-mime-types/issue/13] - * Types reported in - {#12}[https://github.com/mime-types/ruby-mime-types/issues/12]: - * audio/x-pn-realaudio extension is .ra, not .rm. -* Resolved {#8}[https://github.com/mime-types/ruby-mime-types/issues/8]. - Apparently some people run the tests on Linux. Imagine that. - -== 1.18 / 2012-03-20 -* New MIME Types: - * Types reported in - #{6}[https://github.com/mime-types/ruby-mime-types/issues/6]: - * CoffeeScript (text/x-coffeescript; .coffee; 8bit). - * AIR (application/vnd.adobe.air-applicationinstaller-package\+zip, .air; base64). - * WOFF (application/font-woff; .woff; base64). - * TrueType (application/x-font-truetype; .ttf; base64). - * OpenType (application/x-font-opentype; .otf; base64). - * WebM (audio/webm, video/webm; .webm). - {#11}[https://github.com/mime-types/ruby-mime-types/issues/11.] -* New extensions: - * f4v/f4p (video/mp4, used by Adobe); f4a/fb4 (audio/mp4, used by Adobe). -* Bug Fixes: - * It was pointed out that Licence.txt was incorrectly named. Fixed by - renaming to Licence.rdoc (from Issue/Pull Request - {#8}[https://github.com/mime-types/ruby-mime-types/issues/8]). - * It was pointed out that a plan to have the test output generated - automatically never went through. - {#10}[https://github.com/mime-types/ruby-mime-types/issues/10] - -== 1.17.2 / 2011-10-25 -* Bug Fixes: - * Fixed an issue with Ruby 1.9 and file encoding. - -== 1.17.1 / 2011-10-23 -* Minor Enhancements: - * Implemented modern 'hoe' semantics. - * Switched to minitest instead of test/unit. - * Converted documentation from .txt to .rdoc. - * Removed setup.rb. - {#3}[https://github.com/mime-types/ruby-mime-types/issues/3] - * Should no longer complain about missing RubyGems keys - {#2}[https://github.com/mime-types/ruby-mime-types/issues/2] - * Added .mp4 and .mpg4 as recognized extensions for - (application|audio|video)/mp4 per RFC4337. - {#1}[https://github.com/mime-types/ruby-mime-types/issues/1] - * Added audio/x-aac and .aac per RubyForge issue #28054. - * Made it much easier to update MIME types from this point forward. - * Updated MIME types from IANA. - -== 1.16 -* Made compatible with Ruby 1.8.6, 1.8.7, and 1.9.1. -* Switched to the 'hoe' gem system and added a lot of build-time tools. -* Updated the MIME types to the list based on the values in the Perl library - version 1.27. Also updated based on external source information and bug - reports. -* This is the last planned version of MIME::Types 1.x. Work will be - starting soon on MIME::Types 2.x with richer data querying mechanisms - and support for external data sources. - -== 1.15 -* Removed lib/mime/type.rb to form a single MIME::Types database source. It - is unlikely that one will ever need MIME::Type without MIME::Types. -* Re-synchronized the MIME type list with the sources, focusing primarily on - the IANA list. -* Added more detailed source information for MIME::Type objects. -* Changed MIME::Types from a module to a class with a default instance. There - should be no difference in usage. -* Removed MIME::Types::DATA_VERSION; it is now an attribute on the - MIME::Types instance. -* NOTE: Synchronization with the Perl version of MIME::Types is no longer a - priority as of this release. The data format and information has changed. -* Removed MIME::Types.by_suffix and MIME::Types.by_mediatype. - -== 1.13.1 -* Fixed a problem with the installer running tests. This now works. -* Improved the implementation of MIME::Type.signature? -* Moved code around to use the class << self idiom instead of always - prepending the module/class name. -* Added two new best-guess implementations of functions found in Perl's - MIME::Types implementation (1.13). Do not rely on these until the purpose - and implementation is stabilised. -* Updated the MIME list to reflect changes noted by - Ville Skyttä . -* Added a new constant to MIME::Types, DATA_VERSION. This will allow the Ruby - version number to be updated separately from the Perl version while keeping - the MIME Type list version in sync. - -== 1.13 - ! WARNING: This version changes the API of MIME::Types ! - ! WARNING: This version is compatible with Ruby 1.8 and higher ONLY ! -* Removed dependency on InstallPackage; offering 1.13 as either .tar.gz or - .gem. -* Split into two files, mime/type.rb and mime/types.rb. This will make - maintaining the list of changes easier. -* Changed the MIME::Type construction API. Accepts only a single String - argument (but does no named type-checking) and yields self. -* Removed private methods #init_extensions, #init_encoding, and #init_system - and replaced with #extensions=, #encoding=, and #system=. -* Added #default_encoding to return 'quoted-printable' or 'base64' depending - on the media type of the MIME type. -* Added #raw_media_type and #raw_sub_type to provide the non-simplified - versions of the media type and subtype. -* Alternative constructors MIME::Type.from_array, MIME::Type.from_hash, and - MIME::Type.from_mime_type added to compensate for the removal of named type - checking in the original constructor. -* Added #to_str, #to_a, and #to_hash methods. The latter two will provide - output suitable for use in #from_array and #from_hash. -* Removed "binary" encoding and enforced the use of a valid encoding string. -* Added #system? returning true if the MIME::Type is an OS-specific - MIME::Type. -* Added #platform? returning true if the MIME::Type is an OS-specific - MIME::Type for the current RUBY_PLATFORM. -* Added #like? returning true if the simplified type matches the other value - provided. #<'application/x-excel'>.like?('application/excel') is true. -* Added #complete? returning true if the MIME::Type specifies an extension - list. -* Updated the MIME type list to reflect additions by Mark Overmeer for Perl's - MIME::Types 1.12 and the official IANA list as of 2004.04.06. A number of - formerly "registered" MIME types are now no longer registered (e.g., - application/excel is now application/x-excel). This ensures that the - simplified type still works with applications, but does not report an - unregistered type as registered. -* Restored MIME type list to Mark Overmeer's format to facilitate easy - exchange between the two projects. -* Added additional unit tests from Mark Overmeer's 1.12 version. - -== 1.07 -* Changed version numbering to match Perl MIME::Types 1.07. -* Re-synchronized with Mark Overmeer's list in Perl PMIME::Types 1.07. -* [NN Poster] updated the attributes for the PGP types. - -== 1.005 -* Changed to Phil Thomson's InstallPackage. -* Added several types from Perl MIME::Types 1.005. -* Cleaned up data format; some data formats will show up with proper data now. - -== 1.004 -* Updated to match Perl MIME::Types 1.004, links credited to Dan Puro. Adds - new reference list to http://www.indiana.edu/cgi-bin-local/mimetypes -* Removed InvalidType and replaced with TypeError. -* Changed instances of #type to #class. -* Cleaned up how simplified versions are created. - -== 1.003 -* Initial release based on Perl MIME::Types 1.003. diff --git a/Licence.md b/Licence.md new file mode 100644 index 0000000..318575c --- /dev/null +++ b/Licence.md @@ -0,0 +1,25 @@ +## Licence + +* Copyright 2003–2018 Austin Ziegler and contributors. + +The software in this repository is made available under the 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 +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Licence.rdoc b/Licence.rdoc deleted file mode 100644 index 3dfa292..0000000 --- a/Licence.rdoc +++ /dev/null @@ -1,25 +0,0 @@ -== Licence - -* Copyright 2003–2015 Austin Ziegler and contributors. - -The software in this repository is made available under the 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 -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/Manifest.txt b/Manifest.txt index 8324a52..9462df0 100644 --- a/Manifest.txt +++ b/Manifest.txt @@ -1,7 +1,7 @@ -Code-of-Conduct.rdoc -Contributing.rdoc -History.rdoc -Licence.rdoc +Code-of-Conduct.md +Contributing.md +History.md +Licence.md Manifest.txt README.rdoc Rakefile diff --git a/README.rdoc b/README.rdoc index ae5ee2e..10f8e97 100644 --- a/README.rdoc +++ b/README.rdoc @@ -41,9 +41,7 @@ mime-types 1.x is no longer supported as of 2015-10-27. === mime-types 2.x End of Life -mime-types 2.x is supported as 2.99.x receiving quarterly updates of the IANA -registry and security updates for two years. It will reach full end of life on -2017-11-21. +mime-types 2.x is no longer supported as of 2017-11-21. === mime-types 3.x @@ -195,8 +193,8 @@ features because of the existence of the [mime-types-data][] gem, and if features are marked deprecated in the course of mime-types 3.x, they will not be removed until mime-types 4.x or possibly later. -:include: Code-of-Conduct.rdoc +{Code of Conduct}[Code-of-Conduct_md.html] -:include: Contributing.rdoc +{Contributing}[Contributing_md.html] -:include: Licence.rdoc +{Licence}[Licence_md.html] diff --git a/Rakefile b/Rakefile index 47326e1..ef27284 100644 --- a/Rakefile +++ b/Rakefile @@ -19,7 +19,7 @@ spec = Hoe.spec 'mime-types' do require_ruby_version '>= 2.0' - self.history_file = 'History.rdoc' + self.history_file = 'History.md' self.readme_file = 'README.rdoc' license 'MIT' @@ -34,9 +34,9 @@ spec = Hoe.spec 'mime-types' do extra_dev_deps << ['minitest', '~> 5.4'] extra_dev_deps << ['minitest-autotest', '~> 1.0'] extra_dev_deps << ['minitest-focus', '~> 1.0'] - extra_dev_deps << ['minitest-bonus-assertions', '~> 2.0'] + extra_dev_deps << ['minitest-bonus-assertions', '~> 3.0'] extra_dev_deps << ['minitest-hooks', '~> 1.4'] - extra_dev_deps << ['rake', '~> 10.0'] + extra_dev_deps << ['rake', '>= 10.0', '< 13.0'] extra_dev_deps << ['fivemat', '~> 1.3' ] extra_dev_deps << ['minitest-rg', '~> 5.2'] diff --git a/lib/mime/type.rb b/lib/mime/type.rb index 64b14cc..49a4217 100644 --- a/lib/mime/type.rb +++ b/lib/mime/type.rb @@ -57,7 +57,7 @@ class MIME::Type end # The released version of the mime-types library. - VERSION = '3.1' + VERSION = '3.2' include Comparable diff --git a/lib/mime/types/deprecations.rb b/lib/mime/types/deprecations.rb index 9edb801..e0e6573 100644 --- a/lib/mime/types/deprecations.rb +++ b/lib/mime/types/deprecations.rb @@ -25,9 +25,9 @@ module MIME else message end - MIME::Types.logger.warn <<-warning.chomp + MIME::Types.logger.warn <<-WARNING.chomp #{caller[1]}: #{klass}#{level}#{sym} is deprecated #{message}. - warning + WARNING block.call if block end end diff --git a/lib/mime/types/loader.rb b/lib/mime/types/loader.rb index 6570e61..a38ba48 100644 --- a/lib/mime/types/loader.rb +++ b/lib/mime/types/loader.rb @@ -33,10 +33,6 @@ class MIME::Types::Loader path = path || ENV['RUBY_MIME_TYPES_DATA'] || MIME::Types::Data::PATH @container = container || MIME::Types.new @path = File.expand_path(path) - # begin - # require 'mime/lazy_types' - # @container.extend(MIME::LazyTypes) - # end end # Loads a MIME::Types registry from YAML files (*.yml or diff --git a/lib/mime/types/registry.rb b/lib/mime/types/registry.rb index 7cbd791..fa58618 100644 --- a/lib/mime/types/registry.rb +++ b/lib/mime/types/registry.rb @@ -43,7 +43,13 @@ class << MIME::Types private def lazy_load? - (lazy = ENV['RUBY_MIME_TYPES_LAZY_LOAD']) && (lazy != 'false') + if ENV.key?('RUBY_MIME_TYPES_LAZY_LOAD') + MIME::Types.logger.warn <<-WARNING.chomp +Lazy loading ($RUBY_MIME_TYPES_LAZY_LOAD) is deprecated and will be removed. + WARNING + + (lazy = ENV['RUBY_MIME_TYPES_LAZY_LOAD']) && (lazy != 'false') + end end def __types__ diff --git a/mime-types.gemspec b/mime-types.gemspec index 298dbbc..bdd909d 100644 --- a/mime-types.gemspec +++ b/mime-types.gemspec @@ -1,18 +1,18 @@ # -*- encoding: utf-8 -*- -# stub: mime-types 3.1 ruby lib +# stub: mime-types 3.2 ruby lib Gem::Specification.new do |s| s.name = "mime-types".freeze - s.version = "3.1" + s.version = "3.2" s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version= s.require_paths = ["lib".freeze] s.authors = ["Austin Ziegler".freeze] - s.date = "2018-08-10" + s.date = "2018-08-12" s.description = "The mime-types library provides a library and registry for information about\nMIME content type definitions. It can be used to determine defined filename\nextensions for MIME types, or to use filename extensions to look up the likely\nMIME type definitions.\n\nVersion 3.0 is a major release that requires Ruby 2.0 compatibility and removes\ndeprecated functions. The columnar registry format introduced in 2.6 has been\nmade the primary format; the registry data has been extracted from this library\nand put into {mime-types-data}[https://github.com/mime-types/mime-types-data].\nAdditionally, mime-types is now licensed exclusively under the MIT licence and\nthere is a code of conduct in effect. There are a number of other smaller\nchanges described in the History file.".freeze s.email = ["halostatue@gmail.com".freeze] - s.extra_rdoc_files = ["Code-of-Conduct.rdoc".freeze, "Contributing.rdoc".freeze, "History.rdoc".freeze, "Licence.rdoc".freeze, "Manifest.txt".freeze, "README.rdoc".freeze] - s.files = ["Code-of-Conduct.rdoc".freeze, "Contributing.rdoc".freeze, "History.rdoc".freeze, "Licence.rdoc".freeze, "Manifest.txt".freeze, "README.rdoc".freeze, "Rakefile".freeze, "lib/mime-types.rb".freeze, "lib/mime/type.rb".freeze, "lib/mime/type/columnar.rb".freeze, "lib/mime/types.rb".freeze, "lib/mime/types/_columnar.rb".freeze, "lib/mime/types/cache.rb".freeze, "lib/mime/types/columnar.rb".freeze, "lib/mime/types/container.rb".freeze, "lib/mime/types/deprecations.rb".freeze, "lib/mime/types/full.rb".freeze, "lib/mime/types/loader.rb".freeze, "lib/mime/types/logger.rb".freeze, "lib/mime/types/registry.rb".freeze, "test/bad-fixtures/malformed".freeze, "test/fixture/json.json".freeze, "test/fixture/old-data".freeze, "test/fixture/yaml.yaml".freeze, "test/minitest_helper.rb".freeze, "test/test_mime_type.rb".freeze, "test/test_mime_types.rb".freeze, "test/test_mime_types_cache.rb".freeze, "test/test_mime_types_class.rb".freeze, "test/test_mime_types_lazy.rb".freeze, "test/test_mime_types_loader.rb".freeze] + s.extra_rdoc_files = ["Code-of-Conduct.md".freeze, "Contributing.md".freeze, "History.md".freeze, "Licence.md".freeze, "Manifest.txt".freeze, "README.rdoc".freeze] + s.files = ["Code-of-Conduct.md".freeze, "Contributing.md".freeze, "History.md".freeze, "Licence.md".freeze, "Manifest.txt".freeze, "README.rdoc".freeze, "Rakefile".freeze, "lib/mime-types.rb".freeze, "lib/mime/type.rb".freeze, "lib/mime/type/columnar.rb".freeze, "lib/mime/types.rb".freeze, "lib/mime/types/_columnar.rb".freeze, "lib/mime/types/cache.rb".freeze, "lib/mime/types/columnar.rb".freeze, "lib/mime/types/container.rb".freeze, "lib/mime/types/deprecations.rb".freeze, "lib/mime/types/full.rb".freeze, "lib/mime/types/loader.rb".freeze, "lib/mime/types/logger.rb".freeze, "lib/mime/types/registry.rb".freeze, "test/bad-fixtures/malformed".freeze, "test/fixture/json.json".freeze, "test/fixture/old-data".freeze, "test/fixture/yaml.yaml".freeze, "test/minitest_helper.rb".freeze, "test/test_mime_type.rb".freeze, "test/test_mime_types.rb".freeze, "test/test_mime_types_cache.rb".freeze, "test/test_mime_types_class.rb".freeze, "test/test_mime_types_lazy.rb".freeze, "test/test_mime_types_loader.rb".freeze] s.homepage = "https://github.com/mime-types/ruby-mime-types/".freeze s.licenses = ["MIT".freeze] s.rdoc_options = ["--main".freeze, "README.rdoc".freeze] @@ -33,9 +33,9 @@ Gem::Specification.new do |s| s.add_development_dependency(%q.freeze, ["~> 1.2"]) s.add_development_dependency(%q.freeze, ["~> 1.0"]) s.add_development_dependency(%q.freeze, ["~> 1.0"]) - s.add_development_dependency(%q.freeze, ["~> 2.0"]) + s.add_development_dependency(%q.freeze, ["~> 3.0"]) s.add_development_dependency(%q.freeze, ["~> 1.4"]) - s.add_development_dependency(%q.freeze, ["~> 10.0"]) + s.add_development_dependency(%q.freeze, ["< 13.0", ">= 10.0"]) s.add_development_dependency(%q.freeze, ["~> 1.3"]) s.add_development_dependency(%q.freeze, ["~> 5.2"]) s.add_development_dependency(%q.freeze, ["~> 0.7"]) @@ -51,9 +51,9 @@ Gem::Specification.new do |s| s.add_dependency(%q.freeze, ["~> 1.2"]) s.add_dependency(%q.freeze, ["~> 1.0"]) s.add_dependency(%q.freeze, ["~> 1.0"]) - s.add_dependency(%q.freeze, ["~> 2.0"]) + s.add_dependency(%q.freeze, ["~> 3.0"]) s.add_dependency(%q.freeze, ["~> 1.4"]) - s.add_dependency(%q.freeze, ["~> 10.0"]) + s.add_dependency(%q.freeze, ["< 13.0", ">= 10.0"]) s.add_dependency(%q.freeze, ["~> 1.3"]) s.add_dependency(%q.freeze, ["~> 5.2"]) s.add_dependency(%q.freeze, ["~> 0.7"]) @@ -70,9 +70,9 @@ Gem::Specification.new do |s| s.add_dependency(%q.freeze, ["~> 1.2"]) s.add_dependency(%q.freeze, ["~> 1.0"]) s.add_dependency(%q.freeze, ["~> 1.0"]) - s.add_dependency(%q.freeze, ["~> 2.0"]) + s.add_dependency(%q.freeze, ["~> 3.0"]) s.add_dependency(%q.freeze, ["~> 1.4"]) - s.add_dependency(%q.freeze, ["~> 10.0"]) + s.add_dependency(%q.freeze, ["< 13.0", ">= 10.0"]) s.add_dependency(%q.freeze, ["~> 1.3"]) s.add_dependency(%q.freeze, ["~> 5.2"]) s.add_dependency(%q.freeze, ["~> 0.7"]) diff --git a/test/test_mime_types_cache.rb b/test/test_mime_types_cache.rb index 7bbb894..d8cfb3a 100644 --- a/test/test_mime_types_cache.rb +++ b/test/test_mime_types_cache.rb @@ -37,11 +37,11 @@ describe MIME::Types::Cache do describe '.load' do it 'does not use cache when RUBY_MIME_TYPES_CACHE is unset' do ENV.delete('RUBY_MIME_TYPES_CACHE') - assert_equal(nil, MIME::Types::Cache.load) + assert_nil MIME::Types::Cache.load end it 'does not use cache when missing' do - assert_equal(nil, MIME::Types::Cache.load) + assert_nil MIME::Types::Cache.load end it 'registers the data to be updated by #add_extensions' do @@ -80,7 +80,7 @@ describe MIME::Types::Cache do describe '.save' do it 'does not create cache when RUBY_MIME_TYPES_CACHE is unset' do ENV.delete('RUBY_MIME_TYPES_CACHE') - assert_equal(nil, MIME::Types::Cache.save) + assert_nil MIME::Types::Cache.save end it 'creates the cache ' do diff --git a/test/test_mime_types_lazy.rb b/test/test_mime_types_lazy.rb index 75e8dc7..e730ba1 100644 --- a/test/test_mime_types_lazy.rb +++ b/test/test_mime_types_lazy.rb @@ -22,17 +22,23 @@ describe MIME::Types, 'lazy loading' do describe '.lazy_load?' do it 'is true when RUBY_MIME_TYPES_LAZY_LOAD is set' do - assert_equal true, MIME::Types.send(:lazy_load?) + assert_output '', /RUBY_MIME_TYPES_LAZY_LOAD/ do + assert_equal true, MIME::Types.send(:lazy_load?) + end end it 'is nil when RUBY_MIME_TYPES_LAZY_LOAD is unset' do ENV['RUBY_MIME_TYPES_LAZY_LOAD'] = nil - assert_equal nil, MIME::Types.send(:lazy_load?) + assert_output '', '' do + assert_nil MIME::Types.send(:lazy_load?) + end end it 'is false when RUBY_MIME_TYPES_LAZY_LOAD is false' do ENV['RUBY_MIME_TYPES_LAZY_LOAD'] = 'false' - assert_equal false, MIME::Types.send(:lazy_load?) + assert_output '', /RUBY_MIME_TYPES_LAZY_LOAD/ do + assert_equal false, MIME::Types.send(:lazy_load?) + end end end -- cgit v1.2.1