Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update RSC15a for 0.9 #515

Merged
merged 3 commits into from
Oct 18, 2016
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
2 changes: 1 addition & 1 deletion Ably.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "Ably"
s.version = "0.8.7"
s.version = "0.9.0"
s.summary = "iOS client for Ably"
s.description = <<-DESC
iOS client library for ably.io, the realtime messaging service, written in Objective-C and ready for Swift 2.0.
Expand Down
2 changes: 1 addition & 1 deletion Examples/Tests/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- Ably (0.8.7):
- Ably (0.9.0):
- msgpack (= 0.1.8)
- SocketRocket (= 0.5.1)
- msgpack (0.1.8)
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ You can install Ably for iOS through CocoaPods, Carthage or manually.
Add this line to your application's Podfile:

# For Xcode 7.3 and newer
pod 'Ably', '~> 0.8'
pod 'Ably', '~> 0.9'

And then install the dependency:

Expand All @@ -26,13 +26,13 @@ And then install the dependency:
Add this line to your application's Cartfile:

# For Xcode 7.3 and newer
github "ably/ably-ios" ~> 0.8
github "ably/ably-ios" ~> 0.9

And then run `carthage update` to build the framework and drag the built Ably.framework into your Xcode project.

### Manual installation

1. Get the code from GitHub [from the release page](https://github.com/ably/ably-ios/releases/tag/0.8.0), or clone it to get the latest, unstable and possibly underdocumented version: `git clone git@github.com:ably/ably-ios.git`
1. Get the code from GitHub [from the release page](https://github.com/ably/ably-ios/releases/tag/0.9.0), or clone it to get the latest, unstable and possibly underdocumented version: `git clone git@github.com:ably/ably-ios.git`
2. Drag the directory `ably-ios/ably-ios` into your project as a group.
3. Ably depends on [SocketRocket](https://github.com/facebook/SocketRocket) 0.5.1; get it [from the releases page](https://github.com/facebook/SocketRocket/releases/tag/0.5.1) and follow [its manual installation instructions](https://github.com/facebook/SocketRocket#installing-ios).
4. Ably also depends on [msgpack](https://github.com/rvi/msgpack-objective-C) 0.1.8; get it [from the releases page](https://github.com/rvi/msgpack-objective-C/releases/tag/0.1.8) and link it into your project.
Expand Down
3 changes: 2 additions & 1 deletion Source/ARTDefault.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
//

#import <Foundation/Foundation.h>
#import "CompatibilityMacros.h"

@interface ARTDefault : NSObject

+ (NSArray*)fallbackHosts;
+ (__GENERIC(NSArray, NSString *) *)fallbackHosts;
+ (NSString*)restHost;
+ (NSString*)realtimeHost;
+ (int)port;
Expand Down
2 changes: 1 addition & 1 deletion Source/ARTDefault.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ @implementation ARTDefault

NSString *const ARTDefault_restHost = @"rest.ably.io";
NSString *const ARTDefault_realtimeHost = @"realtime.ably.io";
NSString *const ARTDefault_version = @"0.8";
NSString *const ARTDefault_version = @"0.9";
NSString *const ARTDefault_ablyBundleId = @"io.ably.Ably";
NSString *const ARTDefault_bundleVersionKey = @"CFBundleShortVersionString";
NSString *const ARTDefault_platform = @"ios-";
Expand Down
2 changes: 1 addition & 1 deletion Source/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>0.8.7</string>
<string>0.9.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
2 changes: 1 addition & 1 deletion Spec/RealtimeClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class RealtimeClient: QuickSpec {
channel.publish(nil, data: "message") { error in
expect(error).to(beNil())
let transport = client.transport as! TestProxyTransport
expect(transport.lastUrl!.query).to(haveParam("v", withValue: "0.8"))
expect(transport.lastUrl!.query).to(haveParam("v", withValue: "0.9"))
done()
}
}
Expand Down
4 changes: 2 additions & 2 deletions Spec/RealtimeClientConnection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ class RealtimeClientConnection: QuickSpec {
done()
case .Connected:
if let transport = client.transport as? TestProxyTransport, let query = transport.lastUrl?.query {
expect(query).to(haveParam("lib", withValue: "ios-0.8.7"))
expect(query).to(haveParam("lib", withValue: "ios-0.9.0"))
}
else {
XCTFail("MockTransport isn't working")
Expand Down Expand Up @@ -2824,7 +2824,7 @@ class RealtimeClientConnection: QuickSpec {
NSRegularExpression.extract(url.absoluteString, pattern: "[a-e].ably-realtime.com")
}
let resultFallbackHosts = urlConnections.flatMap(extractHostname)
let expectedFallbackHosts = Array(expectedHostOrder.map({ ARTDefault.fallbackHosts()[$0] as! String }))
let expectedFallbackHosts = Array(expectedHostOrder.map({ ARTDefault.fallbackHosts()[$0] }))

expect(resultFallbackHosts).to(equal(expectedFallbackHosts))
}
Expand Down
16 changes: 12 additions & 4 deletions Spec/RestClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class RestClient: QuickSpec {
channel.publish(nil, data: "message") { error in
expect(error).to(beNil())
let version = testHTTPExecutor.requests.first!.allHTTPHeaderFields?["X-Ably-Version"]
expect(version).to(equal("0.8"))
expect(version).to(equal("0.9"))
done()
}
}
Expand Down Expand Up @@ -758,6 +758,14 @@ class RestClient: QuickSpec {
ARTFallback_getRandomHostIndex = originalARTFallback_getRandomHostIndex
}

it("default fallback hosts should match @[a-e].ably-realtime.com@") {
let defaultFallbackHosts = ARTDefault.fallbackHosts()
defaultFallbackHosts.forEach { host in
expect(host).to(match("[a-e].ably-realtime.com"))
}
expect(defaultFallbackHosts).to(haveCount(5))
}

it("until httpMaxRetryCount has been reached") {
let options = ARTClientOptions(key: "xxxx:xxxx")
let client = ARTRest(options: options)
Expand All @@ -784,7 +792,7 @@ class RestClient: QuickSpec {
NSRegularExpression.extract(request.URL!.absoluteString, pattern: "[a-e].ably-realtime.com")
}
let resultFallbackHosts = testHTTPExecutor.requests.flatMap(extractHostname)
let expectedFallbackHosts = Array(expectedHostOrder.map({ ARTDefault.fallbackHosts()[$0] as! String })[0..<Int(options.httpMaxRetryCount)])
let expectedFallbackHosts = Array(expectedHostOrder.map({ ARTDefault.fallbackHosts()[$0] })[0..<Int(options.httpMaxRetryCount)])

expect(resultFallbackHosts).to(equal(expectedFallbackHosts))
}
Expand Down Expand Up @@ -840,7 +848,7 @@ class RestClient: QuickSpec {
NSRegularExpression.extract(request.URL!.absoluteString, pattern: "[a-e].ably-realtime.com")
}
let resultFallbackHosts = testHTTPExecutor.requests.flatMap(extractHostname)
let expectedFallbackHosts = expectedHostOrder.map { ARTDefault.fallbackHosts()[$0] as! String }
let expectedFallbackHosts = expectedHostOrder.map { ARTDefault.fallbackHosts()[$0] }

expect(resultFallbackHosts).to(equal(expectedFallbackHosts))
}
Expand Down Expand Up @@ -1092,7 +1100,7 @@ class RestClient: QuickSpec {
let ablyBundleLibVersion = ARTDefault.libraryVersion()
expect(headerLibVersion).to(equal(ablyBundleLibVersion))

let patternToMatch = "ios-0.8."
let patternToMatch = "ios-0.9."
let match = headerLibVersion?.hasPrefix(patternToMatch)
expect(match).to(beTrue())

Expand Down