Skip to content

Commit 7d65c46

Browse files
authored
Merge pull request #2 from Hexaville/swift4
Update files to Swift 4 layout
2 parents 48b2377 + e9fb7fb commit 7d65c46

File tree

5 files changed

+99
-22
lines changed

5 files changed

+99
-22
lines changed

Package.pins

Lines changed: 0 additions & 7 deletions
This file was deleted.

Package.resolved

Lines changed: 79 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
1-
// swift-tools-version:3.1
1+
// swift-tools-version:4.0
22

33
import PackageDescription
44

55
let package = Package(
66
name: "DynamodbSessionStore",
7-
targets: [
8-
Target(name: "DynamodbSessionStore"),
9-
Target(name: "DynamodbSessionStoreTableManager"),
10-
Target(name: "DynamodbSessionStoreExample", dependencies: ["DynamodbSessionStore"])
7+
products: [
8+
.library(name: "DynamodbSessionStore", targets: ["DynamodbSessionStore"]),
9+
.executable(name: "dynamodb-session-store-table-manager", targets: ["DynamodbSessionStoreTableManager"]),
10+
.executable(name: "dynamodb-session-store-example", targets: ["DynamodbSessionStoreExample"]),
1111
],
1212
dependencies: [
13-
.Package(url: "https://github.com/swift-aws/dynamodb.git", majorVersion: 0, minor: 1),
14-
.Package(url: "https://github.com/noppoMan/HexavilleFramework.git", majorVersion: 0, minor: 1)
13+
.package(url: "https://github.com/swift-aws/dynamodb.git", .upToNextMajor(from: "1.0.0")),
14+
.package(url: "https://github.com/noppoMan/HexavilleFramework.git", .upToNextMajor(from: "0.1.15"))
15+
],
16+
targets: [
17+
.target(name: "DynamodbSessionStore", dependencies: ["SwiftAWSDynamodb", "HexavilleFramework"]),
18+
.target(name: "DynamodbSessionStoreTableManager", dependencies: ["DynamodbSessionStore"]),
19+
.target(name: "DynamodbSessionStoreExample", dependencies: ["DynamodbSessionStore"])
1520
]
1621
)

Sources/DynamodbSessionStoreExample/main.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ app.use { req, context in
2020
return .next(req)
2121
}
2222

23-
let router = Router()
23+
var router = Router()
2424

2525
router.use(.get, "/") { req, context in
2626
if let now = context.session?["now"] {

Sources/DynamodbSessionStoreTableManager/main.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ class CreateCommand: Command {
1111

1212
let name = "create"
1313
let tableName = Parameter()
14-
let writeCapacityUnits = Key<Int>("--writeCapacityUnits", usage: "numnber of WriteCapacityUnits")
15-
let readCapacityUnits = Key<Int>("--readCapacityUnits", usage: "numnber of ReadCapacityUnits")
16-
let endpoint = Key<String>("--endpoint", usage: "The endpoint string. ex: http://localhost:8000")
14+
let writeCapacityUnits = Key<Int>("--writeCapacityUnits", description: "numnber of WriteCapacityUnits")
15+
let readCapacityUnits = Key<Int>("--readCapacityUnits", description: "numnber of ReadCapacityUnits")
16+
let endpoint = Key<String>("--endpoint", description: "The endpoint string. ex: http://localhost:8000")
1717

1818
func execute() throws {
1919
let dynamodb = Dynamodb(endpoint: endpoint.value)
@@ -94,7 +94,7 @@ class CreateCommand: Command {
9494
class DeleteCommand: Command {
9595
let name = "delete"
9696
let tableName = Parameter()
97-
let endpoint = Key<String>("--endpoint", usage: "The endpoint string. ex: http://localhost:8000")
97+
let endpoint = Key<String>("--endpoint", description: "The endpoint string. ex: http://localhost:8000")
9898

9999
func execute() throws {
100100
do {
@@ -107,6 +107,6 @@ class DeleteCommand: Command {
107107
}
108108
}
109109

110-
CLI.setup(name: "hexaville-dynamodb-session-store-table-manager")
111-
CLI.register(commands: [CreateCommand(), DeleteCommand()])
112-
_ = CLI.go()
110+
let ddbSesTableManagerCLI = CLI(name: "hexaville-dynamodb-session-store-table-manager")
111+
ddbSesTableManagerCLI.commands = [CreateCommand(), DeleteCommand()]
112+
_ = ddbSesTableManagerCLI.go()

0 commit comments

Comments
 (0)