Class: File

Inherits:
Object
  • Object
show all
Defined in:
lib/syncftp.rb

Class Method Summary collapse

Class Method Details

.binary?(file) ⇒ Boolean

File extension

Check if the file is a binary file

Returns:

  • (Boolean)


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