module Ethon::Easies::Util

def file_info(file)

Returns:
  • (Array) - Array of informations.

Parameters:
  • file (File) -- The file to handle.

Other tags:
    Example: Return file info. -
def file_info(file)
  filename = File.basename(file.path)
  types = MIME::Types.type_for(filename)
  [
    filename,
    types.empty? ? 'application/octet-stream' : types[0].to_s,
    File.expand_path(file.path)
  ]
end