Typor

Stupid MIME Type Magic for Ruby

Presentation

This library provides MIME detection magic based on file contents - nothing more.

Installation

Gemfile

gem 'typor'

Terminal

gem install -V typor

Usage

Typor provides basic detection of most MIME types, based on actual file contents.

# Determine File Type
Typor.file 'raccoon.png'
# => 'image/png'

# Determine Data Type
data = File.read 'raccoon.png'
Typor.data data
# => 'image/png'

License

The gem is available as open source under the terms of the MIT License.