Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add aliases and canonical form #174

Open
doriantaylor opened this issue Aug 9, 2023 · 1 comment
Open

add aliases and canonical form #174

doriantaylor opened this issue Aug 9, 2023 · 1 comment

Comments

@doriantaylor
Copy link

doriantaylor commented Aug 9, 2023

The shared-mime-info database catalogues type aliases and I propose exposing them via new aliases, alias?, and canonical methods:

m = MimeMagic.new('text/xml').canonical
# => <MimeMagic "application/xml">
m.aliases
# => [<MimeMagic "text/xml">]
m.aliases.first.alias?
# => true

This will make it possible to match a wider range of inputs. Happy to do the patch.

@doriantaylor
Copy link
Author

Update: I did the patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant