Sha256: 96bdb457ffad0edb5f37a365e3812df4383ff87d0220a2c13c6b365647e841a9

Contents?: true

Size: 416 Bytes

Versions: 44

Compression:

Stored size: 416 Bytes

Contents

# Aruba
module Aruba
  # Platforms
  module Platforms
    # Determine size of a file
    #
    # @param [String] path
    #   The path to file
    #
    # @return [Integer]
    #   Returns size if exists. Returns -1 if path does not exist
    class DetermineFileSize
      def call(path)
        return -1 unless File.file? path

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

Version data entries

44 entries across 44 versions & 4 rubygems

Version Path
aruba-0.14.11 lib/aruba/platforms/determine_file_size.rb
aruba-0.14.10 lib/aruba/platforms/determine_file_size.rb
aruba-1.0.0.pre.alpha.4 lib/aruba/platforms/determine_file_size.rb
aruba-1.0.0.pre.alpha.3 lib/aruba/platforms/determine_file_size.rb
aruba-0.14.9 lib/aruba/platforms/determine_file_size.rb
aruba-0.14.8 lib/aruba/platforms/determine_file_size.rb
aruba-0.14.7 lib/aruba/platforms/determine_file_size.rb
aruba-0.14.6 lib/aruba/platforms/determine_file_size.rb
aruba-0.14.5 lib/aruba/platforms/determine_file_size.rb
aruba-0.14.4 lib/aruba/platforms/determine_file_size.rb
aruba-0.14.3 lib/aruba/platforms/determine_file_size.rb
aruba-1.0.0.pre.alpha.2 lib/aruba/platforms/determine_file_size.rb
aruba-1.0.0.pre.alpha.1 lib/aruba/platforms/determine_file_size.rb
aruba-win-fix-0.14.2 lib/aruba/platforms/determine_file_size.rb
aruba-0.14.2 lib/aruba/platforms/determine_file_size.rb
aruba-0.14.1 lib/aruba/platforms/determine_file_size.rb
aruba-0.14.0 lib/aruba/platforms/determine_file_size.rb
aruba-0.13.0 lib/aruba/platforms/determine_file_size.rb
aruba-0.12.0 lib/aruba/platforms/determine_file_size.rb
aruba-0.11.2 lib/aruba/platforms/determine_file_size.rb