Skip to content

Commit

Permalink
initialize
Browse files Browse the repository at this point in the history
  • Loading branch information
sassembla committed Sep 23, 2013
1 parent c80e7df commit 22f3479
Show file tree
Hide file tree
Showing 18 changed files with 4,210 additions and 2 deletions.
70 changes: 70 additions & 0 deletions EnteringOrbit.xcodeproj/project.pbxproj
Expand Up @@ -18,6 +18,19 @@
B77550AB17F080460029CBB0 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B775508A17F080460029CBB0 /* Cocoa.framework */; }; B77550AB17F080460029CBB0 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B775508A17F080460029CBB0 /* Cocoa.framework */; };
B77550B317F080460029CBB0 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = B77550B117F080460029CBB0 /* InfoPlist.strings */; }; B77550B317F080460029CBB0 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = B77550B117F080460029CBB0 /* InfoPlist.strings */; };
B77550B517F080460029CBB0 /* EnteringOrbitTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B77550B417F080460029CBB0 /* EnteringOrbitTests.m */; }; B77550B517F080460029CBB0 /* EnteringOrbitTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B77550B417F080460029CBB0 /* EnteringOrbitTests.m */; };
B77550D017F0808D0029CBB0 /* KSMessenger.m in Sources */ = {isa = PBXBuildFile; fileRef = B77550C517F0808D0029CBB0 /* KSMessenger.m */; };
B77550D117F0808D0029CBB0 /* KSMessenger.m in Sources */ = {isa = PBXBuildFile; fileRef = B77550C517F0808D0029CBB0 /* KSMessenger.m */; };
B77550D217F0808D0029CBB0 /* base64.c in Sources */ = {isa = PBXBuildFile; fileRef = B77550C717F0808D0029CBB0 /* base64.c */; };
B77550D317F0808D0029CBB0 /* base64.c in Sources */ = {isa = PBXBuildFile; fileRef = B77550C717F0808D0029CBB0 /* base64.c */; };
B77550D417F0808D0029CBB0 /* NSData+SRB64Additions.m in Sources */ = {isa = PBXBuildFile; fileRef = B77550CA17F0808D0029CBB0 /* NSData+SRB64Additions.m */; };
B77550D517F0808D0029CBB0 /* NSData+SRB64Additions.m in Sources */ = {isa = PBXBuildFile; fileRef = B77550CA17F0808D0029CBB0 /* NSData+SRB64Additions.m */; };
B77550D617F0808D0029CBB0 /* SRWebSocket.m in Sources */ = {isa = PBXBuildFile; fileRef = B77550CD17F0808D0029CBB0 /* SRWebSocket.m */; };
B77550D717F0808D0029CBB0 /* SRWebSocket.m in Sources */ = {isa = PBXBuildFile; fileRef = B77550CD17F0808D0029CBB0 /* SRWebSocket.m */; };
B77550D817F0808D0029CBB0 /* WebSocketClientController.m in Sources */ = {isa = PBXBuildFile; fileRef = B77550CF17F0808D0029CBB0 /* WebSocketClientController.m */; };
B77550D917F0808D0029CBB0 /* WebSocketClientController.m in Sources */ = {isa = PBXBuildFile; fileRef = B77550CF17F0808D0029CBB0 /* WebSocketClientController.m */; };
B77550DB17F081140029CBB0 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B77550DA17F081140029CBB0 /* Security.framework */; };
B77550DE17F082FB0029CBB0 /* EntreringOrbit.m in Sources */ = {isa = PBXBuildFile; fileRef = B77550DD17F082FB0029CBB0 /* EntreringOrbit.m */; };
B77550DF17F082FB0029CBB0 /* EntreringOrbit.m in Sources */ = {isa = PBXBuildFile; fileRef = B77550DD17F082FB0029CBB0 /* EntreringOrbit.m */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */


/* Begin PBXContainerItemProxy section */ /* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -50,13 +63,28 @@
B77550B017F080460029CBB0 /* EnteringOrbitTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "EnteringOrbitTests-Info.plist"; sourceTree = "<group>"; }; B77550B017F080460029CBB0 /* EnteringOrbitTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "EnteringOrbitTests-Info.plist"; sourceTree = "<group>"; };
B77550B217F080460029CBB0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; }; B77550B217F080460029CBB0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
B77550B417F080460029CBB0 /* EnteringOrbitTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = EnteringOrbitTests.m; sourceTree = "<group>"; }; B77550B417F080460029CBB0 /* EnteringOrbitTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = EnteringOrbitTests.m; sourceTree = "<group>"; };
B77550C417F0808D0029CBB0 /* KSMessenger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KSMessenger.h; sourceTree = "<group>"; };
B77550C517F0808D0029CBB0 /* KSMessenger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KSMessenger.m; sourceTree = "<group>"; };
B77550C717F0808D0029CBB0 /* base64.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = base64.c; sourceTree = "<group>"; };
B77550C817F0808D0029CBB0 /* base64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = base64.h; sourceTree = "<group>"; };
B77550C917F0808D0029CBB0 /* NSData+SRB64Additions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSData+SRB64Additions.h"; sourceTree = "<group>"; };
B77550CA17F0808D0029CBB0 /* NSData+SRB64Additions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSData+SRB64Additions.m"; sourceTree = "<group>"; };
B77550CB17F0808D0029CBB0 /* SocketRocket-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "SocketRocket-Prefix.pch"; sourceTree = "<group>"; };
B77550CC17F0808D0029CBB0 /* SRWebSocket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SRWebSocket.h; sourceTree = "<group>"; };
B77550CD17F0808D0029CBB0 /* SRWebSocket.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SRWebSocket.m; sourceTree = "<group>"; };
B77550CE17F0808D0029CBB0 /* WebSocketClientController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSocketClientController.h; sourceTree = "<group>"; };
B77550CF17F0808D0029CBB0 /* WebSocketClientController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebSocketClientController.m; sourceTree = "<group>"; };
B77550DA17F081140029CBB0 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
B77550DC17F082FB0029CBB0 /* EntreringOrbit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EntreringOrbit.h; sourceTree = "<group>"; };
B77550DD17F082FB0029CBB0 /* EntreringOrbit.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EntreringOrbit.m; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */


/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
B775508417F080460029CBB0 /* Frameworks */ = { B775508417F080460029CBB0 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
B77550DB17F081140029CBB0 /* Security.framework in Frameworks */,
B775508B17F080460029CBB0 /* Cocoa.framework in Frameworks */, B775508B17F080460029CBB0 /* Cocoa.framework in Frameworks */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -76,6 +104,8 @@
B775507E17F080460029CBB0 = { B775507E17F080460029CBB0 = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
B77550C317F0808D0029CBB0 /* KSMessenger */,
B77550C617F0808D0029CBB0 /* SocketRocket */,
B775509017F080460029CBB0 /* EnteringOrbit */, B775509017F080460029CBB0 /* EnteringOrbit */,
B77550AE17F080460029CBB0 /* EnteringOrbitTests */, B77550AE17F080460029CBB0 /* EnteringOrbitTests */,
B775508917F080460029CBB0 /* Frameworks */, B775508917F080460029CBB0 /* Frameworks */,
Expand All @@ -95,6 +125,7 @@
B775508917F080460029CBB0 /* Frameworks */ = { B775508917F080460029CBB0 /* Frameworks */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
B77550DA17F081140029CBB0 /* Security.framework */,
B775508A17F080460029CBB0 /* Cocoa.framework */, B775508A17F080460029CBB0 /* Cocoa.framework */,
B77550A917F080460029CBB0 /* XCTest.framework */, B77550A917F080460029CBB0 /* XCTest.framework */,
B775508C17F080460029CBB0 /* Other Frameworks */, B775508C17F080460029CBB0 /* Other Frameworks */,
Expand Down Expand Up @@ -132,6 +163,8 @@
B775509617F080460029CBB0 /* main.m */, B775509617F080460029CBB0 /* main.m */,
B775509817F080460029CBB0 /* EnteringOrbit-Prefix.pch */, B775509817F080460029CBB0 /* EnteringOrbit-Prefix.pch */,
B775509917F080460029CBB0 /* Credits.rtf */, B775509917F080460029CBB0 /* Credits.rtf */,
B77550DC17F082FB0029CBB0 /* EntreringOrbit.h */,
B77550DD17F082FB0029CBB0 /* EntreringOrbit.m */,
); );
name = "Supporting Files"; name = "Supporting Files";
sourceTree = "<group>"; sourceTree = "<group>";
Expand All @@ -154,6 +187,31 @@
name = "Supporting Files"; name = "Supporting Files";
sourceTree = "<group>"; sourceTree = "<group>";
}; };
B77550C317F0808D0029CBB0 /* KSMessenger */ = {
isa = PBXGroup;
children = (
B77550C417F0808D0029CBB0 /* KSMessenger.h */,
B77550C517F0808D0029CBB0 /* KSMessenger.m */,
);
path = KSMessenger;
sourceTree = "<group>";
};
B77550C617F0808D0029CBB0 /* SocketRocket */ = {
isa = PBXGroup;
children = (
B77550C717F0808D0029CBB0 /* base64.c */,
B77550C817F0808D0029CBB0 /* base64.h */,
B77550C917F0808D0029CBB0 /* NSData+SRB64Additions.h */,
B77550CA17F0808D0029CBB0 /* NSData+SRB64Additions.m */,
B77550CB17F0808D0029CBB0 /* SocketRocket-Prefix.pch */,
B77550CC17F0808D0029CBB0 /* SRWebSocket.h */,
B77550CD17F0808D0029CBB0 /* SRWebSocket.m */,
B77550CE17F0808D0029CBB0 /* WebSocketClientController.h */,
B77550CF17F0808D0029CBB0 /* WebSocketClientController.m */,
);
path = SocketRocket;
sourceTree = "<group>";
};
/* End PBXGroup section */ /* End PBXGroup section */


