2020-03-15 08:01:40 +00:00
|
|
|
import Foundation
|
|
|
|
import Combine
|
2020-03-22 01:43:26 +00:00
|
|
|
import Brief
|
2020-03-15 08:01:40 +00:00
|
|
|
|
|
|
|
class PreviewUpdater: UpdaterProtocol {
|
|
|
|
|
|
|
|
let update: Release?
|
|
|
|
|
|
|
|
init(update: Update = .none) {
|
|
|
|
switch update {
|
|
|
|
case .none:
|
|
|
|
self.update = nil
|
|
|
|
case .advisory:
|
|
|
|
self.update = Release(name: "10.10.10", html_url: URL(string: "https://example.com")!, body: "Some regular update")
|
|
|
|
case .critical:
|
|
|
|
self.update = Release(name: "10.10.10", html_url: URL(string: "https://example.com")!, body: "Critical Security Update")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
extension PreviewUpdater {
|
|
|
|
|
|
|
|
enum Update {
|
|
|
|
case none, advisory, critical
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|