[from now] 2012/07/20 17:33:04

diff --git c/.gitignore i/.gitignore
index a4b3b55..5d3c9e5 100644
--- c/.gitignore
+++ i/.gitignore
@@ -1,12 +1,3 @@
-/*
-!.gitignore
+.DS_Store

-!Podfile
-!Podfile.lock
-!Rakefile
-
-!README
-
-!oto
-!oto.xcworkspace
-!oto.xcodeproj
+Pods/
diff --git c/oto.xcworkspace/contents.xcworkspacedata i/oto.xcworkspace/contents.xcworkspacedata
index 3c31f58..7482c3e 100644
--- c/oto.xcworkspace/contents.xcworkspacedata
+++ i/oto.xcworkspace/contents.xcworkspacedata
@@ -1 +1,16 @@
-<?xml version='1.0' encoding='UTF-8'?><Workspace version='1.0'><FileRef location='group:Pods/Pods.xcodeproj'/><FileRef location='group:oto.xcodeproj'/></Workspace>
\ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<Workspace
+   version = "1.0">
+   <FileRef
+      location = "group:interactivemacruby">
+   </FileRef>
+   <FileRef
+      location = "group:otod/otod.xcodeproj">
+   </FileRef>
+   <FileRef
+      location = "group:Pods/Pods.xcodeproj">
+   </FileRef>
+   <FileRef
+      location = "group:oto.xcodeproj">
+   </FileRef>
+</Workspace>
diff --git c/oto.xcworkspace/xcuserdata/kaz.xcuserdatad/UserInterfaceState.xcuserstate i/oto.xcworkspace/xcuserdata/kaz.xcuserdatad/UserInterfaceState.xcuserstate
deleted file mode 100644
index c2ed4a6..0000000
Binary files c/oto.xcworkspace/xcuserdata/kaz.xcuserdatad/UserInterfaceState.xcuserstate and /dev/null differ
diff --git c/oto/AppDelegate.rb i/oto/AppDelegate.rb
index 84f8d72..c8ca5b8 100644
--- c/oto/AppDelegate.rb
+++ i/oto/AppDelegate.rb
@@ -8,20 +8,17 @@

 class AppDelegate
   attr_accessor :window
-  def applicationDidFinishLaunching(a_notification)
-    # Insert code here to initialize your application
-  end
-
-  def applicationShouldTerminateAfterLastWindowClosed(sender)
-    true
-  end
-
-  # Persistence accessors
+
+  def applicationDidFinishLaunching(notification); end
+  def windowWillClose(notification); exit; end
+  def applicationShouldTerminateAfterLastWindowClosed(sender); true; end
+
+  ## Persistence accessors
   attr_reader :persistentStoreCoordinator
   attr_reader :managedObjectModel
   attr_reader :managedObjectContext
-
-  #
+
+  # @name applicationFilesDirectory
   # Returns the directory the application uses to store the Core Data store file.
   # This code uses a directory named "oto" in the user's Library directory.
   #
@@ -33,17 +30,18 @@ class AppDelegate
   end

   #
-  # Creates if necessary and returns the managed object model for the application.
+  # returns the managed object model for the application.
+  # creates if necessary
   #
   def managedObjectModel
     unless @managedObjectModel
       model_url = NSBundle.mainBundle.URLForResource('oto', withExtension:'momd')
       @managedObjectModel = NSManagedObjectModel.alloc.initWithContentsOfURL(model_url)
     end
-
+
     @managedObjectModel
   end
-
+
   #
   # Returns the persistent store coordinator for the application.
   # This implementation creates and return a coordinator,
@@ -52,50 +50,50 @@ class AppDelegate
   #
   def persistentStoreCoordinator
     return @persistentStoreCoordinator if @persistentStoreCoordinator
-
+
     mom = self.managedObjectModel
     unless mom
       puts "#{self.class} No model to generate a store from"
       return nil
     end
-
+
     file_manager = NSFileManager.defaultManager
     directory = self.applicationFilesDirectory
     error = Pointer.new_with_type('@')
-
+
     properties = directory.resourceValuesForKeys([NSURLIsDirectoryKey],
                                                  error:error)
-
+
     if properties.nil?
       ok = false
-
+
       if error[0].code == NSFileReadNoSuchFileError
         ok = file_manager.createDirectoryAtPath(directory.path,
                                                 withIntermediateDirectories:true,
                                                 attributes:nil,
                                                 error:error)
       end
-
+
       if ok == false
         NSApplication.sharedApplication.presentError(error[0])
       end
-
-      elsif properties[NSURLIsDirectoryKey] != true
+
+    elsif properties[NSURLIsDirectoryKey] != true
       # Customize and localize this error.
       failure_description = "Expected a folder to store application data, "
       failure_description << "found a file (#{directory.path})."
-
+
       error = NSError.errorWithDomain("YOUR_ERROR_DOMAIN",
                                       code:101,
                                       userInfo:{NSLocalizedDescriptionKey:failure_description})
-
+
       NSApplication.sharedApplication.presentError(error)
       return nil
     end
-
+
     url = directory.URLByAppendingPathComponent("oto.storedata")
     @persistentStoreCoordinator = NSPersistentStoreCoordinator.alloc.initWithManagedObjectModel(mom)
-
+
     unless @persistentStoreCoordinator.addPersistentStoreWithType(NSXMLStoreType,
                                                                   configuration:nil,
                                                                   URL:url,
@@ -104,18 +102,17 @@ class AppDelegate
       NSApplication.sharedApplication.presentError(error[0])
       return nil
     end
-
+
     @persistentStoreCoordinator
-  end
-
-  #
+  end # persistentStoreCordinator
+
   # Returns the managed object context for the application (which is already
-  # bound to the persistent store coordinator for the application.)
+  # bound to the persistent store coordinator for the application.)
   #
   def managedObjectContext
     return @managedObjectContext if @managedObjectContext
     coordinator = self.persistentStoreCoordinator
-
+
     unless coordinator
       dict = {
         NSLocalizedDescriptionKey:'Failed to initialize the store',
@@ -124,26 +121,26 @@ class AppDelegate
       error = NSError.errorWithDomain('YOUR_ERROR_DOMAIN',
                                       code:9999,
                                       userInfo:dict)
-
+
       NSApplication.sharedApplication.presentError(error)
       return nil
     end
-
+
     @managedObjectContext = NSManagedObjectContext.alloc.init
     @managedObjectContext.setPersistentStoreCoordinator(coordinator)
-
+
     @managedObjectContext
-  end
-
-  #
+  end # managedObjectContext
+
+
   # Returns the NSUndoManager for the application.
   # In this case, the manager returned is
   # that of the managed object context for the application.
   #
   def windowWillReturnUndoManager(window)
     self.managedObjectContext.undoManager
-  end
-
+  end # windowWillReturnUndoManager
+
   #
   # Performs the save action for the application,
   # which is to send the save: message
@@ -152,47 +149,51 @@ class AppDelegate
   #
   def saveAction(sender)
     error = Pointer.new_with_type('@')
-
+
     unless self.managedObjectContext.commitEditing
       puts "#{self.class} unable to commit editing before saving"
     end
-
+
     unless self.managedObjectContext.save(error)
       NSApplication.sharedApplication.presentError(error[0])
     end
-  end
-
+  end # saveAction
+
   def applicationShouldTerminate(sender)
     # Save changes in the application's managed object context
     # before the application terminates.
-
+
     return NSTerminateNow unless @managedObjectContext
-
+
     unless self.managedObjectContext.commitEditing
       puts "#{self.class} unable to commit editing to terminate"
     end
-
+
     unless self.managedObjectContext.hasChanges
       return NSTerminateNow
     end
-
+
     error = Pointer.new_with_type('@')
     unless self.managedObjectContext.save(error)
       # Customize this code block to include application-specific recovery steps.
       return NSTerminateCancel if sender.presentError(error[0])
-
+
       alert = NSAlert.alloc.init
       alert.messageText = 'Could not save changes while quitting. Quit anyway?'
       alert.informativeText = "Quitting now will lose any changes you have made since the last successful save"
-
+
       alert.addButtonWithTitle 'Quit anyway'
       alert.addButtonWithTitle 'Cancel'
-
+
       answer = alert.runModal
       return NSTerminateCancel if answer == NSAlertAlternateReturn
     end
-
+
     NSTerminateNow
-  end
+  end # applicationShouldTerminate
+
+end
+
+class KNWindowController
 end