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
When you have setup gemcutter.org as a gem source, you can install it with:
sudo gem install file_wrapper
When you have setup gems.github.com as a gem source, you can install it with:
sudo gem install Narnach-file_wrapper
If you want tests and the project's history, you can clone the git repo and build the gem yourself:
git clone git://github.com/Narnach/file_wrapper.git cd file_wrapper rake install
Detect the mime-type of a file.
FileWrapper.get_mime('Rakefile') #=> 'text/plain'
FileWrapper can now handle filenames with spaces as it wraps it in double quotes.
Removed unneeded autorequire from gemspec
Updated readme with gem install instructions
Another small documentation update
Removed unused files
Added gemspec: this is no longer a plugin but a stand-alone gem which should still work as a rails plugin.
Ignored gem output directory
Updated readme with installation instructions.
Added plugin to git.
Filip 'FiXato' Slagter
Copyright © 2008 Wes Oldenbeuving, released under the MIT license