From 1c2cffada50a1e659d833fb84a686acf71241951 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Sun, 20 Jan 2019 03:08:06 +0000 Subject: [PATCH] Support CocoaPods --- Path.swift.podspec | 19 +++++++++++++++++++ README.md | 26 +++++++++++++++++++++----- 2 files changed, 40 insertions(+), 5 deletions(-) create mode 100644 Path.swift.podspec diff --git a/Path.swift.podspec b/Path.swift.podspec new file mode 100644 index 0000000..5450777 --- /dev/null +++ b/Path.swift.podspec @@ -0,0 +1,19 @@ +Pod::Spec.new do |s| + s.name = 'Path.swift' + s.version = '0.3.0' + s.summary = 'Delightful, robust file-pathing functions' + s.homepage = 'https://github.com/mxcl/Path.swift' + s.license = { :type => 'Unlicense', :file => 'LICENSE.md' } + s.author = { 'mxcl' => 'mxcl@me.com' } + s.source = { :git => 'https://github.com/mxcl/Path.swift.git', :tag => s.version.to_s } + s.social_media_url = 'https://twitter.com/mxcl' + + s.osx.deployment_target = '10.10' + s.ios.deployment_target = '8.0' + s.tvos.deployment_target = '10.0' + s.watchos.deployment_target = '3.0' + + s.source_files = 'Sources/*' + + s.swift_version = "4.2" +end diff --git a/README.md b/README.md index 932ebc2..1e58ec7 100644 --- a/README.md +++ b/README.md @@ -16,14 +16,14 @@ let docs = Path.home/"Documents" let path = Path(userInput) ?? Path.cwd/userInput // chainable syntax so you have less boilerplate -try Path.home.join("foo").mkpath().join("bar").touch().chmod(0o555) +try Path.home.join("foo").mkdir().join("bar").touch().chmod(0o555) // easy file-management try Path.root.join("foo").copy(to: Path.root/"bar") // careful API to avoid common bugs try Path.root.join("foo").copy(into: Path.root.mkdir("bar")) -// ^^ other libraries would make the `to:` form handle both these cases +// ^^ other libraries would make the above `to:` form handle both these cases // but that can easily lead to bugs where you accidentally write files that // were meant to be directory destinations ``` @@ -41,6 +41,8 @@ can continue to make tools and software you need and love. I appreciate it x. +[Other donation/tipping options](http://mxcl.github.io/donate/) + # Handbook Our [online API documentation] is automatically updated for new releases. @@ -97,6 +99,11 @@ This is explicit, not hiding anything that code-review may miss and preventing common bugs like accidentally creating `Path` objects from strings you did not expect to be relative. +Our initializer is nameless because we conform to `LosslessStringConvertible`, +the same conformance as that `Int`, `Float` etc. conform. The protocol enforces +a nameless initialization and since it is appropriate for us to conform to it, +we do. + ## Extensions We have some extensions to Apple APIs: @@ -165,7 +172,7 @@ Path.root/"~b" // => /~b Path.root/"~/b" // => /~/b // but is here -Path("~/foo")! // => /Users/foo +Path("~/foo")! // => /Users/mxcl/foo // this does not work though Path("~foo") // => nil @@ -173,12 +180,21 @@ Path("~foo") // => nil # Installation -SwiftPM only: +SwiftPM: ```swift -package.append(.package(url: "https://github.com/mxcl/Path.swift", from: "0.0.0")) +package.append(.package(url: "https://github.com/mxcl/Path.swift", from: "0.3.0")) ``` +CocoaPods: + +```ruby +pod 'Path.swift' ~> 0.3.0 +``` + +Please note! We are pre 1.0, thus we can change the API as we like! We will tag +1.0 as soon as possible. + ### Get push notifications for new releases https://codebasesaga.com/canopy/