class Asciidoctor::PathResolver

def relative_path path, base

Return the [String] relative path of the specified path calculated from the base directory.

base - [String] an absolute base directory.
path - [String] an absolute filename.

original path is returned work is done.
within the base directory, or the relative path cannot be computed, the
If neither path or base are absolute paths, the path is not contained

Public: Calculate the relative path to this absolute path from the specified base directory
def relative_path path, base
  if root? path
    if (offset = descends_from? path, base)
      path.slice offset, path.length
    else
      begin
        (Pathname.new path).relative_path_from(Pathname.new base).to_s
      rescue
        path
      end
    end
  else
    path
  end
end