Skip to content

Commit

Permalink
Merge pull request #323 from yonaskolb/dot_keys
Browse files Browse the repository at this point in the history
Fix decoding dictionaries with dot keys
  • Loading branch information
yonaskolb authored Jun 26, 2018
2 parents 35da48c + bf61995 commit e5e5c4b
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
"repositoryURL": "https://github.com/yonaskolb/JSONUtilities.git",
"state": {
"branch": null,
"revision": "6403a5455f30add5413095d1b5a70e8a5eb83ba0",
"version": "3.3.8"
"revision": "d9f957b1b2a078c93f96c723040d4cbffcb7d3f9",
"version": "4.0.2"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ let package = Package(
.package(url: "https://github.com/kylef/PathKit.git", from: "0.9.0"),
.package(url: "https://github.com/kylef/Commander.git", from: "0.8.0"),
.package(url: "https://github.com/jpsim/Yams.git", from: "0.3.6"),
.package(url: "https://github.com/yonaskolb/JSONUtilities.git", from: "3.3.0"),
.package(url: "https://github.com/yonaskolb/JSONUtilities.git", from: "4.0.0"),
.package(url: "https://github.com/yonaskolb/Spectre.git", from: "0.8.1"),
.package(url: "https://github.com/onevcat/Rainbow.git", from: "3.0.0"),
.package(url: "https://github.com/xcodeswift/xcproj.git", from: "4.1.0")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,16 @@
ReferencedContainer = "container:Project.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<CommandLineArguments>
<CommandLineArgument
argument = "argument"
isEnabled = "YES">
</CommandLineArgument>
<CommandLineArgument
argument = "argument.with.dot"
isEnabled = "YES">
</CommandLineArgument>
</CommandLineArguments>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
Expand Down
4 changes: 4 additions & 0 deletions Tests/Fixtures/TestProject/project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,7 @@ schemes:
preActions:
- script: echo Starting Framework Build
settingsTarget: Framework_iOS
run:
commandLineArguments:
argument: YES
argument.with.dot: YES
15 changes: 15 additions & 0 deletions Tests/XcodeGenKitTests/SpecLoadingTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,21 @@ class SpecLoadingTests: XCTestCase {
}
}
}

func testDecoding() throws {
describe {
$0.it("decodes dots in dictionary keys") {
let dictionary: [String: Any] = [
"test": [
"one.two": true
]
]

let booleans: [String: Bool] = try dictionary.json(atKeyPath: "test")
try expect(booleans) == ["one.two": true]
}
}
}
}

@discardableResult
Expand Down

0 comments on commit e5e5c4b

Please sign in to comment.