Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong title if no rename #77

Merged
merged 1 commit into from
Oct 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions Sources/LicensePlistCore/Entity/Manual.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ extension Manual {
public static func==(lhs: Manual, rhs: Manual) -> Bool {
return lhs.name == rhs.name &&
lhs.nameSpecified == rhs.nameSpecified &&
lhs.version == rhs.version
lhs.version == rhs.version &&
lhs.source == rhs.source
}
}

Expand All @@ -37,26 +38,24 @@ extension Manual {
renames: [String: String]) -> [Manual] {
return raw.map { (manualEntry) -> Manual in
var name = ""
var body = ""
var source = ""
var rename = ""
var version = ""
var body: String?
var source: String?
var version: String?
for valuePair in manualEntry.dictionary ?? [:] {
switch valuePair.key.string ?? "" {
case "source":
source = valuePair.value.string ?? ""
source = valuePair.value.string
case "name":
name = valuePair.value.string ?? ""
case "version":
version = valuePair.value.string ?? ""
version = valuePair.value.string
case "body":
body = valuePair.value.string ?? ""
body = valuePair.value.string
default:
Log.warning("Tried to parse an unknown YAML key")
}
}
rename = renames[name] ?? ""
let manual = Manual(name: name, source: source, nameSpecified: rename, version: version)
let manual = Manual(name: name, source: source, nameSpecified: renames[name], version: version)
manual.body = body // This is so that we do not have to store a body at all ( for testing purposes mostly )
return manual
}
Expand Down
3 changes: 2 additions & 1 deletion Sources/LicensePlistCore/Entity/ManualLicense.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ public struct ManualLicense: License, Equatable {
public let body: String

public static func==(lhs: ManualLicense, rhs: ManualLicense) -> Bool {
return lhs.library == rhs.library
return lhs.library == rhs.library &&
lhs.body == rhs.body
}
}

Expand Down