Skip to content
This repository has been archived by the owner on Dec 3, 2023. It is now read-only.

Commit

Permalink
versions and releasedAgo are optional as well
Browse files Browse the repository at this point in the history
  • Loading branch information
kiliankoe committed Aug 17, 2019
1 parent 2c59d28 commit 7255d05
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions Sources/SwiftLibrary/PackageData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ public struct PackageData: Decodable {
public let repositoryIdentifier: String
public let name: String
public let description: String?
public let versions: Versions
public let releasedAgo: String
public let versions: Versions?
public let releasedAgo: String?
public let swiftVersions: String
public let license: String?
public let supportedMacosVersion: String?
Expand Down Expand Up @@ -44,15 +44,15 @@ extension PackageData {

public var longDescription: String {
var output = """
\(repositoryIdentifier) \(versions.latest) \(versions.latest_stable ?? "")
\(repositoryIdentifier) \(versions?.latest ?? "") \(versions?.latest_stable ?? "")
\(description ?? "No description available")
\(stargazers) stargazers
\(watchers) watchers
Licensed under \(license ?? "n/a").
Supports Swift \(swiftVersions).
Last released \(releasedAgo) ago.
Last released \(releasedAgo ?? "n/a") ago.
Contains \(libraryCount) library/libraries.
Contains \(executableCount) executable(s).
Expand Down
2 changes: 1 addition & 1 deletion Tests/SwiftLibraryTests/SwiftLibraryTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ final class SwiftLibraryTests: XCTestCase {
SwiftLibrary.query("Swift Package Manager") { result in
switch result {
case .failure(let error):
XCTFail("Received error: \(error.localizedDescription)")
XCTFail("Received error: \(error)")
e.fulfill()
case .success(let packages):
XCTAssertFalse(packages.isEmpty)
Expand Down

0 comments on commit 7255d05

Please sign in to comment.