Skip to content

Commit

Permalink
Add rubycocoa app
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Barron committed Sep 24, 2008
1 parent e808388 commit bd7d4ba
Show file tree
Hide file tree
Showing 9 changed files with 2,914 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
@@ -1,3 +1,6 @@
/coverage/
.jackerdb
.DS_Store
Jacker/Jacker.xcodeproj/scott.mode1v3
Jacker/Jacker.xcodeproj/scott.pbxuser
Jacker/build/
Binary file added Jacker/English.lproj/InfoPlist.strings
Binary file not shown.
2,340 changes: 2,340 additions & 0 deletions Jacker/English.lproj/MainMenu.xib

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions Jacker/Info.plist
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>Jacker</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>CFBundleIdentifier</key>
<string>com.apple.rubycocoa.JackerApp</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
</dict>
</plist>
294 changes: 294 additions & 0 deletions Jacker/Jacker.xcodeproj/project.pbxproj
@@ -0,0 +1,294 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 44;
objects = {

/* Begin PBXBuildFile section */
4DDCA7070ACC9A6100E082CE /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
4DDCA7080ACC9A6100E082CE /* rb_main.rb in Resources */ = {isa = PBXBuildFile; fileRef = E8F5E25803AEB7C803A81C6F /* rb_main.rb */; };
4DDCA70A0ACC9A6100E082CE /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
4DDCA70C0ACC9A6100E082CE /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
4DDCA70D0ACC9A6100E082CE /* RubyCocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E8F5E24E03AEB6EC03A81C6F /* RubyCocoa.framework */; };
D23222DB0E8A65D300A174B4 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = D23222D90E8A65D300A174B4 /* MainMenu.xib */; };
D23222DD0E8A65E200A174B4 /* JackerController.rb in Resources */ = {isa = PBXBuildFile; fileRef = D23222DC0E8A65E200A174B4 /* JackerController.rb */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
4DDCA7110ACC9A6100E082CE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
4DDCA7120ACC9A6100E082CE /* Jacker.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Jacker.app; sourceTree = BUILT_PRODUCTS_DIR; };
D23222DA0E8A65D300A174B4 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = "<group>"; };
D23222DC0E8A65E200A174B4 /* JackerController.rb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.ruby; path = JackerController.rb; sourceTree = "<group>"; };
E8F5E24E03AEB6EC03A81C6F /* RubyCocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = RubyCocoa.framework; path = /System/Library/Frameworks/RubyCocoa.framework; sourceTree = "<absolute>"; };
E8F5E25803AEB7C803A81C6F /* rb_main.rb */ = {isa = PBXFileReference; lastKnownFileType = text.script.ruby; path = rb_main.rb; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
4DDCA70B0ACC9A6100E082CE /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
4DDCA70C0ACC9A6100E082CE /* Cocoa.framework in Frameworks */,
4DDCA70D0ACC9A6100E082CE /* RubyCocoa.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
080E96DDFE201D6D7F000001 /* Classes */ = {
isa = PBXGroup;
children = (
);
name = Classes;
sourceTree = "<group>";
};
1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = {
isa = PBXGroup;
children = (
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
E8F5E24E03AEB6EC03A81C6F /* RubyCocoa.framework */,
);
name = "Linked Frameworks";
sourceTree = "<group>";
};
1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = {
isa = PBXGroup;
children = (
29B97325FDCFA39411CA2CEA /* Foundation.framework */,
29B97324FDCFA39411CA2CEA /* AppKit.framework */,
);
name = "Other Frameworks";
sourceTree = "<group>";
};
19C28FACFE9D520D11CA2CBB /* Products */ = {
isa = PBXGroup;
children = (
4DDCA7120ACC9A6100E082CE /* Jacker.app */,
);
name = Products;
sourceTree = "<group>";
};
29B97314FDCFA39411CA2CEA /* Jacker */ = {
isa = PBXGroup;
children = (
D23222DC0E8A65E200A174B4 /* JackerController.rb */,
D23222D90E8A65D300A174B4 /* MainMenu.xib */,
080E96DDFE201D6D7F000001 /* Classes */,
29B97315FDCFA39411CA2CEA /* Other Sources */,
29B97317FDCFA39411CA2CEA /* Resources */,
29B97323FDCFA39411CA2CEA /* Frameworks */,
19C28FACFE9D520D11CA2CBB /* Products */,
4DDCA7110ACC9A6100E082CE /* Info.plist */,
);
name = Jacker;
sourceTree = "<group>";
};
29B97315FDCFA39411CA2CEA /* Other Sources */ = {
isa = PBXGroup;
children = (
29B97316FDCFA39411CA2CEA /* main.m */,
E8F5E25803AEB7C803A81C6F /* rb_main.rb */,
);
name = "Other Sources";
sourceTree = "<group>";
};
29B97317FDCFA39411CA2CEA /* Resources */ = {
isa = PBXGroup;
children = (
089C165CFE840E0CC02AAC07 /* InfoPlist.strings */,
);
name = Resources;
sourceTree = "<group>";
};
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
isa = PBXGroup;
children = (
1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */,
1058C7A2FEA54F0111CA2CBB /* Other Frameworks */,
);
name = Frameworks;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXHeadersBuildPhase section */
4DDCA7040ACC9A6100E082CE /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */

/* Begin PBXNativeTarget section */
4DDCA7030ACC9A6100E082CE /* Jacker */ = {
isa = PBXNativeTarget;
buildConfigurationList = 4DDCA70E0ACC9A6100E082CE /* Build configuration list for PBXNativeTarget "Jacker" */;
buildPhases = (
4DDCA7040ACC9A6100E082CE /* Headers */,
4DDCA7050ACC9A6100E082CE /* Resources */,
4DDCA7090ACC9A6100E082CE /* Sources */,
4DDCA70B0ACC9A6100E082CE /* Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = Jacker;
productInstallPath = "$(HOME)/Applications";
productName = Jacker;
productReference = 4DDCA7120ACC9A6100E082CE /* Jacker.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */

/* Begin PBXProject section */
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 4D7A7B570ABF745500C2D4C0 /* Build configuration list for PBXProject "Jacker" */;
compatibilityVersion = "Xcode 3.0";
hasScannedForEncodings = 0;
mainGroup = 29B97314FDCFA39411CA2CEA /* Jacker */;
projectDirPath = "";
projectRoot = "";
targets = (
4DDCA7030ACC9A6100E082CE /* Jacker */,
);
};
/* End PBXProject section */

/* Begin PBXResourcesBuildPhase section */
4DDCA7050ACC9A6100E082CE /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
4DDCA7070ACC9A6100E082CE /* InfoPlist.strings in Resources */,
4DDCA7080ACC9A6100E082CE /* rb_main.rb in Resources */,
D23222DB0E8A65D300A174B4 /* MainMenu.xib in Resources */,
D23222DD0E8A65E200A174B4 /* JackerController.rb in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
4DDCA7090ACC9A6100E082CE /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
4DDCA70A0ACC9A6100E082CE /* main.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */

/* Begin PBXVariantGroup section */
089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
089C165DFE840E0CC02AAC07 /* English */,
);
name = InfoPlist.strings;
sourceTree = "<group>";
};
D23222D90E8A65D300A174B4 /* MainMenu.xib */ = {
isa = PBXVariantGroup;
children = (
D23222DA0E8A65D300A174B4 /* English */,
);
name = MainMenu.xib;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */

/* Begin XCBuildConfiguration section */
4D7A7B580ABF745500C2D4C0 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk";
};
name = Debug;
};
4D7A7B590ABF745500C2D4C0 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = (
ppc,
i386,
);
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk";
};
name = Release;
};
4DDCA70F0ACC9A6100E082CE /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0;
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(HOME)/Applications";
PRODUCT_NAME = Jacker;
WRAPPER_EXTENSION = app;
ZERO_LINK = YES;
};
name = Debug;
};
4DDCA7100ACC9A6100E082CE /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = (
ppc,
i386,
);
GCC_MODEL_TUNING = G5;
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(HOME)/Applications";
PRODUCT_NAME = Jacker;
WRAPPER_EXTENSION = app;
};
name = Release;
};
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
4D7A7B570ABF745500C2D4C0 /* Build configuration list for PBXProject "Jacker" */ = {
isa = XCConfigurationList;
buildConfigurations = (
4D7A7B580ABF745500C2D4C0 /* Debug */,
4D7A7B590ABF745500C2D4C0 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
4DDCA70E0ACC9A6100E082CE /* Build configuration list for PBXNativeTarget "Jacker" */ = {
isa = XCConfigurationList;
buildConfigurations = (
4DDCA70F0ACC9A6100E082CE /* Debug */,
4DDCA7100ACC9A6100E082CE /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
}
55 changes: 55 additions & 0 deletions Jacker/JackerController.rb
@@ -0,0 +1,55 @@
#
# JackerController.rb
# JackerApp
#
# Created by Scott Barron on 9/23/08.
# Copyright (c) 2008. All rights reserved.
#

require 'osx/cocoa'

require 'rubygems'
require 'jacker'

class JackerController < OSX::NSWindowController
include OSX

ib_outlet :theMenu
ib_outlet :jackItem

ib_action :jack_it
ib_action :startJacking

def awakeFromNib
statusbar = NSStatusBar.systemStatusBar
item = statusbar.statusItemWithLength(NSVariableStatusItemLength)
item.setTitle "J"

item.setMenu(@theMenu)
item.setEnabled(true)
setMenuStatus
end

def jack_it(sender)
if Jacker.running?
self.stopJacking
else
showWindow(self)
end
end

def startJacking(sender)
close
Jacker.start sender.stringValue
setMenuStatus
end

def stopJacking
Jacker.stop
setMenuStatus
end

def setMenuStatus
@jackItem.setTitle Jacker.running? ? "Stop Jacking" : "Start Jacking"
end
end

0 comments on commit bd7d4ba

Please sign in to comment.