Class: File

Inherits:
Object show all
Defined in:
lib/ext/file.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.absolute_path(path) ⇒ Object



9
10
11
# File 'lib/ext/file.rb', line 9

def self.absolute_path(path)
  Dir.absolute_path(path)
end

.relative_path(abs_path, pwd = Dir.pwd) ⇒ Object



5
6
7
# File 'lib/ext/file.rb', line 5

def self.relative_path(abs_path, pwd=Dir.pwd)
  Dir.relative_path(abs_path, pwd)
end

Instance Method Details

#absolute_pathObject



17
18
19
# File 'lib/ext/file.rb', line 17

def absolute_path
  Dir.absolute_path(self.path)
end

#basename(*args) ⇒ Object



25
26
27
# File 'lib/ext/file.rb', line 25

def basename(*args)
  File.basename(self.path, *args)
end

#dirnameObject



21
22
23
# File 'lib/ext/file.rb', line 21

def dirname
  File.dirname(self.path)
end

#executable?Boolean

Returns:



37
38
39
# File 'lib/ext/file.rb', line 37

def executable?
  File.executable?(self.path)
end

#readable?Boolean

Returns:



33
34
35
# File 'lib/ext/file.rb', line 33

def readable?
  File.readable?(self.path)
end

#relative_pathObject



13
14
15
# File 'lib/ext/file.rb', line 13

def relative_path
  Dir.relative_path(self.path)
end

#writable?Boolean

Returns:



29
30
31
# File 'lib/ext/file.rb', line 29

def writable?
  File.writable?(self.path)
end