Permalink
Browse files

Move initialization stuff out of the applicaiton controller

  • Loading branch information...
Caged committed Oct 15, 2008
1 parent bc85914 commit f1c2cee2dc44bd83ee95217d578b68e561a3c67f
Showing with 27 additions and 22 deletions.
  1. +4 −0 GitNub.xcodeproj/project.pbxproj
  2. +21 −0 bootstrap.rb
  3. +1 −21 controllers/ApplicationController.rb
  4. +1 −1 controllers/CommitsController.rb
@@ -38,6 +38,7 @@
283E2F7E0E9574A000E33E25 /* GNOutlineView.m in Sources */ = {isa = PBXBuildFile; fileRef = 283E2F7C0E9574A000E33E25 /* GNOutlineView.m */; };
288853050D7CE2E500862D67 /* LICENSE in Resources */ = {isa = PBXBuildFile; fileRef = 288853040D7CE2E500862D67 /* LICENSE */; };
288CB41A0D8789DD0092B5CC /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 288CB4180D8789DD0092B5CC /* MainMenu.xib */; };
+ 28A3D78C0EA6B60200D89F91 /* bootstrap.rb in Resources */ = {isa = PBXBuildFile; fileRef = 28A3D78B0EA6B60200D89F91 /* bootstrap.rb */; };
28EF91600E98243A009B70DF /* blame.html in Resources */ = {isa = PBXBuildFile; fileRef = 28EF915F0E98243A009B70DF /* blame.html */; };
4DDCA7070ACC9A6100E082CE /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
4DDCA7080ACC9A6100E082CE /* rb_main.rb in Resources */ = {isa = PBXBuildFile; fileRef = E8F5E25803AEB7C803A81C6F /* rb_main.rb */; };
@@ -95,6 +96,7 @@
283E2F7C0E9574A000E33E25 /* GNOutlineView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GNOutlineView.m; sourceTree = "<group>"; };
288853040D7CE2E500862D67 /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = "<group>"; };
288CB4190D8789DD0092B5CC /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = "<group>"; };
+ 28A3D78B0EA6B60200D89F91 /* bootstrap.rb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.ruby; path = bootstrap.rb; sourceTree = "<group>"; };
28EF915F0E98243A009B70DF /* blame.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = blame.html; sourceTree = "<group>"; };
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>"; };
@@ -205,6 +207,7 @@
29B97314FDCFA39411CA2CEA /* GitNub */ = {
isa = PBXGroup;
children = (
+ 28A3D78B0EA6B60200D89F91 /* bootstrap.rb */,
0ABA3B1A0D89E53E004B6667 /* nub */,
080E96DDFE201D6D7F000001 /* Classes */,
29B97315FDCFA39411CA2CEA /* Other Sources */,
@@ -333,6 +336,7 @@
281AED6C0E6677B500B48530 /* GitNubWebView.rb in Resources */,
283E2EC20E932E9E00E33E25 /* TreeController.rb in Resources */,
28EF91600E98243A009B70DF /* blame.html in Resources */,
+ 28A3D78C0EA6B60200D89F91 /* bootstrap.rb in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
View
@@ -0,0 +1,21 @@
+$VERBOSE = nil
+require 'rubygems'
+require 'pathname'
+require 'osx/cocoa'
+libdir = OSX::NSBundle.mainBundle.resourcePath.stringByAppendingPathComponent("lib").fileSystemRepresentation
+$:.unshift(libdir, "#{libdir}/grit/lib", "#{libdir}/mime-types/lib", "#{libdir}/open4/lib")
+require 'grit'
+require 'time_extensions'
+require 'string_extensions'
+require 'osx_notify'
+require 'InfoWindowController'
+
+OSX.ns_import 'CommitSummaryCell'
+include OSX
+
+#Grit.debug = true
+
+# we use ENV['PWD'] instead of Dir.getwd if it exists so
+# `open GitNub` will work, since that launches us at / but leaves ENV['PWD'] intact
+pwd = Pathname.new(ENV['PWD'].nil? ? Dir.getwd : ENV['PWD'])
+REPOSITORY_LOCATION = pwd + `cd #{pwd} && git rev-parse --git-dir 2>/dev/null`.chomp
@@ -5,27 +5,7 @@
# Created by Justin Palmer on 3/1/08.
# Copyright (c) 2008 Active Reload, LLC. All rights reserved.
#
-$VERBOSE = nil
-require 'rubygems'
-require 'pathname'
-require 'osx/cocoa'
-libdir = OSX::NSBundle.mainBundle.resourcePath.stringByAppendingPathComponent("lib").fileSystemRepresentation
-$:.unshift(libdir, "#{libdir}/grit/lib", "#{libdir}/mime-types/lib", "#{libdir}/open4/lib")
-require 'grit'
-require 'time_extensions'
-require 'string_extensions'
-require 'osx_notify'
-require 'InfoWindowController'
-
-OSX.ns_import 'CommitSummaryCell'
-include OSX
-
-#Grit.debug = true
-
-# we use ENV['PWD'] instead of Dir.getwd if it exists so
-# `open GitNub` will work, since that launches us at / but leaves ENV['PWD'] intact
-pwd = Pathname.new(ENV['PWD'].nil? ? Dir.getwd : ENV['PWD'])
-REPOSITORY_LOCATION = pwd + `cd #{pwd} && git rev-parse --git-dir 2>/dev/null`.chomp
+require 'bootstrap'
class ApplicationController < OSX::NSObject
ib_outlet :commits_table
@@ -275,7 +275,7 @@ def fetch_git_repository
def fetch_git_branch
head = @repo.head || @repo.heads.first
- @branch = head.name.to_sym
+ @branch = head.name
end
def fetch_commits_for(branch, quanity, offset = 0)

0 comments on commit f1c2cee

Please sign in to comment.