-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
moved availability here from xcodeserversdk
- Loading branch information
Showing
4 changed files
with
32 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// | ||
// Availability.swift | ||
// BuildaUtils | ||
// | ||
// Created by Honza Dvorsky on 10/3/15. | ||
// Copyright © 2015 Honza Dvorsky. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
public enum AvailabilityCheckState: Equatable { | ||
case Unchecked | ||
case Checking | ||
case Failed(NSError?) | ||
case Succeeded | ||
} | ||
|
||
/// Added `Equatable` to the enum to better test properties of this enum. | ||
public func == (a:AvailabilityCheckState, b:AvailabilityCheckState) -> Bool { | ||
switch(a,b) { | ||
case (.Unchecked, .Unchecked) : return true | ||
case (.Checking, .Checking) : return true | ||
case (.Failed(let fa), .Failed(let fb)) : return fa == fb | ||
case (.Succeeded, .Succeeded) : return true | ||
default: return false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,5 +15,4 @@ public class HTTPServer : NSObject { | |
public init(http: HTTP? = nil) { | ||
self.http = http ?? HTTP() | ||
} | ||
|
||
} |