Module: Filepath::FilesystemInfo

Included in:
Filepath
Defined in:
lib/filepath/filepath.rb

Instance Method Summary collapse

Instance Method Details

#absolute_path(base_dir = Dir.pwd) ⇒ Object

FIXME: rename to #absolute?



827
828
829
830
831
832
833
# File 'lib/filepath/filepath.rb', line 827

def absolute_path(base_dir = Dir.pwd) # FIXME: rename to `#absolute`?
	if self.absolute?
		return self
	end

	return base_dir.as_path / self
end

#real_path(base_dir = Dir.pwd) ⇒ Object Also known as: realpath



835
836
837
838
839
# File 'lib/filepath/filepath.rb', line 835

def real_path(base_dir = Dir.pwd)
	path = absolute_path(base_dir)

	return path.resolve_link
end


843
844
845
# File 'lib/filepath/filepath.rb', line 843

def resolve_link
	return File.readlink(self).as_path
end