Skip to content
 
 

Latest commit

 

History

28 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

shared-mime-info is a pure Ruby library for accessing the MIME info database provided by Freedesktop on Standards/shared-mime-info-spec.

The rubyforge project : rubyforge.org/projects/shared-mime

The github repository: github.com/hanklords/shared-mime-info/tree/master

require 'shared-mime-info'

MIME.check 'sample.jpg'  # => #<MIME::Type  ...,  @type="image/jpeg">

MIME['image/jpeg'].match_filename? 'sample.jpg' # => true
  • Ensure that shared-mime-info is installed on the system:

> brew install shared-mime-info
  • You may need to update the mime database first:

> update-mime-database

About

Library to guess the MIME type of a file with both filename lookup and magic file detection

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages