Skip to content

Commit

Permalink
moved availability here from xcodeserversdk
Browse files Browse the repository at this point in the history
  • Loading branch information
czechboy0 committed Oct 3, 2015
1 parent 93d79f0 commit 808dcc4
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 2 deletions.
2 changes: 1 addition & 1 deletion BuildaUtils.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "BuildaUtils"
s.version = "0.1.4"
s.version = "0.1.5"
s.summary = "Shared utilities for the Buildasaur and XcodeServerSDK projects."

s.description = <<-DESC
Expand Down
4 changes: 4 additions & 0 deletions BuildaUtils.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
3A0FF5A61BBFFC1500FB8051 /* Ref.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A0FF5A51BBFFC1500FB8051 /* Ref.swift */; settings = {ASSET_TAGS = (); }; };
3A0FF5A71BBFFC4700FB8051 /* Ref.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A0FF5A51BBFFC1500FB8051 /* Ref.swift */; settings = {ASSET_TAGS = (); }; };
3A0FF5A81BBFFC4800FB8051 /* Ref.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A0FF5A51BBFFC1500FB8051 /* Ref.swift */; settings = {ASSET_TAGS = (); }; };
3A0FF5AA1BBFFD4900FB8051 /* Availability.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A0FF5A91BBFFD4900FB8051 /* Availability.swift */; settings = {ASSET_TAGS = (); }; };
3A5C297F1B5A88E70037C486 /* BuildaUtils.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A81BB4F1B5A7D01004732CD /* BuildaUtils.framework */; };
3A5C298B1B5A8AA80037C486 /* ContainerExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A5C29851B5A8AA80037C486 /* ContainerExtensions.swift */; };
3A5C298C1B5A8AA80037C486 /* Errors.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A5C29861B5A8AA80037C486 /* Errors.swift */; };
Expand Down Expand Up @@ -59,6 +60,7 @@

/* Begin PBXFileReference section */
3A0FF5A51BBFFC1500FB8051 /* Ref.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Ref.swift; sourceTree = "<group>"; };
3A0FF5A91BBFFD4900FB8051 /* Availability.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Availability.swift; sourceTree = "<group>"; };
3A5C297A1B5A88E70037C486 /* BuildaUtilsTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = BuildaUtilsTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
3A5C297E1B5A88E70037C486 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
3A5C29851B5A8AA80037C486 /* ContainerExtensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContainerExtensions.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -166,6 +168,7 @@
children = (
3A81BB521B5A7D01004732CD /* BuildaUtils.h */,
3A81BB541B5A7D01004732CD /* Info.plist */,
3A0FF5A91BBFFD4900FB8051 /* Availability.swift */,
3A5C29851B5A8AA80037C486 /* ContainerExtensions.swift */,
3A5C29861B5A8AA80037C486 /* Errors.swift */,
3A81BB691B5A7D9B004732CD /* Extensions.swift */,
Expand Down Expand Up @@ -407,6 +410,7 @@
3A5C298B1B5A8AA80037C486 /* ContainerExtensions.swift in Sources */,
3A5C298D1B5A8AA80037C486 /* HTTPUtils.swift in Sources */,
3A5C29901B5A8AA80037C486 /* Server.swift in Sources */,
3A0FF5AA1BBFFD4900FB8051 /* Availability.swift in Sources */,
3A5C298F1B5A8AA80037C486 /* Logging.swift in Sources */,
3A0FF5A61BBFFC1500FB8051 /* Ref.swift in Sources */,
);
Expand Down
27 changes: 27 additions & 0 deletions BuildaUtils/Availability.swift
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
}
}
1 change: 0 additions & 1 deletion BuildaUtils/Server.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@ public class HTTPServer : NSObject {
public init(http: HTTP? = nil) {
self.http = http ?? HTTP()
}

}

0 comments on commit 808dcc4

Please sign in to comment.