Skip to content

Commit 24e07df

Browse files
committed
Built with Xcode 8.3.1
1 parent 8a8f683 commit 24e07df

File tree

12 files changed

+28
-27
lines changed

12 files changed

+28
-27
lines changed

.swiftlint.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ disabled_rules:
33
- trailing_whitespace
44
- large_tuple
55
- force_try
6+
- identifier_name
67
opt_in_rules:
78
# - missing_docs
89
- force_unwrapping

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# then
44
[![Language: Swift 2 and 3](https://img.shields.io/badge/language-swift2|3-f48041.svg?style=flat)](https://developer.apple.com/swift)
5-
![Platform: iOS 8+](https://img.shields.io/badge/platform-iOS%208%2B-blue.svg?style=flat) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
5+
![Platform: iOS 8+/macOS10.11](https://img.shields.io/badge/platform-iOS%208%2B | OSX-blue.svg?style=flat) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
66
[![Cocoapods compatible](https://img.shields.io/badge/Cocoapods-compatible-4BC51D.svg?style=flat)](https://cocoapods.org)
77
[![Build Status](https://www.bitrise.io/app/ea9933b066f6a2c4.svg?token=i7LK0uQC1rVuXhDq1iskYg&branch=master)](https://www.bitrise.io/app/ea9933b066f6a2c4)
88
[![codebeat badge](https://codebeat.co/badges/768d3017-1e65-47e0-b287-afcb8954a1da)](https://codebeat.co/projects/github-com-s4cha-then)
@@ -390,7 +390,7 @@ Grab this repository and build the Framework target on the example project. Then
390390

391391
## Swift Version
392392
Swift 2 -> version **1.4.2**
393-
Swift 3 -> version **2.2.1**
393+
Swift 3 -> version **2.2.2**
394394

395395
<!-- Place this tag in your head or just before your close body tag. -->
396396
<script async defer src="https://buttons.github.io/buttons.js"></script>

Source/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>2.2.1</string>
18+
<string>2.2.2</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>

then.framework.zip

8.39 KB
Binary file not shown.

thenMacOS/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>2.2.1</string>
18+
<string>2.2.2</string>
1919
<key>CFBundleVersion</key>
2020
<string>$(CURRENT_PROJECT_VERSION)</string>
2121
<key>NSHumanReadableCopyright</key>

thenPromise.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'thenPromise'
3-
s.version = "2.2.1"
3+
s.version = "2.2.2"
44
s.summary = "Elegant Promises for Swift"
55
s.homepage = "https://github.com/freshOS/then"
66
s.license = { :type => "MIT", :file => "LICENSE" }

thenTests/AsyncAwaitTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class AsyncAwaitTests: XCTestCase {
2828
func testFailingAsyncAwait() {
2929
let exp = expectation(description: "")
3030
async {
31-
let _ = try await(failingFetchUserFollowStatusFromName("JohnDoe"))
31+
_ = try await(failingFetchUserFollowStatusFromName("JohnDoe"))
3232
XCTFail()
3333
}.onError { _ in
3434
exp.fulfill()
@@ -39,7 +39,7 @@ class AsyncAwaitTests: XCTestCase {
3939
func testCatchFailingAsyncAwait() {
4040
let exp = expectation(description: "")
4141
do {
42-
let _ = try await(failingFetchUserFollowStatusFromName("JohnDoe"))
42+
_ = try await(failingFetchUserFollowStatusFromName("JohnDoe"))
4343
XCTFail()
4444
} catch {
4545
exp.fulfill()

thenTests/FinallyTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class FinallyTests: XCTestCase {
4545
syncRejectionPromise().registerFinally {
4646
XCTFail()
4747
}
48-
wait(1) {
48+
testWait(1) {
4949
exp.fulfill()
5050
}
5151
waitForExpectations(timeout: 1, handler: nil)

thenTests/Helpers.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ func syncRejectionPromise() -> Promise<Int> {
7070
func fetchUserId() -> Promise<Int> {
7171
return Promise { resolve, _ in
7272
print("fetching user Id ...")
73-
wait {
73+
testWait {
7474
resolve(1234)
7575
print("GOT USER ID 1234")
7676
}
@@ -80,33 +80,33 @@ func fetchUserId() -> Promise<Int> {
8080
func fetchUserNameFromId(_ identifier: Int) -> Promise<String> {
8181
return Promise { resolve, _ in
8282
print("fetching UserName FromId : \(identifier) ...")
83-
wait { resolve("John Smith") }
83+
testWait { resolve("John Smith") }
8484
}
8585
}
8686

8787
func fetchUserFollowStatusFromName(_ name: String) -> Promise<Bool> {
8888
return Promise { resolve, _ in
8989
print("fetchUserFollowStatusFromName: \(name) ...")
90-
wait { resolve(false) }
90+
testWait { resolve(false) }
9191
}
9292
}
9393

9494
func failingFetchUserFollowStatusFromName(_ name: String) -> Promise<Bool> {
9595
return Promise { _, reject in
9696
print("fetchUserFollowStatusFromName: \(name) ...")
97-
wait { reject(MyError.defaultError) }
97+
testWait { reject(MyError.defaultError) }
9898
}
9999
}
100100

101-
func wait(_ callback:@escaping () -> Void) {
101+
func testWait(_ callback:@escaping () -> Void) {
102102
let delay = 0.1 * Double(NSEC_PER_SEC)
103103
let time = DispatchTime.now() + Double(Int64(delay)) / Double(NSEC_PER_SEC)
104104
DispatchQueue.global(qos: DispatchQoS.QoSClass.background).asyncAfter(deadline: time) {
105105
callback()
106106
}
107107
}
108108

109-
func wait(_ time: Double, callback: @escaping () -> Void) {
109+
func testWait(_ time: Double, callback: @escaping () -> Void) {
110110
let delay = time * Double(NSEC_PER_SEC)
111111
let time = DispatchTime.now() + Double(Int64(delay)) / Double(NSEC_PER_SEC)
112112
DispatchQueue.main.asyncAfter(deadline: time) {
@@ -116,9 +116,9 @@ func wait(_ time: Double, callback: @escaping () -> Void) {
116116

117117
func upload() -> Promise<Void> {
118118
return Promise<Void> { resolve, _, progress in
119-
wait {
119+
testWait {
120120
progress(0.8)
121-
wait {
121+
testWait {
122122
resolve()
123123
}
124124
}
@@ -127,9 +127,9 @@ func upload() -> Promise<Void> {
127127

128128
func failingUpload() -> Promise<Void> {
129129
return Promise<Void> { _, reject, progress in
130-
wait {
130+
testWait {
131131
progress(0.8)
132-
wait {
132+
testWait {
133133
reject(NSError(domain: "", code: 1223, userInfo: nil))
134134
}
135135
}

thenTests/OnErrorTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ class OnErrorTests: XCTestCase {
116116
syncRejectionPromise().registerOnError { _ in
117117
XCTFail()
118118
}
119-
wait(1) {
119+
testWait(1) {
120120
exp.fulfill()
121121
}
122122
waitForExpectations(timeout: 1, handler: nil)

0 commit comments

Comments
 (0)