Add distinctPath

This commit is contained in:
Eugene Yokota 2015-06-28 14:41:32 -04:00
parent 4bae8b3acb
commit 16b95a4d62
2 changed files with 6 additions and 0 deletions

View File

@ -7,5 +7,6 @@
### Improvements
- Renames `distinct` method on `PathFinder` to `distinctName`. [#1973][1973] by [@eed3si9n][@eed3si9n]
- Adds `distinctPath` method on `PathFinder`. [#1973][1973] by [@eed3si9n][@eed3si9n]
### Bug fixes

View File

@ -181,6 +181,11 @@ sealed abstract class PathFinder {
@deprecated("Use distinctName", "0.13.9")
def distinct: PathFinder = distinctName
/**
* Create a PathFinder from this one where each path has a unique absolute path.
*/
def distinctPath: PathFinder = PathFinder { get.map(p => (p.absolutePath, p)).toMap.values }
/** Constructs a string by evaluating this finder, converting the resulting Paths to absolute path strings, and joining them with the platform path separator.*/
final def absString = Path.makeString(get)
/** Constructs a debugging string for this finder by evaluating it and separating paths by newlines.*/