Skip to content

Commit

Permalink
Merge pull request #3 from IanKeen/RTMAPI-cleanup
Browse files Browse the repository at this point in the history
RTMAPI Updates
  • Loading branch information
IanKeen committed Jun 15, 2016
2 parents d7340b8 + 3bfb619 commit 4540a80
Show file tree
Hide file tree
Showing 67 changed files with 294 additions and 201 deletions.
2 changes: 1 addition & 1 deletion Sources/App/Services/HelloBot.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// HelloBot.swift
// Slack
// Chameleon
//
// Created by Ian Keen on 4/06/2016.
//
Expand Down
2 changes: 1 addition & 1 deletion Sources/App/Services/KarmaBot.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// KarmaBot.swift
// Slack
// Chameleon
//
// Created by Ian Keen on 21/05/2016.
// Copyright © 2016 Mustard. All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion Sources/App/main.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// main.swift
// Slack
// Chameleon
//
// Created by Ian Keen on 28/05/2016.
// Copyright © 2016 Mustard. All rights reserved.
Expand Down
8 changes: 4 additions & 4 deletions Sources/Bot/Adaptors/MessageAdaptor.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// MessageAdaptor.swift
// Slack
// Chameleon
//
// Created by Ian Keen on 21/05/2016.
// Copyright © 2016 Mustard. All rights reserved.
Expand Down Expand Up @@ -73,7 +73,7 @@ public struct MessageAdaptor {
}

