Class: File

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

Class Method Summary collapse

Class Method Details

.binary?(path) ⇒ Boolean

Returns:

  • (Boolean)


33
34
35
36
37
38
# File 'lib/fif/utils.rb', line 33

def self.binary?(path)
  IO.popen(
    ["file", "-b", "--mime-encoding", path],
    in: :close, err: :close
  ).read.chomp.include? 'binary'
end