FileWrapper is a Rails plugin which wraps the command line utility 'file' to detect the mime-type of a file.
Ruby
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 2 commits behind Narnach:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test
.gitignore
MIT-LICENSE
README.rdoc
Rakefile
file_wrapper.gemspec
init.rb

README.rdoc

FileWrapper

FileWrapper is a Rails plugin and RubyGem which wraps the command line utility 'file' to detect the mime-type of a file.

Installation as Rails plugin

From the Rails project root, execute:

script/plugin install git://github.com/Narnach/file_wrapper.git

Installation as gem

Install the gem by executing:

sudo gem install Narnach-file_wrapper --remote --source http://gems.github.com

Example

Detect the mime-type of a file.

FileWrapper.get_mime('Rakefile') #=> 'text/plain'

Copyright © 2008 Wes Oldenbeuving, released under the MIT license