/* Begin PBXNativeTarget section */ /* Begin PBXNativeTarget section */
Expand Down Expand Up @@ -252,7 +310,13 @@
isa = PBXSourcesBuildPhase; isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
B77550D617F0808D0029CBB0 /* SRWebSocket.m in Sources */,
B77550DE17F082FB0029CBB0 /* EntreringOrbit.m in Sources */,
B77550D817F0808D0029CBB0 /* WebSocketClientController.m in Sources */,
B77550D417F0808D0029CBB0 /* NSData+SRB64Additions.m in Sources */,
B77550D017F0808D0029CBB0 /* KSMessenger.m in Sources */,
B775509E17F080460029CBB0 /* AppDelegate.m in Sources */, B775509E17F080460029CBB0 /* AppDelegate.m in Sources */,
B77550D217F0808D0029CBB0 /* base64.c in Sources */,
B775509717F080460029CBB0 /* main.m in Sources */, B775509717F080460029CBB0 /* main.m in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -261,7 +325,13 @@
isa = PBXSourcesBuildPhase; isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
B77550D517F0808D0029CBB0 /* NSData+SRB64Additions.m in Sources */,
B77550B517F080460029CBB0 /* EnteringOrbitTests.m in Sources */, B77550B517F080460029CBB0 /* EnteringOrbitTests.m in Sources */,
B77550D717F0808D0029CBB0 /* SRWebSocket.m in Sources */,
B77550D317F0808D0029CBB0 /* base64.c in Sources */,
B77550DF17F082FB0029CBB0 /* EntreringOrbit.m in Sources */,
B77550D917F0808D0029CBB0 /* WebSocketClientController.m in Sources */,
B77550D117F0808D0029CBB0 /* KSMessenger.m in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
Expand Down
Expand Up @@ -5,14 +5,49 @@
<BuildAction <BuildAction
parallelizeBuildables = "YES" parallelizeBuildables = "YES"
buildImplicitDependencies = "YES"> buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "B775508617F080460029CBB0"
BuildableName = "EnteringOrbit.app"
BlueprintName = "EnteringOrbit"
ReferencedContainer = "container:EnteringOrbit.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction> </BuildAction>
<TestAction <TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES" shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug"> buildConfiguration = "Debug">
<Testables> <Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "B77550A717F080460029CBB0"
BuildableName = "EnteringOrbitTests.xctest"
BlueprintName = "EnteringOrbitTests"
ReferencedContainer = "container:EnteringOrbit.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables> </Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "B775508617F080460029CBB0"
BuildableName = "EnteringOrbit.app"
BlueprintName = "EnteringOrbit"
ReferencedContainer = "container:EnteringOrbit.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction> </TestAction>
<LaunchAction <LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
Expand All @@ -23,6 +58,15 @@
ignoresPersistentStateOnLaunch = "NO" ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES" debugDocumentVersioning = "YES"
allowLocationSimulation = "YES"> allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "B775508617F080460029CBB0"
BuildableName = "EnteringOrbit.app"
BlueprintName = "EnteringOrbit"
ReferencedContainer = "container:EnteringOrbit.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions> <AdditionalOptions>
</AdditionalOptions> </AdditionalOptions>
</LaunchAction> </LaunchAction>
Expand All @@ -32,6 +76,15 @@
useCustomWorkingDirectory = "NO" useCustomWorkingDirectory = "NO"
buildConfiguration = "Release" buildConfiguration = "Release"
debugDocumentVersioning = "YES"> debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "B775508617F080460029CBB0"
BuildableName = "EnteringOrbit.app"
BlueprintName = "EnteringOrbit"
ReferencedContainer = "container:EnteringOrbit.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction> </ProfileAction>
<AnalyzeAction <AnalyzeAction
buildConfiguration = "Debug"> buildConfiguration = "Debug">
Expand Down
Expand Up @@ -10,5 +10,18 @@
<integer>0</integer> <integer>0</integer>
</dict> </dict>
</dict> </dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>B775508617F080460029CBB0</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>B77550A717F080460029CBB0</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict> </dict>
</plist> </plist>
2 changes: 2 additions & 0 deletions EnteringOrbit/AppDelegate.h
Expand Up @@ -12,4 +12,6 @@


@property (assign) IBOutlet NSWindow *window; @property (assign) IBOutlet NSWindow *window;


- (id) initAppDelegateWithParam:(NSDictionary * )dict;

@end @end
53 changes: 51 additions & 2 deletions EnteringOrbit/AppDelegate.m
Expand Up @@ -8,11 +8,60 @@


#import "AppDelegate.h" #import "AppDelegate.h"


@implementation AppDelegate #import "KSMessenger.h"
#import "WebSocketClientController.h"


@implementation AppDelegate {
NSDictionary * paramDict;

WebSocketClientController * wsCont;
}


- (id) initAppDelegateWithParam:(NSDictionary * )dict {
if (self = [super init]) {
paramDict = [[NSDictionary alloc]initWithDictionary:dict];
}
return self;
}


- (void)applicationDidFinishLaunching:(NSNotification *)aNotification - (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{ {
// Insert code here to initialize your application NSFileHandle * fHand = [NSFileHandle fileHandleForWritingAtPath:@"/Users/highvision/Desktop/testing/test.txt"];
NSAssert(fHand, @"nil");
/**
NSTaskでsshで繋いでlogがあるところまで移動してログの内容をtailしてWebSocketで出力する。
プロセスの開始時にWebSocketクライアントになる。
*/


