From c9a26cd4f307ccc6b2b20e37b74ff10087efd5e8 Mon Sep 17 00:00:00 2001 From: Andrea Sacerdoti Date: Mon, 15 Jun 2020 14:48:37 +0200 Subject: [PATCH 1/4] Add syntax highlighting in README --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 15dcb97..9d53ff3 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ https://github.com/Ast3r10n/swiftquests ### Cocoapods Add `SwiftQuests` to your Podfile: -``` +```ruby pod 'SwiftQuests' ``` @@ -29,7 +29,7 @@ Once initialised, a `Request` is (for the most part) immutable. Its task will on To perform a basic `Request`, initialise one: -``` +```swift do { let request = try Request(.get, atPath: "/user") @@ -39,7 +39,7 @@ do { ``` You then call the `perform` method to launch its associated task. -``` +```swift do { try request.perform { result in // Response implementation @@ -55,7 +55,7 @@ do { Here's an example `Request` to get a `Decodable` `User` object from the `/user` endpoint. -``` +```swift do { try Request(.get, atPath: "/user") From 6055035cc4d67aacdcdd24c2b1627beecba429eb Mon Sep 17 00:00:00 2001 From: Andrea Sacerdoti Date: Thu, 27 Aug 2020 17:43:44 +0200 Subject: [PATCH 2/4] Make RequestConfigurationHolder.configuration public --- Sources/SwiftQuests/RequestConfigurationHolder.swift | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Sources/SwiftQuests/RequestConfigurationHolder.swift b/Sources/SwiftQuests/RequestConfigurationHolder.swift index f4efc2d..30acf28 100644 --- a/Sources/SwiftQuests/RequestConfigurationHolder.swift +++ b/Sources/SwiftQuests/RequestConfigurationHolder.swift @@ -14,9 +14,8 @@ public class RequestConfigurationHolder { /// The holder singleton instance. public static var shared = RequestConfigurationHolder() - // MARK: - Internal Properties /// The configuration assigned to the holder. - var configuration: RequestConfiguration + public var configuration: RequestConfiguration // MARK: - Internal Methods /// Creates a holder object, assigning the specified configuration. From d79c48e481daa641568d239775bfe920a101adc3 Mon Sep 17 00:00:00 2001 From: Andrea Sacerdoti Date: Mon, 31 Aug 2020 12:12:14 +0200 Subject: [PATCH 3/4] Set RequestConfigurationHolder.configuration set internal --- Sources/SwiftQuests/RequestConfigurationHolder.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/SwiftQuests/RequestConfigurationHolder.swift b/Sources/SwiftQuests/RequestConfigurationHolder.swift index 30acf28..207bc8d 100644 --- a/Sources/SwiftQuests/RequestConfigurationHolder.swift +++ b/Sources/SwiftQuests/RequestConfigurationHolder.swift @@ -15,7 +15,7 @@ public class RequestConfigurationHolder { public static var shared = RequestConfigurationHolder() /// The configuration assigned to the holder. - public var configuration: RequestConfiguration + public internal(set) var configuration: RequestConfiguration // MARK: - Internal Methods /// Creates a holder object, assigning the specified configuration. From 9ce12a67109fd7609bfd916c2a6255278a6f0ea1 Mon Sep 17 00:00:00 2001 From: Andrea Sacerdoti Date: Fri, 11 Sep 2020 11:02:16 +0200 Subject: [PATCH 4/4] Update RequestConfiguration protocol to allow computed properties --- .../SwiftQuests/DefaultRequestConfiguration.swift | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Sources/SwiftQuests/DefaultRequestConfiguration.swift b/Sources/SwiftQuests/DefaultRequestConfiguration.swift index 00e57ed..0c4047e 100644 --- a/Sources/SwiftQuests/DefaultRequestConfiguration.swift +++ b/Sources/SwiftQuests/DefaultRequestConfiguration.swift @@ -13,22 +13,22 @@ public protocol RequestConfiguration { /// The default Request headers. /// /// Any headers passed to specific `Requests` would be appended to these. - var defaultHeaders: [String: String] { get set } + var defaultHeaders: [String: String] { get } /// The Request protocol. - var requestProtocol: String { get set } + var requestProtocol: String { get } /// The default base URL (not including protocol). - var baseURL: String { get set } + var baseURL: String { get } /// The default port. - var port: Int { get set } + var port: Int { get } /// The server's authentication realm. - var authenticationRealm: String { get set } + var authenticationRealm: String { get } /// The default authentication method to use with Requests. - var authenticationMethod: String { get set } + var authenticationMethod: String { get } } public extension RequestConfiguration {