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
honeybadger-5.4.0 vendor/bundle/ruby/3.2.0/gems/aruba-2.2.0/lib/aruba/platforms/determine_file_size.rb
honeybadger-5.3.0 vendor/bundle/ruby/3.2.0/gems/aruba-2.2.0/lib/aruba/platforms/determine_file_size.rb
aruba-2.2.0 lib/aruba/platforms/determine_file_size.rb
aruba-2.1.0 lib/aruba/platforms/determine_file_size.rb
aruba-2.0.1 lib/aruba/platforms/determine_file_size.rb
phillipug-foodie-0.1.0 .vendor/ruby/3.0.0/gems/aruba-2.0.0/lib/aruba/platforms/determine_file_size.rb
aruba-2.0.0 lib/aruba/platforms/determine_file_size.rb
aruba-1.1.2 lib/aruba/platforms/determine_file_size.rb
aruba-1.1.1 lib/aruba/platforms/determine_file_size.rb
aruba-1.1.0 lib/aruba/platforms/determine_file_size.rb
aruba-1.0.4 lib/aruba/platforms/determine_file_size.rb
aruba-1.0.3 lib/aruba/platforms/determine_file_size.rb
aruba-1.0.2 lib/aruba/platforms/determine_file_size.rb
aruba-1.0.1 lib/aruba/platforms/determine_file_size.rb
aruba-1.0.0 lib/aruba/platforms/determine_file_size.rb
aruba-0.14.14 lib/aruba/platforms/determine_file_size.rb
aruba-0.14.13 lib/aruba/platforms/determine_file_size.rb
aruba-1.0.0.pre.alpha.5 lib/aruba/platforms/determine_file_size.rb
honeybadger-4.5.3 vendor/bundle/ruby/2.6.0/gems/aruba-0.14.12/lib/aruba/platforms/determine_file_size.rb
aruba-0.14.12 lib/aruba/platforms/determine_file_size.rb