NSArray * paramArray = @[@"-l", @"sassembla", @"192.168.11.6"];
// NSArray * paramArray = @[@"-2", @"-6", @"mondogrosso@mondogrosso.201104392.members.btmm.icloud.com"];

NSPipe * pipeFromSSH = [[NSPipe alloc]init];

NSTask * ssh = [[NSTask alloc]init];
[ssh setLaunchPath:@"/usr/bin/ssh"];
[ssh setArguments:paramArray];
[ssh setStandardOutput:fHand];
[ssh launch];

NSLog(@"over");



// ssh

// NSTask * tail = [[NSTask alloc]init];
// [tail setLaunchPath:@"ls"];
//// [tail setArguments:paramArray];
// [tail setStandardInput:pipeFromSSH];
//
// [tail launch];



} }


@end @end
15 changes: 15 additions & 0 deletions EnteringOrbit/EntreringOrbit.h
@@ -0,0 +1,15 @@
//
// EntreringOrbit.h
// EnteringOrbit
//
// Created by sassembla on 2013/09/23.
// Copyright (c) 2013年 sassembla. All rights reserved.
//

#import <Cocoa/Cocoa.h>

@interface EntreringOrbit : NSApplication

int NSApplicationMain(int argc, const char *argv[]);

@end
64 changes: 64 additions & 0 deletions EnteringOrbit/EntreringOrbit.m
@@ -0,0 +1,64 @@
//
// EntreringOrbit.m
// EnteringOrbit
//
// Created by sassembla on 2013/09/23.
// Copyright (c) 2013年 sassembla. All rights reserved.
//

