Class: Aruba::Platforms::DetermineFileSize

Inherits:
Object
  • Object
show all
Defined in:
lib/aruba/platforms/determine_file_size.rb

Overview

Determine size of a file

Returns:

  • (Integer)

    Returns size if exists. Returns -1 if path does not exist

Instance Method Summary collapse

Instance Method Details

#call(path) ⇒ Object


13
14
15
16
17
18
19
# File 'lib/aruba/platforms/determine_file_size.rb', line 13

def call(path)
  return -1 unless File.file? path

  FileSize.new(
    File.size(path)
  )
end