//MARK: - Lifecycle
internal init(message: Message, slackModels: SlackBot.SlackModelClosure) {
init(message: Message, slackModels: SlackBot.SlackModelClosure) {
self.message = message
self.slackModels = slackModels
}
Expand All @@ -84,7 +84,7 @@ extension MessageAdaptor {
public let link: String
public let displayText: String

internal init?(link: String) {
init?(link: String) {
let components = link.components(separatedBy: "|")

guard
Expand All @@ -98,7 +98,7 @@ extension MessageAdaptor {
}

extension Message {
internal func toAdaptor(slackModels: SlackBot.SlackModelClosure) -> MessageAdaptor {
func toAdaptor(slackModels: SlackBot.SlackModelClosure) -> MessageAdaptor {
return MessageAdaptor(message: self, slackModels: slackModels)
}
}
2 changes: 1 addition & 1 deletion Sources/Bot/Builders/SlackMessageBuilder+Operators.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// SlackMessageBuilder+Operators.swift
// Slack
// Chameleon
//
// Created by Ian Keen on 6/06/2016.
//
Expand Down
2 changes: 1 addition & 1 deletion Sources/Bot/Builders/SlackMessageBuilder.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// SlackMessageBuilder.swift
// Slack
// Chameleon
//
// Created by Ian Keen on 6/06/2016.
//
Expand Down
2 changes: 1 addition & 1 deletion Sources/Bot/Services/Storage/MemoryStorage.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// MemoryStorage.swift
// Slack
// Chameleon
//
// Created by Ian Keen on 24/05/2016.
// Copyright © 2016 Mustard. All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion Sources/Bot/Services/Storage/PlistStorage.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
////
//// PlistStorage.swift
//// Slack
//// Chameleon
////
//// Created by Ian Keen on 23/05/2016.
//// Copyright © 2016 Mustard. All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion Sources/Bot/Services/Storage/Storage.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// Storage.swift
// Slack
// Chameleon
//
// Created by Ian Keen on 23/05/2016.
// Copyright © 2016 Mustard. All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion Sources/Bot/SlackBot+API.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// SlackBot+API.swift
// Slack
// Chameleon
//
// Created by Ian Keen on 19/05/2016.
// Copyright © 2016 Mustard. All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion Sources/Bot/SlackBot+Config.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// SlackBot+Config.swift
// Slack
// Chameleon
//
// Created by Ian Keen on 19/05/2016.
// Copyright © 2016 Mustard. All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion Sources/Bot/SlackBot+Convenience.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// SlackBot+Convenience.swift
// Slack
// Chameleon
//
// Created by Ian Keen on 7/06/2016.
//
Expand Down
2 changes: 1 addition & 1 deletion Sources/Bot/SlackBot+Interaction.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// SlackBot+Interaction.swift
// Slack
// Chameleon
//
// Created by Ian Keen on 21/05/2016.
// Copyright © 2016 Mustard. All rights reserved.
Expand Down
26 changes: 13 additions & 13 deletions Sources/Bot/SlackBot.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// SlackBot.swift
// Slack
// Chameleon
//
// Created by Ian Keen on 19/05/2016.
// Copyright © 2016 Mustard. All rights reserved.
Expand Down Expand Up @@ -37,16 +37,16 @@ public class SlackBot {
}
}

//MARK: - Internal Properties
internal let webAPI: WebAPI
internal let rtmAPI: RTMAPI
internal private(set) var botUser: BotUser?
internal private(set) var team: Team?
internal private(set) var users: [User] = []
internal private(set) var channels: [Channel] = []
internal private(set) var groups: [Group] = []
internal private(set) var ims: [IM] = []
//internal private(set) var mpims: [MPIM] = []
//MARK: - Properties
let webAPI: WebAPI
let rtmAPI: RTMAPI
private(set) var botUser: BotUser?
private(set) var team: Team?
private(set) var users: [User] = []
private(set) var channels: [Channel] = []
private(set) var groups: [Group] = []
private(set) var ims: [IM] = []
//private(set) var mpims: [MPIM] = []

//MARK: - Public Properties
public private(set) var storage: Storage
Expand Down Expand Up @@ -189,7 +189,7 @@ extension SlackBot {
guard self.state.ready else { return }
self.apis.forEach { $0.event(slackBot: self, event: event, webApi: self.webAPI) }
}
internal func notify(error: ErrorProtocol) {
func notify(error: ErrorProtocol) {
guard self.state.ready else { return }
self.apis.forEach { $0.error(slackBot: self, error: error) }
}
Expand Down Expand Up @@ -257,7 +257,7 @@ extension SlackBot {

//MARK: - Model Helpers
extension SlackBot {
internal typealias SlackModelClosure = WebAPI.SlackModelClosure
typealias SlackModelClosure = WebAPI.SlackModelClosure

private func slackModels() -> SlackModelClosure {
return {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Common/Box.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// Box.swift
// Slack
// Chameleon
//
// Created by Ian Keen on 22/05/2016.
// Copyright © 2016 Mustard. All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion Sources/Common/Dictionary+Extensions.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// Dictionary+Extensions.swift
// Slack
// Chameleon
//
// Created by Ian Keen on 11/05/2016.
// Copyright © 2016 Mustard. All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion Sources/Common/Int+Extensions.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// Int+Extensions.swift
// Slack
// Chameleon
//
// Created by Ian Keen on 8/06/2016.
//
Expand Down
2 changes: 1 addition & 1 deletion Sources/Common/JSON+KeyPath.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// JSON+KeyPath.swift
// Slack
// Chameleon
//
// Created by Ian Keen on 8/06/2016.
//
Expand Down
2 changes: 1 addition & 1 deletion Sources/Common/Sequence+Extensions.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// Sequence+Extensions.swift
// Slack
// Chameleon
//
// Created by Ian Keen on 10/06/2016.
//
Expand Down
2 changes: 1 addition & 1 deletion Sources/Models/BotUser.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// BotUser.swift
// Slack
// Chameleon
//
// Created by Ian Keen on 20/05/2016.
// Copyright © 2016 Mustard. All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion Sources/Models/Channel.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// Channel.swift
// Slack
// Chameleon
//
// Created by Ian Keen on 25/05/2016.
// Copyright © 2016 Mustard. All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion Sources/Models/CustomEmoji.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// CustomEmoji.swift
// Slack
// Chameleon
//
// Created by Ian Keen on 6/06/2016.
//
Expand Down
2 changes: 1 addition & 1 deletion Sources/Models/DefaultValueType.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// DefaultValueType.swift
// Slack
// Chameleon
//
// Created by Ian Keen on 20/05/2016.
// Copyright © 2016 Mustard. All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion Sources/Models/Emoji.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// Emoji.swift
// Slack
// Chameleon
//
// Created by Ian Keen on 6/06/2016.
//
Expand Down
2 changes: 1 addition & 1 deletion Sources/Models/Extensions/User+Extensions.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// User+Extensions.swift
// Slack
// Chameleon
//
// Created by Ian Keen on 21/05/2016.
// Copyright © 2016 Mustard. All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion Sources/Models/Group.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// Group.swift
// Slack
// Chameleon
//
// Created by Ian Keen on 25/05/2016.
// Copyright © 2016 Mustard. All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion Sources/Models/IM.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// IM.swift
// Slack
// Chameleon
//
// Created by Ian Keen on 25/05/2016.
// Copyright © 2016 Mustard. All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion Sources/Models/IdentifiableType.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// IdentifiableType.swift
// Slack
// Chameleon
//
// Created by Ian Keen on 21/05/2016.
// Copyright © 2016 Mustard. All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion Sources/Models/Message+Attachment.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// Message+Attachment.swift
// Slack
// Chameleon
//
// Created by Ian Keen on 23/05/2016.
// Copyright © 2016 Mustard. All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion Sources/Models/Message+Edit.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// Message+Edit.swift
// Slack
// Chameleon
//
// Created by Ian Keen on 23/05/2016.
// Copyright © 2016 Mustard. All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion Sources/Models/Message+ItemType.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// Message+ItemType.swift
// Slack
// Chameleon
//
// Created by Ian Keen on 23/05/2016.
// Copyright © 2016 Mustard. All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion Sources/Models/Message+Reaction.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// Message+Reaction.swift
// Slack
// Chameleon
//
// Created by Ian Keen on 23/05/2016.
// Copyright © 2016 Mustard. All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion Sources/Models/Message+SubType.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// Message+SubType.swift
// Slack
// Chameleon
//
// Created by Ian Keen on 23/05/2016.
// Copyright © 2016 Mustard. All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion Sources/Models/Message.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// Message.swift
// Slack
// Chameleon
//
// Created by Ian Keen on 21/05/2016.
// Copyright © 2016 Mustard. All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion Sources/Models/Purpose.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// Purpose.swift
// Slack
// Chameleon
//
// Created by Ian Keen on 23/05/2016.
// Copyright © 2016 Mustard. All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion Sources/Models/SlackModelBuilder.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// SlackModelBuilder.swift
// Slack
// Chameleon
//
// Created by Ian Keen on 20/05/2016.
// Copyright © 2016 Mustard. All rights reserved.
Expand Down
4 changes: 2 additions & 2 deletions Sources/Models/SlackModelType.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// SlackModelType.swift
// Slack
// Chameleon
//
// Created by Ian Keen on 20/05/2016.
// Copyright © 2016 Mustard. All rights reserved.
Expand All @@ -14,7 +14,7 @@ public protocol SlackModelType {
static func make(builder: SlackModelBuilder) throws -> Self
}

internal func tryMake<T: SlackModelType>(_ op: @autoclosure () throws -> T) throws -> T {
func tryMake<T: SlackModelType>(_ op: @autoclosure () throws -> T) throws -> T {
do { return try op() }
catch let error { throw SlackModelTypeError.BuildError(type: T.self, error: error) }
}
2 changes: 1 addition & 1 deletion Sources/Models/SlackModelTypeIdentifiable.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// SlackModelTypeIdentifiable.swift
// Slack
// Chameleon
//
// Created by Ian Keen on 20/05/2016.
// Copyright © 2016 Mustard. All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion Sources/Models/Target.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// Target.swift
// Slack
// Chameleon
//
// Created by Ian Keen on 20/05/2016.
// Copyright © 2016 Mustard. All rights reserved.
Expand Down

0 comments on commit 4540a80

Please sign in to comment.