Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/macOS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

strategy:
matrix:
xcode: ["/Applications/Xcode_11.6.app","/Applications/Xcode_11.7_beta.app","/Applications/Xcode_12_beta.app"]
xcode: ["/Applications/Xcode_11.5.app","/Applications/Xcode_11.6.app","/Applications/Xcode_11.7.app","/Applications/Xcode_12.app"]

steps:
- uses: actions/checkout@v2
Expand All @@ -39,7 +39,7 @@ jobs:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Build Documentation
if: ${{ matrix.xcode == '/Applications/Xcode_12_beta.app' }}
run: swift run sourcedocs generate build -c --spm-module MistKit
run: swift run sourcedocs generate build -cra
- name: Commit files
if: ${{ matrix.xcode == '/Applications/Xcode_12_beta.app' }}
run: |
Expand Down
2 changes: 1 addition & 1 deletion Documentation/Reference/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,4 @@
- [ModifyRecordQueryRequest.Data](typealiases/ModifyRecordQueryRequest.Data.md)
- [ModifyRecordQueryRequest.Response](typealiases/ModifyRecordQueryRequest.Response.md)

This file was generated by [SourceDocs](https://github.com/eneko/SourceDocs) on 2020-09-15 23:54:29 +0000
This file was generated by [SourceDocs](https://github.com/eneko/SourceDocs)
5 changes: 4 additions & 1 deletion Documentation/Reference/extensions/MKDatabase.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ public extension MKDatabase where HttpClient == MKURLSessionClient
### `init(connection:factory:tokenManager:session:)`

```swift
init(connection: MKDatabaseConnection, factory: MKURLBuilderFactory? = nil, tokenManager: MKTokenManagerProtocol? = nil, session: URLSession? = nil)
init(connection: MKDatabaseConnection,
factory: MKURLBuilderFactory? = nil,
tokenManager: MKTokenManagerProtocol? = nil,
session: URLSession? = nil)
```

### `query(_:_:)`
Expand Down
5 changes: 4 additions & 1 deletion Documentation/Reference/structs/MKDatabase.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ public struct MKDatabase<HttpClient: MKHttpClient>
### `init(connection:factory:client:tokenManager:)`

```swift
public init(connection: MKDatabaseConnection, factory: MKURLBuilderFactory? = nil, client: HttpClient, tokenManager: MKTokenManagerProtocol? = nil)
public init(connection: MKDatabaseConnection,
factory: MKURLBuilderFactory? = nil,
client: HttpClient,
tokenManager: MKTokenManagerProtocol? = nil)
```

### `perform(request:returnFailedAuthentication:_:)`
Expand Down
10 changes: 8 additions & 2 deletions Sources/MistKit/MKDatabase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ public struct MKDatabase<HttpClient: MKHttpClient> {
let decoder: MKDecoder = JSONDecoder()
let client: HttpClient

public init(connection: MKDatabaseConnection, factory: MKURLBuilderFactory? = nil, client: HttpClient, tokenManager: MKTokenManagerProtocol? = nil) {
public init(connection: MKDatabaseConnection,
factory: MKURLBuilderFactory? = nil,
client: HttpClient,
tokenManager: MKTokenManagerProtocol? = nil) {
let factory = factory ?? MKURLBuilderFactory()
urlBuilder = factory.builder(forConnection: connection, withTokenManager: tokenManager)
self.client = client
Expand Down Expand Up @@ -82,7 +85,10 @@ public struct MKDatabase<HttpClient: MKHttpClient> {
#endif

public extension MKDatabase where HttpClient == MKURLSessionClient {
init(connection: MKDatabaseConnection, factory: MKURLBuilderFactory? = nil, tokenManager: MKTokenManagerProtocol? = nil, session: URLSession? = nil) {
init(connection: MKDatabaseConnection,
factory: MKURLBuilderFactory? = nil,
tokenManager: MKTokenManagerProtocol? = nil,
session: URLSession? = nil) {
let factory = factory ?? MKURLBuilderFactory()
urlBuilder = factory.builder(forConnection: connection, withTokenManager: tokenManager)
client = MKURLSessionClient(session: session ?? URLSession.shared)
Expand Down
13 changes: 6 additions & 7 deletions Sources/mistdemoc/Commands/ParsableAsyncCommand.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import ArgumentParser
import CoreFoundation
import Foundation

protocol ParsableAsyncCommand: ParsableCommand {
Expand All @@ -7,17 +8,15 @@ protocol ParsableAsyncCommand: ParsableCommand {

extension ParsableAsyncCommand {
func run() throws {
var result: Result<Void, Error>?
var result: Result<Void, Error>!

runAsync { error in
result = Result(error)
CFRunLoopStop(CFRunLoopGetMain())
}

while true {
RunLoop.main.run(until: .distantPast)
if let result = result {
return try result.get()
}
}
CFRunLoopRun()

return try result.get()
}
}