Skip to content
This repository has been archived by the owner on Feb 16, 2022. It is now read-only.

Pablo-Merino/mimemagic

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MimeMagic is a library to detect the mime type of a file by extension or by content.

Build Status Code Climate

Usage

require 'mimemagic'
MimeMagic.by_extension('html').text?
MimeMagic.by_extension('.html').child_of? 'text/plain'
MimeMagic.by_path('filename.txt')
MimeMagic.by_magic(File.open('test.html'))
# etc...

API

http://rdoc.info/github/minad/mimemagic/frames/file/README

Tests

bundle install

rake test

Authors

Daniel Mendler

About

Mime type detection in ruby via file extension or file content

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%