Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Rename TravisEvent to BuildEvent

  • Loading branch information...
commit 87f0e1bacdef111609aafbddbd3679bb1ccd3120 1 parent e72f967
@henrikhodne henrikhodne authored
View
14 Travis CI.xcodeproj/project.pbxproj
@@ -23,6 +23,7 @@
2E12F39716520C2A000048F5 /* dsa_pub.pem in Resources */ = {isa = PBXBuildFile; fileRef = 2E12F39616520C2A000048F5 /* dsa_pub.pem */; };
2E72AF3B1669DA6000F2631C /* BuildEventStream.m in Sources */ = {isa = PBXBuildFile; fileRef = 2E72AF3A1669DA6000F2631C /* BuildEventStream.m */; };
2E72AF42166A7FEA00F2631C /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2ECFA87545264EC28B9D5614 /* libPods.a */; };
+ 2E72AF44166A812200F2631C /* BuildEvent.m in Sources */ = {isa = PBXBuildFile; fileRef = 2EDA045C156450750043A3A6 /* BuildEvent.m */; };
2E75988B164DF68100B87810 /* Notification.m in Sources */ = {isa = PBXBuildFile; fileRef = 2E75988A164DF68100B87810 /* Notification.m */; };
2E90F156164E389F009CAA25 /* Travis CI.icns in Resources */ = {isa = PBXBuildFile; fileRef = 2E90F155164E389F009CAA25 /* Travis CI.icns */; };
2E90F15A164E49BB009CAA25 /* NotificationDisplayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 2E90F159164E49BB009CAA25 /* NotificationDisplayer.m */; };
@@ -31,7 +32,7 @@
2EBA8CF6164FAD4A005C033E /* FilterPreferencesTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 2EBA8CF5164FAD4A005C033E /* FilterPreferencesTests.m */; };
2EBA8CFA164FAD91005C033E /* FilterPreferences.m in Sources */ = {isa = PBXBuildFile; fileRef = 2EBA8CF9164FAD91005C033E /* FilterPreferences.m */; };
2EBA8CFB164FAD9F005C033E /* FilterPreferences.m in Sources */ = {isa = PBXBuildFile; fileRef = 2EBA8CF9164FAD91005C033E /* FilterPreferences.m */; };
- 2EDA045D156450750043A3A6 /* TravisEvent.m in Sources */ = {isa = PBXBuildFile; fileRef = 2EDA045C156450750043A3A6 /* TravisEvent.m */; };
+ 2EDA045D156450750043A3A6 /* BuildEvent.m in Sources */ = {isa = PBXBuildFile; fileRef = 2EDA045C156450750043A3A6 /* BuildEvent.m */; };
2EDA0460156464FF0043A3A6 /* tray-alt.png in Resources */ = {isa = PBXBuildFile; fileRef = 2EDA045E156464FF0043A3A6 /* tray-alt.png */; };
2EDA0461156464FF0043A3A6 /* tray.png in Resources */ = {isa = PBXBuildFile; fileRef = 2EDA045F156464FF0043A3A6 /* tray.png */; };
2EDA046C1565B86F0043A3A6 /* Growl.framework in Copy Growl 1.3 */ = {isa = PBXBuildFile; fileRef = 2EE31A5E15642182004F33FE /* Growl.framework */; };
@@ -132,8 +133,8 @@
2EBA8CF8164FAD91005C033E /* FilterPreferences.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = FilterPreferences.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
2EBA8CF9164FAD91005C033E /* FilterPreferences.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = FilterPreferences.m; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
2ECFA87545264EC28B9D5614 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; };
- 2EDA045B156450750043A3A6 /* TravisEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = TravisEvent.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
- 2EDA045C156450750043A3A6 /* TravisEvent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = TravisEvent.m; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
+ 2EDA045B156450750043A3A6 /* BuildEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = BuildEvent.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
+ 2EDA045C156450750043A3A6 /* BuildEvent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = BuildEvent.m; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
2EDA045E156464FF0043A3A6 /* tray-alt.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "tray-alt.png"; sourceTree = "<group>"; };
2EDA045F156464FF0043A3A6 /* tray.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = tray.png; sourceTree = "<group>"; };
2EDA04691565B82C0043A3A6 /* Growl.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Growl.framework; path = vendor/legacy/Growl.framework; sourceTree = "<group>"; };
@@ -336,6 +337,8 @@
2E00CCB1164EE0C300A30635 /* Travis API */,
2EE31A69156422CF004F33FE /* AppDelegate.h */,
2EE31A6A156422CF004F33FE /* AppDelegate.m */,
+ 2EDA045B156450750043A3A6 /* BuildEvent.h */,
+ 2EDA045C156450750043A3A6 /* BuildEvent.m */,
2E72AF391669DA5F00F2631C /* BuildEventStream.h */,
2E72AF3A1669DA6000F2631C /* BuildEventStream.m */,
2EBA8CF8164FAD91005C033E /* FilterPreferences.h */,
@@ -350,8 +353,6 @@
2EDA04741565C0A70043A3A6 /* PreferencesController.m */,
9DAF568D15932852002018B5 /* Reachability.h */,
9DAF568E15932852002018B5 /* Reachability.m */,
- 2EDA045B156450750043A3A6 /* TravisEvent.h */,
- 2EDA045C156450750043A3A6 /* TravisEvent.m */,
2EE31A6C15642365004F33FE /* Supporting Files */,
);
name = "Travis CI";
@@ -500,6 +501,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
+ 2E72AF44166A812200F2631C /* BuildEvent.m in Sources */,
2E00CCD9164F9A9B00A30635 /* PreferencesControllerTests.m in Sources */,
2EBA8CF6164FAD4A005C033E /* FilterPreferencesTests.m in Sources */,
2EBA8CE9164FA582005C033E /* Preferences.m in Sources */,
@@ -514,7 +516,7 @@
files = (
8D11072D0486CEB800E47090 /* main.m in Sources */,
2EE31A6B156422CF004F33FE /* AppDelegate.m in Sources */,
- 2EDA045D156450750043A3A6 /* TravisEvent.m in Sources */,
+ 2EDA045D156450750043A3A6 /* BuildEvent.m in Sources */,
2EDA04751565C0A70043A3A6 /* PreferencesController.m in Sources */,
2EDA04781565C67C0043A3A6 /* Preferences.m in Sources */,
9DAF568F15932852002018B5 /* Reachability.m in Sources */,
View
8 src/AppDelegate.m
@@ -9,7 +9,7 @@
#import "AppDelegate.h"
#import "TravisEventFetcher.h"
-#import "TravisEvent.h"
+#import "BuildEvent.h"
#import "Preferences.h"
#import "Notification.h"
#import "NotificationDisplayer.h"
@@ -33,9 +33,9 @@ - (void)applicationDidFinishLaunching:(NSNotification *)notification {
[self setBuildEventStream:[BuildEventStream buildEventStream]];
- [[[[self buildEventStream] eventStream] filter:^(TravisEvent *event) {
+ [[[[self buildEventStream] eventStream] filter:^(BuildEvent *event) {
return [self shouldShowNotificationFor:event];
- }] subscribeNext:^(TravisEvent *event) {
+ }] subscribeNext:^(BuildEvent *event) {
[[[TravisAPI standardAPI] fetchBuildWithID:[event buildID] forRepository:[event name]] subscribeNext:^(NSDictionary *build) {
[event updateBuildInfo:build];
Notification *notification = [Notification notificationWithEventData:event];
@@ -77,7 +77,7 @@ - (IBAction)showPreferences:(id)sender {
[[self preferencesPanel] makeKeyAndOrderFront:self];
}
-- (BOOL)shouldShowNotificationFor:(TravisEvent *)eventData {
+- (BOOL)shouldShowNotificationFor:(BuildEvent *)eventData {
FilterPreferences *filter;
if ([[Preferences sharedPreferences] firehoseEnabled]) {
filter = [FilterPreferences filterThatAcceptsAllRepositories];
View
24 src/TravisEvent.h → src/BuildEvent.h
@@ -1,5 +1,5 @@
//
-// TravisEvent.h
+// BuildEvent.h
// Travis CI
//
// Created by Henrik Hodne on 5/16/12.
@@ -9,25 +9,25 @@
#import <Foundation/Foundation.h>
typedef enum {
- TravisEventStateStarted,
- TravisEventStateFinished,
- TravisEventStateUnknown,
-} TravisEventState;
+ BuildEventStateStarted,
+ BuildEventStateFinished,
+ BuildEventStateUnknown,
+} BuildEventState;
typedef enum {
- TravisEventStatusPassed,
- TravisEventStatusFailed,
- TravisEventStatusUnknown,
-} TravisEventStatus;
+ BuildEventStatusPassed,
+ BuildEventStatusFailed,
+ BuildEventStatusUnknown,
+} BuildEventStatus;
-@interface TravisEvent : NSObject
+@interface BuildEvent : NSObject
@property (readonly) NSString *name;
-@property (readonly) TravisEventStatus status;
+@property (readonly) BuildEventStatus status;
@property (readonly) NSString *url;
@property (readonly) NSNumber *buildID;
@property (readonly) NSNumber *buildNumber;
-@property (readonly) TravisEventState state;
+@property (readonly) BuildEventState state;
- (id)initWithEventData:(NSDictionary *)eventData;
View
26 src/TravisEvent.m → src/BuildEvent.m
@@ -1,27 +1,27 @@
//
-// TravisEvent.m
+// BuildEvent.m
// Travis CI
//
// Created by Henrik Hodne on 5/16/12.
// Copyright (c) 2012 Travis CI GmbH. All rights reserved.
//
-#import "TravisEvent.h"
+#import "BuildEvent.h"
-@interface TravisEvent ()
+@interface BuildEvent ()
@property (strong) NSDictionary *eventData;
@end
-@implementation TravisEvent
+@implementation BuildEvent
- (id)initWithEventData:(NSDictionary *)eventData {
self = [super init];
if (self) {
_eventData = eventData;
}
-
+
return self;
}
@@ -35,15 +35,15 @@ - (NSString *)name {
return [self eventData][@"repository"][@"slug"];
}
-- (TravisEventStatus)status {
+- (BuildEventStatus)status {
NSNumber *result = [self eventData][@"build"][@"result"];
BOOL resultIsANumber = [result isKindOfClass:[NSNumber class]];
if (resultIsANumber && [result isEqualToNumber:@0]) {
- return TravisEventStatusPassed;
+ return BuildEventStatusPassed;
} else if (resultIsANumber && [result isEqualToNumber:@1]) {
- return TravisEventStatusFailed;
+ return BuildEventStatusFailed;
} else {
- return TravisEventStatusUnknown;
+ return BuildEventStatusUnknown;
}
}
@@ -55,15 +55,15 @@ - (NSNumber *)buildNumber {
return [self eventData][@"build"][@"number"];
}
-- (TravisEventState)state {
+- (BuildEventState)state {
NSString *state = [self eventData][@"build"][@"state"];
if ([state isEqualToString:@"started"]) {
- return TravisEventStateStarted;
+ return BuildEventStateStarted;
} else if ([state isEqualToString:@"finished"]) {
- return TravisEventStateFinished;
+ return BuildEventStateFinished;
} else {
- return TravisEventStateUnknown;
+ return BuildEventStateUnknown;
}
}
View
4 src/BuildEventStream.m
@@ -13,7 +13,7 @@
#import <Pusher/PTPusherChannel.h>
#import <Pusher/PTPusherEvent.h>
#import "Reachability.h"
-#import "TravisEvent.h"
+#import "BuildEvent.h"
static NSString * const BuildEventStreamPusherAPIKey = @"23ed642e81512118260e";
static NSString * const BuildEventStreamPusherChannelName = @"common";
@@ -49,7 +49,7 @@ - (id)init {
- (RACSignal *)eventStream {
return [[self eventSubject] map:^(PTPusherEvent *pusherEvent) {
- return [[TravisEvent alloc] initWithEventData:[pusherEvent data]];
+ return [[BuildEvent alloc] initWithEventData:[pusherEvent data]];
}];
}
View
6 src/Notification.h
@@ -8,18 +8,18 @@
#import <Foundation/Foundation.h>
-@class TravisEvent;
+@class BuildEvent;
@interface Notification : NSObject
-@property (strong, readonly) TravisEvent *eventData;
+@property (strong, readonly) BuildEvent *eventData;
@property (readonly) NSNumber *uniqueID;
@property (readonly) NSString *title;
@property (readonly) NSString *subtitle;
@property (readonly) NSString *informativeText;
@property (readonly) NSString *URL;
-+ (Notification *)notificationWithEventData:(TravisEvent *)eventData;
++ (Notification *)notificationWithEventData:(BuildEvent *)eventData;
@end
View
16 src/Notification.m
@@ -9,23 +9,23 @@
#import "Notification.h"
#import <ReactiveCocoa/ReactiveCocoa.h>
-#import "TravisEvent.h"
+#import "BuildEvent.h"
@interface Notification ()
-- (id)initWithEventData:(TravisEvent *)eventData;
+- (id)initWithEventData:(BuildEvent *)eventData;
@end
@implementation Notification
-+ (Notification *)notificationWithEventData:(TravisEvent *)eventData {
- if ([eventData state] == TravisEventStateStarted) {
++ (Notification *)notificationWithEventData:(BuildEvent *)eventData {
+ if ([eventData state] == BuildEventStateStarted) {
return [[BuildStartedNotification alloc] initWithEventData:eventData];
- } else if ([eventData state] == TravisEventStateFinished) {
- if ([eventData status] == TravisEventStatusPassed) {
+ } else if ([eventData state] == BuildEventStateFinished) {
+ if ([eventData status] == BuildEventStatusPassed) {
return [[BuildPassedNotification alloc] initWithEventData:eventData];
- } else if ([eventData status] == TravisEventStatusFailed) {
+ } else if ([eventData status] == BuildEventStatusFailed) {
return [[BuildFailedNotification alloc] initWithEventData:eventData];
}
}
@@ -33,7 +33,7 @@ + (Notification *)notificationWithEventData:(TravisEvent *)eventData {
return [[NullNotification alloc] initWithEventData:eventData];
}
-- (id)initWithEventData:(TravisEvent *)eventData {
+- (id)initWithEventData:(BuildEvent *)eventData {
self = [super init];
if (!self) {
return nil;
View
2  src/NotificationDisplayer.m
@@ -11,7 +11,7 @@
#import "Notification.h"
#import <AppKit/AppKit.h>
#import <Growl/Growl.h>
-#import "TravisEvent.h"
+#import "BuildEvent.h"
@implementation NotificationDisplayer
Please sign in to comment.
Something went wrong with that request. Please try again.