Skip to content

Commit

Permalink
Tokaido 2.1.5 release
Browse files Browse the repository at this point in the history
  • Loading branch information
andrasio committed Feb 19, 2015
1 parent 3099ffe commit 0e71ebc
Show file tree
Hide file tree
Showing 21 changed files with 93 additions and 129 deletions.
2 changes: 2 additions & 0 deletions Tokaido.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Tokaido/Tokaido-Prefix.pch";
INFOPLIST_FILE = "Tokaido/Tokaido-Info.plist";
MACOSX_DEPLOYMENT_TARGET = 10.8;
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
Expand All @@ -882,6 +883,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Tokaido/Tokaido-Prefix.pch";
INFOPLIST_FILE = "Tokaido/Tokaido-Info.plist";
MACOSX_DEPLOYMENT_TARGET = 10.8;
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion Tokaido/SetupTokaido.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ clear

BIN="$HOME/.tokaido/bin"

export TOKAIDO_GEM_HOME=$HOME/.tokaido/Gems
export TOKAIDO_GEM_HOME=$HOME/.tokaido/Gems/2.1.0
export GEM_HOME=$TOKAIDO_GEM_HOME
export GEM_PATH=$TOKAIDO_GEM_HOME
export PATH=$BIN:$TOKAIDO_PATH:$GEM_HOME/bin:$PATH
Expand Down
1 change: 0 additions & 1 deletion Tokaido/TKDApp.m
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,6 @@ - (void)runBundleInstall {
NSString *setupScriptPath = [TKDConfiguration setupScriptGemsInstalledFile];
NSString *bundlerPath = [TKDConfiguration gemsBundlerInstalledDirectoryPath];
check.arguments = @[ @"-r", setupScriptPath, bundlerPath, @"check" ];

[check launch];

if ([check terminationStatus] == 0) {
Expand Down
11 changes: 4 additions & 7 deletions Tokaido/TKDAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ - (void) home:(id) sender {
}

- (void)applicationDidBecomeActive:(NSNotification *)aNotification {
[self.window makeKeyAndOrderFront:self];
[NSApp activateIgnoringOtherApps:YES];
if (!_tokaidoController.window.visible) {
[self.window makeKeyAndOrderFront:self];
[NSApp activateIgnoringOtherApps:YES];
}
}

-(void) openTerminal:(id) sender {
Expand Down Expand Up @@ -229,13 +231,8 @@ - (void)saveAppSettings {

BOOL success = [NSKeyedArchiver archiveRootObject:self.apps toFile:appSettingsPath];

for(TKDApp *a in self.apps)
NSLog(@"%p={%@}", a, a.appDirectoryPath);

if (!success)
NSLog(@"ERROR: Couldn't save app settings.");
else
NSLog(@"GRABADO");

}

Expand Down
3 changes: 1 addition & 2 deletions Tokaido/TKDAppLogViewerController.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#import "TKDApp.h"

@interface TKDAppLogViewerController ()

@end

@implementation TKDAppLogViewerController
Expand All @@ -18,7 +17,7 @@ - (id)initWithWindow:(NSWindow *)window

- (void)windowDidLoad {
[super windowDidLoad];
[[self.viewer mainFrame] loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://cubalog.tokaido/logs/%@?path=%@", self.app.appName, self.app.appDirectoryPath]]]];
[[self.viewer mainFrame] loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://cubalog.tokaido/logs/%@/raw?path=%@", self.app.appName, self.app.appDirectoryPath]]]];
}

-(NSArray *)webView:(WebView *)sender
Expand Down
2 changes: 2 additions & 0 deletions Tokaido/TKDConfiguration.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
@interface TKDConfiguration : NSObject

+(NSString *) rubyVersion;
+(NSString *) rubyNamespace;
+(NSString *) applicationName;
+(NSString *) bundlePath;
+(NSString *) applicationSupportDirectoryPath;
Expand Down Expand Up @@ -54,6 +55,7 @@
+(NSString *) compilerExecutableInstalledFile;

+(NSString *) rubiesInstalledDirectoryPath;
+(NSString *) gemsGlobalInstalledDirectoryPath;
+(NSString *) gemsInstalledDirectoryPath;
+(NSString *) gemsBinaryInstalledDirectoryPath;
+(NSString *) magickInstalledDirectoryPath;
Expand Down
16 changes: 12 additions & 4 deletions Tokaido/TKDConfiguration.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@
@implementation TKDConfiguration

+(NSString *) rubyVersion {
return @"2.2.0-p0";
return @"2.1.5-p273";
}

+(NSString *) rubyNamespace {
return @"2.1.0";
}

+(NSArray *) rubiesBundled {
return @[[[TKDRubyBinary alloc] initWithName:@"2.2.0-p0"]];
return @[[[TKDRubyBinary alloc] initWithName:@"2.1.5-p273"]];
}

+(NSArray *) rubiesInstalled {
Expand All @@ -28,7 +32,7 @@ +(NSArray *) rubiesInstalled {
}

+(NSString *) rubyConfigInstalledFile {
return [[self rubiesInstalledDirectoryPath] stringByAppendingPathComponent:@"/2.2.0-p0/lib/ruby/2.2.0/x86_64-darwin12.0/rbconfig.rb"];
return [[self rubiesInstalledDirectoryPath] stringByAppendingPathComponent:@"/2.1.5-p273/lib/ruby/2.1.0/x86_64-darwin12.0/rbconfig.rb"];
}

+(NSString *) applicationName {
Expand All @@ -51,10 +55,14 @@ +(NSString *) rubiesInstalledDirectoryPath {
return [[self tokaidoLocalHomeDirectoryPath] stringByAppendingPathComponent:@"Rubies"];
}

+(NSString *) gemsInstalledDirectoryPath {
+(NSString *) gemsGlobalInstalledDirectoryPath {
return [[self tokaidoLocalHomeDirectoryPath] stringByAppendingPathComponent:@"Gems"];
}

+(NSString *) gemsInstalledDirectoryPath {
return [[self tokaidoLocalHomeDirectoryPath] stringByAppendingPathComponent:[NSString stringWithFormat:@"Gems/%@", [self rubyNamespace]]];
}

+(NSString *) temporalWorkingSpace {
return [[self tokaidoLocalHomeDirectoryPath] stringByAppendingPathComponent:@"Tmp"];
}
Expand Down
14 changes: 12 additions & 2 deletions Tokaido/TKDEnsureAppSupportUpdated.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ -(void) installRubiesBundled;
-(void) installGemsBundled;
-(void) installBinariesBundled;
-(void) applyRubyConfigPatches;
-(void) guaranteeRubySymlinkToCurrent;
@end

@implementation TKDEnsureAppSupportUpdated
Expand Down Expand Up @@ -39,6 +40,8 @@ -(void) execute {
[self installBinariesBundled];
[self applyRubyConfigPatches];

[self guaranteeRubySymlinkToCurrent];

[_view finished_ensuring_app_support_is_updated];
}

Expand All @@ -65,12 +68,19 @@ -(void) installRubiesBundled {
[_view finished_ruby_installations];
}

-(void) guaranteeRubySymlinkToCurrent {
TKDRubyBinary *binary = [[TKDRubyBinary alloc] initWithName:[[self configuration] rubyVersion]];
TKDInstallRuby *current = [[TKDInstallRuby alloc] initWithRubyBinary:binary withView:_view];

[current symlink];
}

-(void) installGemsBundled {
NSString *gemsInstalledDirectoryPath = [[self configuration] gemsInstalledDirectoryPath];
NSString *gemsGlobalInstalledDirectoryPath = [[self configuration] gemsGlobalInstalledDirectoryPath];
NSString *bundledGemsZipfile = [[self configuration] bundledGemsFile];

[_view checking_gems_installation];
[self.fileManager createDirectoryAtPathIfNonExistant:gemsInstalledDirectoryPath];
[self.fileManager createDirectoryAtPathIfNonExistant:gemsGlobalInstalledDirectoryPath];
[_view unzipping_gems_bundled];
[self.fileManager unzipFileAtPath:bundledGemsZipfile
inDirectoryPath:[[self configuration] tokaidoLocalHomeDirectoryPath]];
Expand Down
1 change: 1 addition & 0 deletions Tokaido/TKDInstallRuby.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
-(TKDInstallRuby *) initWithRubyBinary:(TKDRubyBinary *)bin withView:(id <TKDAppSupportEnsure>)view;

-(void) install;
-(void) symlink;

@end
14 changes: 9 additions & 5 deletions Tokaido/TKDInstallRuby.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,22 @@ -(TKDInstallRuby *) initWithRubyBinary:(TKDRubyBinary *)bin withView:(id <TKDApp
-(Class) configuration { return [TKDConfiguration self]; }
-(Class) fileManager { return [TKDFileUtilities self]; }

-(void) symlink {
NSTask *linkTask = [[NSTask alloc] init];
[linkTask setLaunchPath:@"/bin/ln"];
[linkTask setCurrentDirectoryPath:[self.configuration tokaidoLocalHomeDirectoryPath]];
[linkTask setArguments:@[ @"-f", @"-s", [@"Rubies" stringByAppendingPathComponent:[[_bin name] stringByAppendingPathComponent:@"bin/ruby"]], @"ruby" ] ];
[linkTask launch];
}

-(void) install {
NSString *pathBinary = [[self configuration] rubiesBundledDirectoryPath];
NSString *zipFile = [pathBinary stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.zip", [_bin name]]];

[_view unzipping_ruby_bundled];
[self.fileManager unzipFileAtPath:zipFile inDirectoryPath:[[self configuration] rubiesInstalledDirectoryPath]];

NSTask *linkTask = [[NSTask alloc] init];
[linkTask setLaunchPath:@"/bin/ln"];
[linkTask setCurrentDirectoryPath:[self.configuration tokaidoLocalHomeDirectoryPath]];
[linkTask setArguments:@[ @"-f", @"-s", [@"Rubies" stringByAppendingPathComponent:[[_bin name] stringByAppendingPathComponent:@"bin/ruby"]], @"ruby" ] ];
[linkTask launch];
[self symlink];
[_view finished_unzipping_ruby_bundled];
}

Expand Down
1 change: 1 addition & 0 deletions Tokaido/TKDMuxrManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ - (void)socket:(GCDAsyncSocket *)sock didReadData:(NSData *)data withTag:(long)t
if (TAG_MUXR_RESPONSE == tag) {
if ([muxrLine isEqualToString:@"TOKAIDO ACTIVE\n"]) {
NSLog(@"Muxr Manager Ready");
[self addApp:[[TKDCubalogApp alloc] init]];
return;
}
} else if (TAG_AWAIT_COMMAND == tag) {
Expand Down
2 changes: 1 addition & 1 deletion Tokaido/TKDStartTokaido.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ -(void) execute {
NSString *errPath = [[self configuration] firewallStandardErrorInstalledFile];
NSString *gemHome = [[self configuration] gemsInstalledDirectoryPath];
NSString *path = [NSString stringWithFormat:@"%@:%@:%@:%@:%@:%@:%@:%@:%@",
[executableDirectory stringByAppendingString:@"bin"],
[TKDConfiguration binariesInstalledDirectoryPath],
[TKDUtilities rubyBinDirectory:[TKDConfiguration rubyVersion]],
[TKDConfiguration gemsBinaryInstalledDirectoryPath],
@"/Applications/Postgres.app/Contents/Versions/9.3/bin",
Expand Down
6 changes: 2 additions & 4 deletions Tokaido/TKDTask.m
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,10 @@ - (void)setEnvironment:(NSDictionary *)environment {
}

- (NSDictionary *)environment {
if (self.app) {
NSLog(@"%@", self.app.environment);
if (self.app)
return self.app.environment;
} else {
else
return _environment;
}
}

- (void)setLaunchPath:(NSString *)launchPath {
Expand Down
6 changes: 1 addition & 5 deletions Tokaido/TKDTokaidoController.m
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ - (void)didEndSheet:(NSWindow *)sheet returnCode:(NSInteger)returnCode contextIn

- (void)didEndLoadingSheet:(NSWindow *)sheet returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo {
[sheet orderOut:self];
[self activateCubalog];
}

- (void)activateCubalog {
Expand All @@ -133,7 +132,6 @@ - (void)activateCubalog {

- (void)removeApp:(TKDApp *)app {
[self.appsArrayController removeObject:app];
NSLog(@"Deleted app... (%p) = %@", app, app.appDirectoryPath);

TKDAppDelegate *delegate = (TKDAppDelegate *)[[NSApplication sharedApplication] delegate];
[delegate saveAppSettings];
Expand Down Expand Up @@ -183,8 +181,6 @@ - (void)handleMuxrEvent:(NSNotification *)note

NSString *action = [[note userInfo] objectForKey:@"action"];

NSLog(@"ACTION: %@", action);

if ([action isEqualToString:@"ERR"]) {
[app setStatus:NSLocalizedString(@"Booting failed. Review the logs or \"Open in Terminal\".", nil)];

Expand All @@ -193,7 +189,7 @@ - (void)handleMuxrEvent:(NSNotification *)note
defaultButton:@"OK"
alternateButton:nil
otherButton:nil
informativeTextWithFormat:NSLocalizedString(@"Booting failed. Tokaido currently uses the puma webserver. Check if `gem puma` entry is in your Gemfile and try again.", nil)];
informativeTextWithFormat:NSLocalizedString(@"Booting failed.", nil)];

[alert runModal];
});
Expand Down
6 changes: 4 additions & 2 deletions Tokaido/TKDTokaidoSplashController.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ @implementation TKDTokaidoSplashController
- (id)initWithWindowNibName:(NSString *)windowNibName {

if (self = [super initWithWindowNibName:windowNibName]) {
_logger = [[TKDCubalogApp alloc] init];

_progress.indeterminate = YES;
_progress.displayedWhenStopped = YES;
return self;
Expand Down Expand Up @@ -54,8 +56,8 @@ -(void) finish {
[_status setStringValue:@"Ready. Find me in the bar and start managing apps."];
});

_logger = [[TKDCubalogApp alloc] init];
[[TKDMuxrManager defaultManager] addApp:_logger];
// Force connection attempt with Muxr
[TKDMuxrManager defaultManager];
}

-(IBAction)openTerminal:(id)sender {
Expand Down
4 changes: 2 additions & 2 deletions Tokaido/Tokaido-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.2</string>
<string>2.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>2.2.0</string>
<string>2.1.5</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.developer-tools</string>
<key>LSMinimumSystemVersion</key>
Expand Down
Loading

0 comments on commit 0e71ebc

Please sign in to comment.