Skip to content

Commit

Permalink
made the editable struct's members mutable, finally starting to think…
Browse files Browse the repository at this point in the history
… swift-wise
  • Loading branch information
czechboy0 committed Oct 3, 2015
1 parent 789eae5 commit 4b9c23f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion XcodeServerSDK.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "XcodeServerSDK"
s.version = "0.3.3"
s.version = "0.3.4"
s.summary = "Access Xcode Server API with native Swift objects."

s.homepage = "https://github.com/czechboy0/XcodeServerSDK"
Expand Down
19 changes: 14 additions & 5 deletions XcodeServerSDK/XcodeServerConfig.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,33 @@ private struct Keys {

public struct XcodeServerConfig : JSONSerializable {

public let host: String
public let user: String?
public let password: String?
public let port: Int = 20343
public let id: RefType
public var host: String
public var user: String?
public var password: String?

public let port: Int = 20343

//if set to false, fails if server certificate is not trusted yet
public let automaticallyTrustSelfSignedCertificates: Bool = true

public func jsonify() -> NSDictionary {
let dict = NSMutableDictionary()
dict[Keys.Host] = self.host
dict[Keys.Id] = self.id
dict[Keys.Host] = self.host
dict.optionallyAddValueForKey(self.user, key: Keys.User)
dict.optionallyAddValueForKey(self.password, key: Keys.Password)
return dict
}

//creates a new default config
public init() {
self.id = Ref.new()
self.host = ""
self.user = nil
self.password = nil
}

/**
Initializes a server configuration with the provided host.
- parameter host: `Xcode` server host.
Expand Down

0 comments on commit 4b9c23f

Please sign in to comment.