Sha256: 6649b3a4c36e0044a1ba3034788d06518dc72fb0a7ab73404e903081db5b9d61

Contents?: true

Size: 1.12 KB

Versions: 1

Compression:

Stored size: 1.12 KB

Contents

ffiruby-filemagic
=================

A new implementation of the ancient ruby-filemagic gem (http://grub.ath.cx/filemagic/). 

This version uses FFI to talk to the native library (JRuby friendly).

(Blurb from the original gem site follows)

What is FileMagic?

	FileMagic is a Ruby binding to the magic(4) library, which you may know better as the file(1) command. 
	The file command identifies the type of a file using, among other tests, a test for whether the file 
        begins with a certain magic number.

Install:

Make sure you have the magic(4) library installed. On OSX this can be done using MacPorts (http://www.macports.org/)

> sudo port install file
> sudo gem sources -a http://gems.github.com
> sudo gem install glongman-otv-ffiruby-filemagic

 - Linux? should just work 
 - Cygwin? no idea, never use it
 - Windows? see above

Usage:

> irb
>> require 'ffi_file_magic'
=> true
>> fm = FFIFileMagic.new(FFIFileMagic::MAGIC_MIME)
=> #<FFIFileMagic:0x11a4d9c @cookie=#<Native Pointer address=0x13606f0>>
>> fm.file('rails.png')
=> "image/png"
>> 


COPYRIGHT
=========

Copyright (c) 2009 Overlay TV. See LICENSE for details.

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
glongman-otv-ffiruby-filemagic-0.2.0 README