-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start matching pathname directory prefixes more rigorously
Fixes #1174 The simplistic `start_with?` check was not sufficient to match that a given file/folder was under a given folder, since we were not explicitly checking for full folder name matches. For example, if `path = "/foo/bar-gem/baz"` and `folder = "/foo/bar"`, then `path.start_with?(folder)` would return `true`, but `path` is not under the `folder` directory. This commit fixes the problem by matching `folder` to any of the parent directories of `path` by using the `Pathname#ascend` method to get all parent directory prefixes of a `path`.
- Loading branch information
Showing
2 changed files
with
13 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters