class NestedFile::ConvertPath

Attributes

mount_dir[RW]
parent_dir[RW]

Public Instance Methods

mount_to_parent(path) click to toggle source

converts the directory relative to the mount point to an absolute parent path

# File lib/nested_file/put_dir.rb, line 6
def mount_to_parent(path)
  File.join parent_dir, path
end
mount_to_parent_if_relative(path) click to toggle source
# File lib/nested_file/put_dir.rb, line 12
def mount_to_parent_if_relative(path)
  if Pathname.new(path).absolute?
    path
  else
    mount_to_parent(path)
  end
end
parent_to_mount(path) click to toggle source
# File lib/nested_file/put_dir.rb, line 9
def parent_to_mount(path)
  path.gsub("#{parent_dir}/","")
end