[macruby-changes] [5284] MacRuby/trunk/misc/xcode4-templates/Mac/Application
source_changes at macosforge.org
source_changes at macosforge.org
Mon Mar 21 00:06:47 PDT 2011
Revision: 5284
http://trac.macosforge.org/projects/ruby/changeset/5284
Author: mattaimonetti at gmail.com
Date: 2011-03-21 00:06:45 -0700 (Mon, 21 Mar 2011)
Log Message:
-----------
more work on the Xcode4 templates and reverted a wrong edit
Modified Paths:
--------------
MacRuby/trunk/misc/xcode4-templates/Mac/Application/MacRuby Core Data Application.xctemplate/TemplateInfo.plist
MacRuby/trunk/misc/xcode4-templates/Mac/Application/MacRuby Document-based Application.xctemplate/TemplateInfo.plist
Modified: MacRuby/trunk/misc/xcode4-templates/Mac/Application/MacRuby Core Data Application.xctemplate/TemplateInfo.plist
===================================================================
--- MacRuby/trunk/misc/xcode4-templates/Mac/Application/MacRuby Core Data Application.xctemplate/TemplateInfo.plist 2011-03-21 02:58:08 UTC (rev 5283)
+++ MacRuby/trunk/misc/xcode4-templates/Mac/Application/MacRuby Core Data Application.xctemplate/TemplateInfo.plist 2011-03-21 07:06:45 UTC (rev 5284)
@@ -181,12 +181,10 @@
# Returns the persistent store coordinator for the application. This implementation creates and return a coordinator, having added the store for the application to it. (The directory for the store is created, if necessary.)
#
def persistentStoreCoordinator
- if !@persistentStoreCoordinator.nil?
- return @persistentStoreCoordinator
- end
+ return @persistentStoreCoordinator unless @persistentStoreCoordinator.nil?
mom = self.managedObjectModel
- if !mom.nil?
+ if mom.nil?
puts "#{self.class} No model to generate a store from"
return nil
end
@@ -205,8 +203,7 @@
if ok == false
NSApplication.sharedApplication.presentError(error[0])
end
- else
- if properties[NSURLIsDirectoryKey] != true
+ elsif properties[NSURLIsDirectoryKey] != true
# Customize and localize this error.
failure_description = "Expected a folder to store application data, found a file (#{directory.path})."
@@ -233,9 +230,7 @@
# bound to the persistent store coordinator for the application.)
#
def managedObjectContext
- if !@managedObjectContext.nil?
- return @managedObjectContext
- end
+ return @managedObjectContext unless @managedObjectContext.nil?
coordinator = self.persistentStoreCoordinator
@@ -280,9 +275,7 @@
def applicationShouldTerminate(sender)
# Save changes in the application's managed object context before the application terminates.
- if @managedObjectContext.nil?
- return NSTerminateNow
- end
+ return NSTerminateNow if @managedObjectContext.nil?
unless self.managedObjectContext.commitEditing
puts "%@ unable to commit editing to terminate" % self.class
Modified: MacRuby/trunk/misc/xcode4-templates/Mac/Application/MacRuby Document-based Application.xctemplate/TemplateInfo.plist
===================================================================
--- MacRuby/trunk/misc/xcode4-templates/Mac/Application/MacRuby Document-based Application.xctemplate/TemplateInfo.plist 2011-03-21 02:58:08 UTC (rev 5283)
+++ MacRuby/trunk/misc/xcode4-templates/Mac/Application/MacRuby Document-based Application.xctemplate/TemplateInfo.plist 2011-03-21 07:06:45 UTC (rev 5284)
@@ -74,7 +74,7 @@
<key>___VARIABLE_documentClassName:identifier___.rb:implementation</key>
<dict>
<key>Beginning</key>
- <string>class ___VARIABLE_documentClassName:identifier___</string>
+ <string>class ___VARIABLE_documentClassName:identifier___ < NSDocument</string>
<key>End</key>
<string>end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20110321/321463fe/attachment.html>
More information about the macruby-changes
mailing list