module CodeRay::FileType

FileType

A simple filetype recognizer.

Usage

# determine the type of the given
lang = FileType[file_name]

# return :text if the file type is unknown
lang = FileType.fetch file_name, :text

# try the shebang line, too
lang = FileType.fetch file_name, :text, true