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.
FileMagic 0.1.1 (2003-7-30) md5sum: 0bf72b94eec248c3db2155771c16f9a4 (3864 bytes)
View it here
Travis Whitton <whitton@atlantic.net>