summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* Various upgradesHEADmainAustin Ziegler2023-02-171-1/+1
| | | | | | | | | | | | | | | - Update the .github/workflows/ci.yml workflow to test Ruby 3.2 and more reliably test certain combinations rather than depending on exclusions. - Change `.standard.yml` configuration to format for Ruby 2.3 as certain files are not properly detected with Ruby 2.0. - Change from `hoe-git` to `hoe-git2` to support Hoe version 4. - Apply `standardrb --fix`. - Update other dependencies.
* Define MIME::Type#hashAlex Vondrak2022-07-011-1/+21
| | | | Fixes #166.
* IANA Provisional Registration SupportAustin Ziegler2021-11-151-2/+13
| | | | | - Added a new field to `MIME::Type` for checking provisional registrations from IANA.
* Convert to standardrb (#156)Austin Ziegler2021-06-027-466/+466
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - I mostly don’t care about this, but there are a couple of things that Standard does that I disagree with. They are inherited from Rubocop, but Standard fixes many of Rubocop’s nonsense rules. - Array literal wrappers %i[], %w[], etc. are just ugly and never should have become any sort of standard. I would be happier if this part of standard were just completely disabled, because it‘s unnecessary and wrong. - Quote literals having to be %q() is equally wrong. I’ve avoided the issue here because the generated gemspec uses both "unnecessary" quote literals (it’s necessary if I say it’s necessary) and the wrong wrappers (I wouldn’t use %q<>, but this is generated code). - I still think that short hashes can be `{ foo: "bar" }`, but I’m mostly using Elixir these days, so I don’t mind `%{foo: "bar"}`, so I can get used to it in Ruby. It still feels wrong, almost 20 years in. - There are semantic differences between and / &&, or / ||, but in some cases the reformatted code is substantially _worse_ to read. Again, I mostly don’t _care_ about this difference, but Rubocop’s insistence is silly; these should only be replaced where there _is_ ambiguity. - Replacing `x = foo or next` should never be replaced with `(x = foo) || next`. That’s replacing something that is somewhat readable with something damned-near unreadable. Both should be replaced with: ```ruby x = foo next unless x ``` - YAML.safe_load works differently between Psych 2.x and Psych 3.x, so some updates have been made to make that work cleanly. Overall, this introduces a lot of churn, but I think will be easier to deal with updates to `standardrb` instead of the rapid churn that has been Rubocop.
* Remove Travis, use GitHub ActionsAustin Ziegler2020-11-211-2/+0
|
* Fix [_1,_2,_3] parameters (conflict with Ruby 2.7.0); Updated gems and ruby ↵Al Snow2019-12-264-26/+26
| | | | versions.
* Code formatting:Austin Ziegler2019-01-267-50/+34
| | | | | | - Clean up the code to be a bit more like what I write. - Create a .rubocop.yml that disables bone-headed defaults and sets things I agree with.
* v3.2.1: An encoding bugfix releasev3.2.1Austin Ziegler2018-08-122-6/+8
|
* Resolve #136 and control growth of containersAustin Ziegler2018-08-122-1/+3
|
* Resolve a bug related to the switch to SetsAustin Ziegler2018-08-121-0/+6
| | | | Fully resolves #117, #127, and #134.
* Perform some maintenance for v3.2Austin Ziegler2018-08-122-6/+12
|
* Hardcode common argument results to prevent dup string allocationsDillon Welch2018-08-117-0/+14
|
* Calculate priority from MIME types of same familyJanko Marohnić2018-08-111-3/+14
| | | | | | | | | Some MIME types are in the same family, but their #simplified values aren't the same. One such example are "text/comma-separated-values" and "text/csv" MIME types. The former is obsolete and unregistered, while the latter is not obsolete and registered, but mime-types would still rank "text/comma-separated-values" higher because it just looks at the alphabetic order.
* Add __instances__ entry when loading from cache (#126)Burke Libbey2017-04-111-0/+9
|
* mime-types 3.1 (#120)v3.1Austin Ziegler2016-05-224-13/+23
| | | | | | | | | | | | | | | | | | | | * 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.
* mime-types 3.0Austin Ziegler2015-11-219-822/+764
| | | | | | | | | | | | | | | - Require Ruby 2.0 or later. Resolves #97. - Remove deprecated methods. - Update known registries when a MIME type extension changes. Resolves #84. - Relicensed mime-types 3.0 as MIT only. Resolves #95. - Extracted data from this gem to mime-types-data; removed deprecated data. - Rewrote tests to better understand what is being tested—some of the tests were almost ten years old and didn’t make a lot of sense with this version. I have switched to minitest/spec with assertions. - Columnar data is now the default registry store. Because JSON is not required by default, this change resolves #85. - MIME::Types containers are now implemented with Set instead of Array to prevent data duplication. Resolves #79.
* Change to fivemat outputAustin Ziegler2015-11-101-1/+2
|
* mime-types 2.6 release ready code.Austin Ziegler2015-05-255-60/+67
| | | | | | | - Extend documentation. - Add a logger and logger configuration. - Add more tests to Travis. - Update MIME registry.
* Make column format optional, JSON is default.Austin Ziegler2015-05-257-71/+139
| | | | | | | | | | | | | | - For mime-types 2.6, columnar support is opt-in and will not be changed to default until mime-types 3.0. Restore JSON by default with mime/types/columnar for enabling it. - Rename from .txt to .column; fix some of the type errors in conversion caused by previously undetected bad data. - Keep the PATH protocol even though none of the Linux distributions are using it now. - Fix up the conversion method and benchmarking.
* Use text-based columnar storageJeremy Evans2015-05-251-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes the default data for mime-types from a JSON file to a set of text files, with one line per mime type, and one file per mime type attribute. This only loads the content_type and extensions for mime-types by default, reducing default memory usage of mime-types from over 22MB to just over 2MB. Additionally, it speeds up requiring from 0.38 seconds to about 0.10 seconds. Even when loading all of the attributes for the mime types, the memory usage of mime-types stays under 11MB, though load time increases to 0.52 seconds. I think that is an acceptable trade off. If the txt files are shipped instead of the json file, there is also a disk space savings of 167KB (392KB instead of 560KB). rake convert:yaml:txt has been added for converting the yaml files to the necessary txt files. In order to get the conversion to work, I had to make convert.rb turn on lazy loading for mime types. This should be completely backwards compatible if a path is given containing the types. The only current backwards compatibility difference is for the "text/directory - DEPRECATED by RFC6350" mime type, which looks to me like an invalid mime type anyway, and probably should be removed. * Pool encoding strings. Use a single string for each encoding. This decreases the number of encoding strings stored by default from 1909 to 4, saving about 700KB of memory by default on 64-bit MRI. * While here, reduce object allocations while loading data from the mime type txt files. * Clear cache file in lazy test. This was causing the test-order dependent bug on JRuby. The clear_cache_file code was taken from the cache test.
* Set Container default_proc when marshal loadedDavid Genord II2014-12-091-0/+12
| | | | Marshal.load does not initialize the object so the default_proc doesn't get set when loaded from the cache
* Clearing up some code smells.Austin Ziegler2014-10-084-12/+16
|
* Making a lot of comments private.Austin Ziegler2014-10-081-4/+2
| | | | | - Also improving documentation. - Improved a test to use a better assertion.
* Making a test name clearerAustin Ziegler2014-10-081-1/+1
|
* Adding tests that cover new functionality.Austin Ziegler2014-10-071-0/+84
|
* Increasing coverage of MIME::Types#each.Austin Ziegler2014-10-072-0/+4
|
* Increasing coverage of MIME methods.Austin Ziegler2014-10-071-0/+1
|
* Increasing coverage on MIME::Types::Loader.Austin Ziegler2014-10-072-2/+20
|
* Unsort extensions, restore old sort order.Austin Ziegler2014-10-071-1/+1
| | | | Resolves #71.
* Fix a bug with MIME::Types#type_for.Austin Ziegler2014-05-201-0/+1
| | | | * MIME::Types.type_for('unknown') should return [], not [nil].
* Adding support for the Apache list.Austin Ziegler2014-01-251-4/+4
| | | | Resolves #38.
* Rewriting IANA registry parsing.Austin Ziegler2014-01-251-3/+2
| | | | | | | | | - The IANA registry format changed layout in (X)HTML, but an XML version was made available that is far easier to parse and provides more useful information. - Adding #xrefs/#xrefs_urls to MIME::Type to reflect the more useful data available in the new IANA registry XML format. Over time, #references and #urls will be views on the #xrefs data.
* Using Array() instead of [ foo ].Austin Ziegler2014-01-231-0/+9
| | | | | - Bumping to version 2.1 for upcoming release. - Adapted tests to be more accurate for the described functionality.
* mime-types 2.0Austin Ziegler2013-10-2610-258/+729
| | | | | | | | | | | | A substantial upgrade to the mime-types library. Major features: - No longer compatible with Ruby 1.8. - Several major API changes and deprecations. - The default mime-types registry is now stored as JSON. - Improved developer tools. - Improved repackager tools. See History.rdoc for full details.
* Documenting caching for 1.25 release.Austin Ziegler2013-08-304-4/+9
| | | | | | - Fixing some issues with loading the cache container. - Fixing some issues with the run of tests in a particular order. - Modernized Minitest usage.
* Adding MIME::Types caching and lazy loading.Austin Ziegler2013-08-292-0/+117
|
* Fix issues with Minitest setup.Austin Ziegler2013-08-292-7/+2
|
* Finalizing the 1.23 release.v1.23Austin Ziegler2013-04-201-2/+2
|
* Enumerate MIME::Type objects instead of assoc arraysArnaud Meuret2013-04-151-1/+1
|
* Make the collection EnumerableArnaud Meuret2013-04-121-0/+8
|
* Ensuring UTF-8 for tests.Austin Ziegler2013-01-252-0/+4
|
* adding epub, ibooks, mobi and dmg mime typesMauricio Linhares2013-01-241-0/+10
|
* Fixing issue #8.Austin Ziegler2012-03-211-7/+6
| | | | Apparently some people run the tests on Linux. Imagine that. :)
* Fixed some warningsHenrik Hodne2011-11-061-1/+1
| | | | Both of these were "assigned but unused variable" warnings.
* Initial cleanup for new release.Austin Ziegler2011-10-222-397/+336
| | | | | | | | 1. Converted all .txt to .rdoc. 2. Converted Rakefile to use modern Hoe specification format. 3. Removed setup.rb (Issue #3; https://github.com/halostatue/mime-types/issues/3). 4. Converted unit tests to minitest.
* Trying to clean up some general usage.halostatue2009-03-011-24/+0
|
* Starting the move to 1.16halostatue2009-02-243-272/+395
|
* Version update, copyright information update.halostatue2009-02-242-15/+24
|
* Moving tests/ to test/halostatue2009-02-233-0/+370