#import "EntreringOrbit.h"


#import "AppDelegate.h"
#define KEY_PERFIX (@"-")


@implementation EntreringOrbit

int NSApplicationMain(int argc, const char *argv[]) {
@autoreleasepool {
NSMutableArray * keyAndValueStrArray = [[NSMutableArray alloc]init];

for (int i = 0; i < argc; i++) {

[keyAndValueStrArray addObject:[NSString stringWithUTF8String:argv[i]]];

}

NSMutableDictionary * argsDict = [[NSMutableDictionary alloc]init];

for (int i = 0; i < [keyAndValueStrArray count]; i++) {
NSString * keyOrValue = keyAndValueStrArray[i];
if ([keyOrValue hasPrefix:KEY_PERFIX]) {
NSString * key = keyOrValue;

// get value
if (i + 1 < [keyAndValueStrArray count]) {
NSString * value = keyAndValueStrArray[i + 1];
if ([value hasPrefix:KEY_PERFIX]) {
[argsDict setValue:@"" forKey:key];
} else {
[argsDict setValue:value forKey:key];
}
}
else {
NSString * value = @"";
[argsDict setValue:value forKey:key];
}
}
}


AppDelegate * delegate = [[AppDelegate alloc] initAppDelegateWithParam:argsDict];

NSApplication * application = [NSApplication sharedApplication];
[application setDelegate:delegate];

[NSApp run];

return 0;
}

}

@end

0 comments on commit 22f3479

Please sign in to comment.