@@ -220,7 +220,7 @@ package.append(.package(url: "https://github.com/mxcl/Path.swift", from: "0.5.0"
|
|||||||
CocoaPods:
|
CocoaPods:
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
pod 'Path.swift' ~> '0.5.0'
|
pod 'Path.swift', '~> 0.5'
|
||||||
```
|
```
|
||||||
|
|
||||||
Carthage:
|
Carthage:
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ public struct Path: Equatable, Hashable, Comparable {
|
|||||||
self.string = string
|
self.string = string
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns `nil` unless fed an absolute path
|
/// Returns `nil` unless fed an absolute path.
|
||||||
public init?(_ description: String) {
|
public init?(_ description: String) {
|
||||||
guard description.starts(with: "/") || description.starts(with: "~/") else { return nil }
|
guard description.starts(with: "/") || description.starts(with: "~/") else { return nil }
|
||||||
self.init(string: (description as NSString).standardizingPath)
|
self.init(string: (description as NSString).standardizingPath)
|
||||||
@@ -91,7 +91,7 @@ public struct Path: Equatable, Hashable, Comparable {
|
|||||||
|
|
||||||
- Parameter pathComponent: The string to join with this path.
|
- Parameter pathComponent: The string to join with this path.
|
||||||
- Returns: A new joined path.
|
- Returns: A new joined path.
|
||||||
- SeeAlso: `Path./(_:, _:)`
|
- SeeAlso: `Path./(_:_:)`
|
||||||
*/
|
*/
|
||||||
public func join<S>(_ pathComponent: S) -> Path where S: StringProtocol {
|
public func join<S>(_ pathComponent: S) -> Path where S: StringProtocol {
|
||||||
//TODO standardizingPath does more than we want really (eg tilde expansion)
|
//TODO standardizingPath does more than we want really (eg tilde expansion)
|
||||||
|
|||||||
Reference in New Issue
Block a user