| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| | |
Fix a section link in README.rdoc [ci skip]
|
| | |
|
| | |
|
|\ \
| | |
| | | |
Fix typo in MIME::Type::Columnar
|
|/ / |
|
|\ \
| |/
|/| |
'each_with_object' passes the given object as last argument.
|
|/
|
|
| |
Fixes #107.
|
| |
|
|\
| |
| | |
Bump version to 2.6.1
|
|/ |
|
|\
| |
| | |
Record all extensions when using the columnar store
|
| | |
|
|\ \
| |/
|/| |
Avoid circular require when you do require 'mime/types/columnar'
|
|/ |
|
|\
| |
| |
| |
| |
| |
| | |
Release 2.6
Fixes #83 (Decrease Memory Usage).
Fixes #84 (Requiring mime/types accounts for 2% of all application RAM).
Based on and Fixes #96.
|
| |
| |
| |
| |
| |
| |
| | |
- 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.
|
|\
| |
| | |
Avoid conflict with existing `mime` gem
|
|/
|
|
|
| |
* Moved lib/mime.rb away from top-level (otherwise the loading paths would use the file instead of the existing gem’s).
* Still apply the compatibility patch on the `MIME` module.
|
|\
| |
| | |
Add woff2 to application/font-woff extensions
|
|/ |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
- The home for mime-types has changed. It is no longer
https://github.com/halostatue/mime-types, but instead
https://github.com/mime-types/ruby-mime-types.
- Updated the documentation to point to the new home.
|
|
|
|
| |
- Fixes #91.
|
| |
|
|
|
|
|
|
| |
- Handle text-based obsoletions.
- Add a new `xref` type, 'notes'.
- Remove some workarounds for broken links that are no longer broken.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Fixes #80.
Worked out the wording with @kenips.
|
|\
| |
| | |
Use the new build env on Travis.
|
| | |
|
|\ \
| | |
| | | |
Add support for x-ms-bmp
|
| | | |
|
|\ \ \
| |/ /
|/| | |
Drop tens of thousands of object allocations on require
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This patch utilizes a few techniques to cut down object allocations.and speed up requiring `mime/types`
- Use frozen strings and in place string manipulation
- Use self modifying operators when possible i.e. gsub!
- Avoiding assigning multiple variables using the splat operator (i.e. `a, b = *[1,2]`) as this allocates an extra un-needed array.
The call to `self.friendly({})` does nothing, it only serves to set the instance variable. The method call here merges an empty hash with an empty hash we can get rid of it.
To benchmark:
```
require 'allocation_tracer'
$LOAD_PATH << "/Users/schneems/Documents/projects/mime-types/lib"
ObjectSpace::AllocationTracer.trace do
require 'mime/types'
end
puts :TOTAL => ObjectSpace::AllocationTracer.allocated_count_table.values.inject(:+)
```
Run without patch:
```
{:TOTAL=>195692}
```
Run with patch:
```
{:TOTAL=>158240}
```
|