Asciidoctor::PathResolver
Inherits Asciidoctor::Logging < Reference < Object
Public: Handles all operations for resolving, cleaning and joining paths. This class includes operations for handling both web paths (request URIs) and system paths.
The main emphasis of the class is on creating clean and secure paths. Clean paths are void of duplicate parent and current directory references in the path name. Secure paths are paths which are restricted from accessing directories outside of a jail path, if specified.
Since joining two paths can result in an insecure path, this class also handles the task of joining a parent (start) and child (target) path.
Constants
Constructors
Instance methods
Public: Check whether the specified path is an absolute path.
Public: Determine whether path descends from base. Returns the offset if it descends, otherwise nil.
Public: Expand the specified path by resolving parent references (..) and removing self references (.).
Public: Join the segments using the posix file separator.
Public: Partition the path into path segments and remove self references (.) and the trailing slash, if present.
Public: Normalize path by converting any backslashes to forward slashes.
Public: Calculate the relative path to this absolute path from the specified base directory.
Public: Check if the specified path is an absolute root path. In Crystal, we don't have Opal or JRuby, so root? is the same as absolute_path?.
Public: Securely resolve a system path.
Public: Resolve a web path from the target and start paths.