class Backto::Path

Attributes

relative[R]

Public Class Methods

new(path_name, relative = nil) click to toggle source
# File lib/backto/path.rb, line 8
def initialize(path_name, relative = nil)
  @path_name = path_name
  @relative = relative
end

Public Instance Methods

absolute() click to toggle source
# File lib/backto/path.rb, line 13
def absolute
  @absolute ||= File.join(@path_name, relative || '')
end
Also aliased as: source
chdir(path_name) click to toggle source
# File lib/backto/path.rb, line 23
def chdir(path_name)
  File.join(path_name, relative)
end
directory?() click to toggle source
# File lib/backto/path.rb, line 57
def directory?
  @is_directory ||= File.directory?(absolute)
end
join(file) click to toggle source
# File lib/backto/path.rb, line 19
def join(file)
  self.class.new(@path_name, relative ? File.join(relative, file) : file)
end
mkdirs(target, options = {}) click to toggle source
# File lib/backto/path.rb, line 27
def mkdirs(target, options = {})
  FileUtils.mkdir_p target, options unless File.exist? target
end
source()
Alias for: absolute