Class: File

Inherits:
Object show all
Defined in:
lib/vendor/backports-3.3.5/lib/backports/1.9.1/file/size.rb,
lib/vendor/backports-3.3.5/lib/backports/1.9.1/file/binary.rb

Defined Under Namespace

Modules: Constants

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.expand_path_with_potential_to_path(file, dir = nil) ⇒ Object

Raises:

  • (ArgumentError)


5
6
7
8
9
10
11
# File 'lib/vendor/backports-3.3.5/lib/backports/1.9.1/file/expand_path.rb', line 5

def expand_path_with_potential_to_path(file, dir = nil)
  raise ArgumentError, 'home not set' if file == '~' && ENV["HOME"] == ''
  expand_path_without_potential_to_path(
    Backports.convert_path(file),
    dir == nil ? dir : Backports.convert_path(dir)
  )
end

Instance Method Details

#sizeObject



3
4
5
# File 'lib/vendor/backports-3.3.5/lib/backports/1.9.1/file/size.rb', line 3

def size
  stat.size
end