diff --git a/src/path.cr b/src/path.cr index 77f5b9a241e5..b3b943c39f6b 100644 --- a/src/path.cr +++ b/src/path.cr @@ -6,9 +6,9 @@ # that identifies a file system hierarchy, may also be present. # The name element that is farthest from the root of the directory hierarchy is # the name of a file or directory. The other name elements are directory names. -# A Path can represent a root, a root and a sequence of names, or simply one or +# A `Path` can represent a root, a root and a sequence of names, or simply one or # more name elements. -# A Path is considered to be an empty path if it consists solely of one name +# A `Path` is considered to be an empty path if it consists solely of one name # element that is empty. Accessing a file using an empty path is equivalent # to accessing the default directory of the process. # @@ -26,7 +26,7 @@ # Path handling comes in different kinds depending on operating system: # # * `Path.posix()` creates a new POSIX path -# * `Path.windows()` create a new Windows path +# * `Path.windows()` creates a new Windows path # * `Path.new()` means `Path.posix` on POSIX platforms and `Path.windows()` # on Windows platforms. # @@ -389,12 +389,12 @@ struct Path # # 1. Replace multiple slashes with a single slash. # 2. Eliminate each `.` path name element (the current directory). - # 3. Eliminate each `..` path name element (the parent directory) preceeded + # 3. Eliminate each `..` path name element (the parent directory) preceded # by a non-`..` element along with the latter. # 4. Eliminate `..` elements that begin a rooted path: # that is, replace `"/.."` by `"/"` at the beginning of a path. # - # If the path turns to be empty, the current direcory (`"."`) is returned. + # If the path turns to be empty, the current directory (`"."`) is returned. # # The returned path ends in a slash only if it is the root (`"/"`, `\`, or `C:\`). # @@ -537,7 +537,7 @@ struct Path end end - # Converts this path to the fiven *kind*. + # Converts this path to the given *kind*. # # See `#to_windows` and `#to_posix` for details. def to_kind(kind) @@ -566,7 +566,7 @@ struct Path base = Path.new(base) unless base.is_a?(Path) base = base.to_kind(@kind) if base == self - # expanding base, avoid recusion + # expanding base, avoid recursion return new_instance(@name).normalize(remove_final_separator: false) end