Class: File
- Inherits:
-
Object
- Object
- File
- Defined in:
- lib/syncftp.rb
Class Method Summary collapse
-
.binary?(file) ⇒ Boolean
File extension.
Class Method Details
.binary?(file) ⇒ Boolean
File extension
Check if the file
is a binary file
93 94 95 96 97 98 |
# File 'lib/syncftp.rb', line 93 def self.binary?( file ) if MIME::Types.type_for( file ).size == 0 return true end MIME::Types.type_for( file ).map{ |e| (e.binary?) ? e : nil }.compact.size > 0 end |