What is MimeType
A Ruby library to identify the MIME type of a local file
Why MimeType was born
At Topspin we provide ArtistLink, a platform for musician to upload and share their songs and videos. Artistlink provides a form to upload media files, and we need a way to present them differently if they are images, videos, sounds or other files.
How to use from the command line (executable)
Type mime_type_of
followed by the path of a local file.
This is will show the MIME type of that file.
How to use in other Ruby programs
Install by running gem install mime_type
or adding mime_type
in the Gemfile of your bundled project.
Call MimeType::of(file)
to know the MIME type of file
.
file
can be any derivation of the File
object such that file.path
returns its local path.
How to contribute
Make sure tests pass, then either submit a Pull Request. A list of nice TODOs is provided. You can also build a new version of the gem and move it to your gem repository.