From c4e04ae5b01fc069763a09205a377c6738c4d572 Mon Sep 17 00:00:00 2001 From: Valentin Corral Date: Wed, 26 Apr 2017 12:23:30 +0200 Subject: [PATCH 1/2] Updated to Vapor 2 --- Package.swift | 4 +--- Sources/AWSSignatureV4/ErrorParser/ErrorParser.swift | 2 +- Sources/S3/S3.swift | 4 ++-- Sources/VaporS3/Provider.swift | 6 ++++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Package.swift b/Package.swift index 2f1e6f9..14e8b83 100644 --- a/Package.swift +++ b/Package.swift @@ -1,7 +1,5 @@ import PackageDescription -let alpha = Version(2,0,0, prereleaseIdentifiers: ["alpha"]) - let package = Package( name: "AWS", targets: [ @@ -11,6 +9,6 @@ let package = Package( Target(name: "VaporS3", dependencies: ["S3"]), ], dependencies: [ - .Package(url: "https://github.com/vapor/vapor.git", alpha), + .Package(url: "https://github.com/vapor/vapor.git", Version(2,0,0, prereleaseIdentifiers: ["beta"])), ] ) diff --git a/Sources/AWSSignatureV4/ErrorParser/ErrorParser.swift b/Sources/AWSSignatureV4/ErrorParser/ErrorParser.swift index a01735f..8e8d2f5 100644 --- a/Sources/AWSSignatureV4/ErrorParser/ErrorParser.swift +++ b/Sources/AWSSignatureV4/ErrorParser/ErrorParser.swift @@ -38,7 +38,7 @@ extension ErrorParser { let errorBytes = consume(until: .lessThan) guard let error = ErrorParser.awsGrammar.contains(errorBytes) else { - throw Error.unknownError(errorBytes.string) + throw Error.unknownError(errorBytes.makeString()) } return error diff --git a/Sources/S3/S3.swift b/Sources/S3/S3.swift index 7bb0a1e..959c920 100644 --- a/Sources/S3/S3.swift +++ b/Sources/S3/S3.swift @@ -41,7 +41,7 @@ public struct S3 { //TODO(Brett): headers & AccessControlList ) - let response = try EngineClient.put(url, headers, Body.data(bytes)) + let response = try EngineClient.factory.put(url, headers, Body.data(bytes)) guard response.status == .ok else { guard let bytes = response.body.bytes else { throw Error.invalidResponse(response.status) @@ -55,7 +55,7 @@ public struct S3 { let url = generateURL(for: path) let headers = try signer.sign(path: path) - let response = try EngineClient.get(url, headers) + let response = try EngineClient.factory.get(url, headers) guard response.status == .ok else { guard let bytes = response.body.bytes else { throw Error.invalidResponse(response.status) diff --git a/Sources/VaporS3/Provider.swift b/Sources/VaporS3/Provider.swift index 0646614..e198de1 100644 --- a/Sources/VaporS3/Provider.swift +++ b/Sources/VaporS3/Provider.swift @@ -6,7 +6,7 @@ private let s3StorageKey = "s3-provider:s3" public final class Provider: Vapor.Provider { let s3: S3 - + public static var repositoryName: String = "VaporS3" /// Initialize the provider with an s3 instance public init(_ s3: S3) { self.s3 = s3 @@ -45,7 +45,9 @@ public final class Provider: Vapor.Provider { drop.storage[s3StorageKey] = s3 } - public func beforeRun(_ drop: Droplet) throws {} + public func boot(_ config: Config) throws {} + + public func beforeRun(_ droplet: Droplet) throws {} } extension Droplet { From 3b3d25eb35afd7c07e004df8cf70463a4d8f967e Mon Sep 17 00:00:00 2001 From: Valentin Corral Date: Wed, 26 Apr 2017 13:05:48 +0200 Subject: [PATCH 2/2] fix for travis.yml --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index d9090e0..b1ed834 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,8 @@ os: - - linux - - osx + - linux language: generic sudo: required dist: trusty script: - - eval "$(curl -sL https://swift.vapor.sh/ci-3.1)" + - eval "$(curl -sL https://gist.githubusercontent.com/BrettRToomey/1256d98cce5546c696cc68d9f61ad46f/raw/d5fb266a17f26c41b59fd00867a3a2474c3efee3/TravisSwift31)" + - eval "$(curl -sL https://swift.vapor.sh/codecov)"