FileTypeDetector
Installation
gem 'file_type_detector'
And then execute:
$ bundle
Or install it yourself as:
$ gem install file_type_detector
Usage
Usage:
File Objects
file = File.open('/path/to/file', 'r')
FileTypeDetectorTest::Extension.extension(file)
File Paths
path = '/path/to/file'
FileTypeDetectorTest::Extension.extension(path)
File String
string = File.read('/path/to/file')
FileTypeDetectorTest::Extension.extension(string)
Development
There is plenty to do, this gem currently only supports 'jpg' and 'png'
License
The gem is available as open source under the terms of the People's License
Code of Conduct
Everyone interacting in the FileTypeDetector project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.