class Asciidoctor::PathResolver

def descends_from? path, base

returns If path descends from base, return the offset, otherwise false.

base - The String base path to check against. Can be relative.
path - The String path to check. Can be relative.

If path equals base, or base is a parent of path, return true.

Public: Determine whether path descends from base.
def descends_from? path, base
  if base == path
    0
  elsif base == SLASH
    (path.start_with? SLASH) && 1
  else
    (path.start_with? base + SLASH) && (base.length + 1)
  end
end