From 0afb548bf7957f5632fafbd5f57bb0bcc2b7976c Mon Sep 17 00:00:00 2001 From: kiokumicu Date: Fri, 13 May 2016 01:40:27 +0400 Subject: [PATCH] Updated Swift 04-25 and 05-03 snapshots (#6) * Updated Swift 04-25 * Updating to 05.03 snapshot --- .swift-version | 2 +- .travis.yml | 4 +--- Package.swift | 2 +- Sources/Initializable.swift | 2 +- Sources/StructuredData.swift | 8 ++++---- Tests/Mapper/InitializableTests.swift | 2 +- 6 files changed, 9 insertions(+), 11 deletions(-) diff --git a/.swift-version b/.swift-version index aef133a..8590c95 100644 --- a/.swift-version +++ b/.swift-version @@ -1 +1 @@ -swift-DEVELOPMENT-SNAPSHOT-2016-04-12-a +DEVELOPMENT-SNAPSHOT-2016-05-03-a diff --git a/.travis.yml b/.travis.yml index 6b539d2..f850789 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,9 +9,7 @@ dist: trusty osx_image: xcode7.3 install: - eval "$(curl -sL https://raw.githubusercontent.com/Zewo/Zewo/5254525d9da56df29346fd76e99529c22034d61d/Scripts/install-swiftenv.sh)" -script: - - swift build --fetch # clones all dependencies - - rm -rf Packages/*/Tests # deletes dependency's tests until duplicate Package.tests issue can be resolved in SPM. At that point, remove. +script: - swift build -Xlinker -rpath -Xlinker $(pwd)/.build/debug/ - swift build --configuration release -Xlinker -rpath -Xlinker $(pwd)/.build/release/ - swift test diff --git a/Package.swift b/Package.swift index 85566e0..bad7820 100644 --- a/Package.swift +++ b/Package.swift @@ -3,6 +3,6 @@ import PackageDescription let package = Package( name: "Mapper", dependencies: [ - .Package(url: "https://github.com/Zewo/StructuredData.git", majorVersion: 0, minor: 5) + .Package(url: "https://github.com/Zewo/StructuredData.git", majorVersion: 0, minor: 7) ] ) diff --git a/Sources/Initializable.swift b/Sources/Initializable.swift index 0a03f22..f9211fd 100644 --- a/Sources/Initializable.swift +++ b/Sources/Initializable.swift @@ -32,7 +32,7 @@ public enum InitializableError: ErrorProtocol { extension Int: StructuredDataInitializable { public init(structuredData: StructuredData) throws { switch structuredData { - case .numberValue(let number): + case .integerValue(let number): self.init(number) default: throw InitializableError.cantBindToNeededType diff --git a/Sources/StructuredData.swift b/Sources/StructuredData.swift index 37be477..1a6e8a2 100644 --- a/Sources/StructuredData.swift +++ b/Sources/StructuredData.swift @@ -31,14 +31,14 @@ extension StructuredData { } extension StructuredData { - internal func mapThrough(@noescape _ transform: (StructuredData throws -> T)) throws -> [T] { + internal func mapThrough(_ transform: (@noescape StructuredData throws -> T)) throws -> [T] { if let array = self.array { return try array.map(transform) } throw StructuredData.Error.incompatibleType } - internal func mapThrough(_ key: String, @noescape transform: (StructuredData throws -> T)) throws -> [T] { + internal func mapThrough(_ key: String, transform: (@noescape StructuredData throws -> T)) throws -> [T] { if let value = self[key] { return try value.mapThrough(transform) } @@ -52,14 +52,14 @@ extension StructuredData { // throw StructuredData.Error.incompatibleType // } - internal func flatMapThrough(@noescape _ transform: (StructuredData throws -> T?)) throws -> [T] { + internal func flatMapThrough(_ transform: (@noescape StructuredData throws -> T?)) throws -> [T] { if let array = self.array { return try array.flatMap(transform) } throw StructuredData.Error.incompatibleType } - internal func flatMapThrough(_ key: String, @noescape transform: (StructuredData throws -> T?)) throws -> [T] { + internal func flatMapThrough(_ key: String, transform: (@noescape StructuredData throws -> T?)) throws -> [T] { if let value = self[key] { return try value.flatMapThrough(transform) } diff --git a/Tests/Mapper/InitializableTests.swift b/Tests/Mapper/InitializableTests.swift index c684e67..92586bf 100644 --- a/Tests/Mapper/InitializableTests.swift +++ b/Tests/Mapper/InitializableTests.swift @@ -11,7 +11,7 @@ class InitializableTests: XCTestCase { } func testInt() { - let structuredData: StructuredData = 5.0 + let structuredData: StructuredData = 5 let int = try! Int(structuredData: structuredData) XCTAssertEqual(int, 5) }