| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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.
|
|
|
|
| |
Fixes #166.
|
|
|
|
|
| |
- Added a new field to `MIME::Type` for checking provisional registrations
from IANA.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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.
|
| |
|
|
|
|
| |
versions.
|
|
|
|
|
|
| |
- 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.
|
| |
|
| |
|
|
|
|
| |
Fully resolves #117, #127, and #134.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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.
|
| |
|
|
|
|
|
|
|
| |
- Extend documentation.
- Add a logger and logger configuration.
- Add more tests to Travis.
- Update MIME registry.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Marshal.load does not initialize the object so the default_proc doesn't get set when loaded from the cache
|
| |
|
|
|
|
|
| |
- Also improving documentation.
- Improved a test to use a better assertion.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Resolves #71.
|
|
|
|
| |
* MIME::Types.type_for('unknown') should return [], not [nil].
|
|
|
|
| |
Resolves #38.
|
|
|
|
|
|
|
|
|
| |
- 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.
|
|
|
|
|
| |
- Bumping to version 2.1 for upcoming release.
- Adapted tests to be more accurate for the described functionality.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
- Fixing some issues with loading the cache container.
- Fixing some issues with the run of tests in a particular order.
- Modernized Minitest usage.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Apparently some people run the tests on Linux. Imagine that. :)
|
|
|
|
| |
Both of these were "assigned but unused variable" warnings.
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
|
|