Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

oops

git-svn-id: http://svn.macosforge.org/repository/ruby/MacRuby/trunk@5290 23306eb0-4c56-4727-a40e-e92c0eb68959
  • Loading branch information...
commit 3a3e8c6ee8742c575e5766022be93d5c1184d9a8 1 parent 30c00eb
Laurent Sansonetti authored

Showing 22 changed files with 0 additions and 9,265 deletions. Show diff stats Hide diff stats

  1. +0 79 misc/xcode4-templates/File Templates/Base/MacRuby Application.xctemplate/TemplateInfo.plist
  2. +0 3,695 misc/xcode4-templates/File Templates/Mac/Application/MacRuby Application.xctemplate/MainMenuApp.xib
  3. BIN  misc/xcode4-templates/File Templates/Mac/Application/MacRuby Application.xctemplate/TemplateIcon.icns
  4. +0 101 misc/xcode4-templates/File Templates/Mac/Application/MacRuby Application.xctemplate/TemplateInfo.plist
  5. +0 23 misc/xcode4-templates/File Templates/Mac/Application/MacRuby Application.xctemplate/rb_main.rb
  6. +0 402 ...xcode4-templates/File Templates/Mac/Application/MacRuby Core Data Application.xctemplate/TemplateInfo.plist
  7. +0 8 ...ation/MacRuby Core Data Application.xctemplate/___PACKAGENAMEASIDENTIFIER___.xcdatamodeld/.xccurrentversion
  8. BIN  ...on.xctemplate/___PACKAGENAMEASIDENTIFIER___.xcdatamodeld/___PACKAGENAMEASIDENTIFIER___.xcdatamodel/elements
  9. BIN  ...tion.xctemplate/___PACKAGENAMEASIDENTIFIER___.xcdatamodeld/___PACKAGENAMEASIDENTIFIER___.xcdatamodel/layout
  10. +0 8 ...on/MacRuby Core Data Application.xctemplate/___VARIABLE_documentClassName___.xcdatamodeld/.xccurrentversion
  11. BIN  ...emplate/___VARIABLE_documentClassName___.xcdatamodeld/___VARIABLE_documentClassName___.xcdatamodel/elements
  12. BIN  ...ctemplate/___VARIABLE_documentClassName___.xcdatamodeld/___VARIABLE_documentClassName___.xcdatamodel/layout
  13. +0 69 ...plates/File Templates/Mac/Application/MacRuby Core Data Spotlight Application.xctemplate/TemplateInfo.plist
  14. +0 252 .../xcode4-templates/File Templates/Mac/Application/MacRuby Document-based Application.xctemplate/Document.xib
  15. +0 4,031 ...ode4-templates/File Templates/Mac/Application/MacRuby Document-based Application.xctemplate/MainMenuDoc.xib
  16. +0 214 ...4-templates/File Templates/Mac/Application/MacRuby Document-based Application.xctemplate/TemplateInfo.plist
  17. BIN  misc/xcode4-templates/File Templates/Mac/System Plug-in/MacRuby Preference Pane.xctemplate/TemplateIcon.icns
  18. +0 138 misc/xcode4-templates/File Templates/Mac/System Plug-in/MacRuby Preference Pane.xctemplate/TemplateInfo.plist
  19. +0 24 ...plates/File Templates/Mac/System Plug-in/MacRuby Preference Pane.xctemplate/___PACKAGENAMEASIDENTIFIER___.m
  20. +0 17 ...lates/File Templates/Mac/System Plug-in/MacRuby Preference Pane.xctemplate/___PACKAGENAMEASIDENTIFIER___.rb
  21. BIN  ...tes/File Templates/Mac/System Plug-in/MacRuby Preference Pane.xctemplate/___PACKAGENAMEASIDENTIFIER___.tiff
  22. +0 204 ...ates/File Templates/Mac/System Plug-in/MacRuby Preference Pane.xctemplate/___PACKAGENAMEASIDENTIFIER___.xib
79 misc/xcode4-templates/File Templates/Base/MacRuby Application.xctemplate/TemplateInfo.plist
... ... @@ -1,79 +0,0 @@
1   -<?xml version="1.0" encoding="UTF-8"?>
2   -<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3   -<plist version="1.0">
4   -<dict>
5   - <key>Kind</key>
6   - <string>Xcode.Xcode3.ProjectTemplateUnitKind</string>
7   - <key>Identifier</key>
8   - <string>com.apple.dt.unit.macrubyApplicationBase</string>
9   - <key>Ancestors</key>
10   - <array>
11   - <string>com.apple.dt.unit.objectiveCApplication</string>
12   - </array>
13   - <key>Targets</key>
14   - <array>
15   - <dict>
16   - <!-- We want the GC to be enabled in all projects -->
17   - <key>SharedSettings</key>
18   - <dict>
19   - <key>GCC_ENABLE_OBJC_GC</key>
20   - <string>required</string>
21   - </dict>
22   - <!--
23   - Don't forget to include MacRuby
24   - In temp. Xcode 4, the Framework path is
25   - /Xcode4/SDKs/MacOSX10.6.sdk/System/Library/Frameworks
26   - MacRuby might need to be copied in this folder
27   - -->
28   - <key>Frameworks</key>
29   - <array>
30   - <string>Cocoa</string>
31   - <string>MacRuby</string>
32   - </array>
33   - </dict>
34   - <dict>
35   - <key>Name</key>
36   - <string>Deployment</string>
37   - <key>TargetType</key>
38   - <string>Legacy</string>
39   - <key>BuildToolPath</key>
40   - <string>/usr/local/bin/macruby_deploy</string>
41   - <key>BuildToolArgsString</key>
42   - <string>--compile --embed</string>
43   - </dict>
44   - </array>
45   - <key>Definitions</key>
46   - <dict>
47   - <key>*:*:initialize</key>
48   - <dict>
49   - <key>Beginning</key>
50   - <string>def init
51   - super
52   - if (self != nil)</string>
53   - <key>End</key>
54   - <string> end
55   - self
56   -end
57   -
58   -</string>
59   - <key>Indent</key>
60   - <integer>2</integer>
61   - </dict>
62   - <key>*:framework:*</key>
63   - <string>framework &quot;___*___&quot;
64   -</string>
65   - <key>*:*:iboutlet:*</key>
66   - <string>attr_accessor :___*___
67   -</string>
68   - <key>*:rubyheaders</key>
69   - <string>#
70   -# ___FILENAME___
71   -# ___PACKAGENAME___
72   -#
73   -# Created by ___FULLUSERNAME___ on ___DATE___.
74   -# Copyright ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved.
75   -#
76   -</string>
77   -</dict>
78   -</dict>
79   -</plist>
3,695 misc/xcode4-templates/File Templates/Mac/Application/MacRuby Application.xctemplate/MainMenuApp.xib
0 additions, 3,695 deletions not shown
BIN  misc/xcode4-templates/File Templates/Mac/Application/MacRuby Application.xctemplate/TemplateIcon.icns
Binary file not shown
101 misc/xcode4-templates/File Templates/Mac/Application/MacRuby Application.xctemplate/TemplateInfo.plist
... ... @@ -1,101 +0,0 @@
1   -<?xml version="1.0" encoding="UTF-8"?>
2   -<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3   -<plist version="1.0">
4   -<dict>
5   - <key>Kind</key>
6   - <string>Xcode.Xcode3.ProjectTemplateUnitKind</string>
7   - <key>Identifier</key>
8   - <string>com.apple.dt.unit.macrubyApplication</string>
9   - <key>Ancestors</key>
10   - <array>
11   - <string>com.apple.dt.unit.macrubyApplicationBase</string>
12   - <string>com.apple.dt.unit.macBase</string>
13   - </array>
14   - <!--
15   - Nodes is a list of what needs to be processed, with a list of rules to be
16   - applied to each files.
17   - For example, "main.m:import:importMacRuby" will take main.m, apply the
18   - *:import:* rule, and then apply the importMacRuby rule on it
19   - -->
20   - <key>Nodes</key>
21   - <array>
22   - <string>main.m:import:importMacruby</string>
23   - <string>main.m:main:macrubyMain</string>
24   - <string>___PACKAGENAME___-Info.plist:MacRuby</string>
25   - <string>___PACKAGENAME___-Info.plist:ApplicationCategory</string>
26   - <string>en.lproj/MainMenu.xib</string>
27   - <string>rb_main.rb</string>
28   - </array>
29   - <!-- This defines how the Nodes rules are applied -->
30   - <key>Definitions</key>
31   - <dict>
32   - <key>main.m:main:macrubyMain</key>
33   - <string>return macruby_main(&quot;rb_main.rb&quot;, argc, argv);</string>
34   - <key>main.m:import:importMacruby</key>
35   - <string>#import &lt;MacRuby/MacRuby.h&gt;
36   -</string>
37   - <key>___PACKAGENAME___-Info.plist:ApplicationCategory</key>
38   - <string>&lt;key&gt;LSApplicationCategoryType&lt;/key&gt;
39   -&lt;string&gt;___VARIABLE_applicationCategory___&lt;/string&gt;
40   - </string>
41   - <key>___PACKAGENAME___-Info.plist:MacRuby</key>
42   - <string>&lt;key&gt;CFBundleShortVersionString&lt;/key&gt;
43   -&lt;string&gt;1.0&lt;/string&gt;
44   -&lt;key&gt;LSMinimumSystemVersion&lt;/key&gt;
45   -&lt;string&gt;${MACOSX_DEPLOYMENT_TARGET}&lt;/string&gt;
46   -&lt;key&gt;CFBundleVersion&lt;/key&gt;
47   -&lt;string&gt;1&lt;/string&gt;
48   -&lt;key&gt;NSMainNibFile&lt;/key&gt;
49   -&lt;string&gt;MainMenu&lt;/string&gt;
50   -&lt;key&gt;NSPrincipalClass&lt;/key&gt;
51   -&lt;string&gt;NSApplication&lt;/string&gt;
52   -</string>
53   - <key>en.lproj/MainMenu.xib</key>
54   - <dict>
55   - <key>Path</key>
56   - <string>MainMenuApp.xib</string>
57   - <key>Group</key>
58   - <string>Resources</string>
59   - </dict>
60   - <key>rb_main.rb</key>
61   - <dict>
62   - <key>Path</key>
63   - <string>rb_main.rb</string>
64   - <key>Group</key>
65   - <string>Other Sources</string>
66   - </dict>
67   - </dict>
68   - <key>Options</key>
69   - <array>
70   - <dict>
71   - <key>Description</key>
72   - <string>The category for your application in the Mac App Store.</string>
73   - <key>Identifier</key>
74   - <string>applicationCategory</string>
75   - <key>Name</key>
76   - <string>App Store Category</string>
77   - <key>NotPersisted</key>
78   - <true/>
79   - <key>Placeholder</key>
80   - <string>None</string>
81   - <key>SpecialType</key>
82   - <string>LSApplicationCategoryType</string>
83   - <key>Type</key>
84   - <string>popup</string>
85   - <key>Units</key>
86   - <dict>
87   - <key></key>
88   - <array>
89   - <dict>
90   - <key>Definitions</key>
91   - <dict>
92   - <key>___PACKAGENAME___-Info.plist:ApplicationCategory</key>
93   - <string></string>
94   - </dict>
95   - </dict>
96   - </array>
97   - </dict>
98   - </dict>
99   - </array>
100   -</dict>
101   -</plist>
23 misc/xcode4-templates/File Templates/Mac/Application/MacRuby Application.xctemplate/rb_main.rb
... ... @@ -1,23 +0,0 @@
1   -#
2   -# ___FILENAME___
3   -# ___PACKAGENAME___
4   -#
5   -# Created by ___FULLUSERNAME___ on ___DATE___.
6   -# Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved.
7   -#
8   -
9   -# Loading the Cocoa framework. If you need to load more frameworks, you can
10   -# do that here too.
11   -framework 'Cocoa'
12   -
13   -# Loading all the Ruby project files.
14   -main = File.basename(__FILE__, File.extname(__FILE__))
15   -dir_path = NSBundle.mainBundle.resourcePath.fileSystemRepresentation
16   -Dir.glob(File.join(dir_path, '*.{rb,rbo}')).map { |x| File.basename(x, File.extname(x)) }.uniq.each do |path|
17   - if path != main
18   - require(path)
19   - end
20   -end
21   -
22   -# Starting the Cocoa main loop.
23   -NSApplicationMain(0, nil)
402 ...de4-templates/File Templates/Mac/Application/MacRuby Core Data Application.xctemplate/TemplateInfo.plist
... ... @@ -1,402 +0,0 @@
1   -<?xml version="1.0" encoding="UTF-8"?>
2   -<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3   -<plist version="1.0">
4   -<dict>
5   - <key>Kind</key>
6   - <string>Xcode.Xcode3.ProjectTemplateUnitKind</string>
7   - <key>Identifier</key>
8   - <string>com.apple.dt.unit.macrubyCoreDataApplication</string>
9   - <key>Ancestors</key>
10   - <array>
11   - <string>com.apple.dt.unit.macrubyDocumentBasedApplication</string>
12   - </array>
13   - <key>Options</key>
14   - <array>
15   - <dict>
16   - <key>Identifier</key>
17   - <string>coreData</string>
18   - <key>Name</key>
19   - <string>Use Core Data</string>
20   - <key>Description</key>
21   - <string>Indicates whether the application should use the Core Data framework for storage.</string>
22   - <key>Type</key>
23   - <string>checkbox</string>
24   - <key>Default</key>
25   - <string>false</string>
26   - <key>Units</key>
27   - <dict>
28   - <key>true</key>
29   - <array>
30   - <dict>
31   - <key>RequiredOptions</key>
32   - <dict>
33   - <key>documentBased</key>
34   - <string>true</string>
35   - </dict>
36   - <key>Nodes</key>
37   - <array>
38   - <string>___VARIABLE_documentClassName:identifier___.xcdatamodeld</string>
39   - </array>
40   - <key>Definitions</key>
41   - <dict>
42   - <key>___PACKAGENAME___-Info.plist:DocumentTypes</key>
43   - <string>&lt;key&gt;CFBundleDocumentTypes&lt;/key&gt;
44   -&lt;array&gt;
45   - &lt;dict&gt;
46   - &lt;key&gt;CFBundleTypeExtensions&lt;/key&gt;
47   - &lt;array&gt;
48   - &lt;string&gt;binary&lt;/string&gt;
49   - &lt;/array&gt;
50   - &lt;key&gt;CFBundleTypeMIMETypes&lt;/key&gt;
51   - &lt;array&gt;
52   - &lt;string&gt;application/octet-stream&lt;/string&gt;
53   - &lt;/array&gt;
54   - &lt;key&gt;CFBundleTypeName&lt;/key&gt;
55   - &lt;string&gt;Binary&lt;/string&gt;
56   - &lt;key&gt;CFBundleTypeRole&lt;/key&gt;
57   - &lt;string&gt;Editor&lt;/string&gt;
58   - &lt;key&gt;LSTypeIsPackage&lt;/key&gt;
59   - &lt;false/&gt;
60   - &lt;key&gt;NSDocumentClass&lt;/key&gt;
61   - &lt;string&gt;___VARIABLE_documentClassName:identifier___&lt;/string&gt;
62   - &lt;key&gt;NSPersistentStoreTypeKey&lt;/key&gt;
63   - &lt;string&gt;Binary&lt;/string&gt;
64   - &lt;/dict&gt;
65   - &lt;dict&gt;
66   - &lt;key&gt;CFBundleTypeExtensions&lt;/key&gt;
67   - &lt;array&gt;
68   - &lt;string&gt;sqlite&lt;/string&gt;
69   - &lt;/array&gt;
70   - &lt;key&gt;CFBundleTypeMIMETypes&lt;/key&gt;
71   - &lt;array&gt;
72   - &lt;string&gt;application/octet-stream&lt;/string&gt;
73   - &lt;/array&gt;
74   - &lt;key&gt;CFBundleTypeName&lt;/key&gt;
75   - &lt;string&gt;SQLite&lt;/string&gt;
76   - &lt;key&gt;CFBundleTypeRole&lt;/key&gt;
77   - &lt;string&gt;Editor&lt;/string&gt;
78   - &lt;key&gt;LSTypeIsPackage&lt;/key&gt;
79   - &lt;false/&gt;
80   - &lt;key&gt;NSDocumentClass&lt;/key&gt;
81   - &lt;string&gt;___VARIABLE_documentClassName:identifier___&lt;/string&gt;
82   - &lt;key&gt;NSPersistentStoreTypeKey&lt;/key&gt;
83   - &lt;string&gt;SQLite&lt;/string&gt;
84   - &lt;/dict&gt;
85   - &lt;dict&gt;
86   - &lt;key&gt;CFBundleTypeExtensions&lt;/key&gt;
87   - &lt;array&gt;
88   - &lt;string&gt;xml&lt;/string&gt;
89   - &lt;/array&gt;
90   - &lt;key&gt;CFBundleTypeIconFile&lt;/key&gt;
91   - &lt;string&gt;&lt;/string&gt;
92   - &lt;key&gt;CFBundleTypeMIMETypes&lt;/key&gt;
93   - &lt;array&gt;
94   - &lt;string&gt;text/xml&lt;/string&gt;
95   - &lt;/array&gt;
96   - &lt;key&gt;CFBundleTypeName&lt;/key&gt;
97   - &lt;string&gt;XML&lt;/string&gt;
98   - &lt;key&gt;CFBundleTypeOSTypes&lt;/key&gt;
99   - &lt;array&gt;
100   - &lt;string&gt;????&lt;/string&gt;
101   - &lt;/array&gt;
102   - &lt;key&gt;CFBundleTypeRole&lt;/key&gt;
103   - &lt;string&gt;Editor&lt;/string&gt;
104   - &lt;key&gt;LSTypeIsPackage&lt;/key&gt;
105   - &lt;false/&gt;
106   - &lt;key&gt;NSDocumentClass&lt;/key&gt;
107   - &lt;string&gt;___VARIABLE_documentClassName:identifier___&lt;/string&gt;
108   - &lt;key&gt;NSPersistentStoreTypeKey&lt;/key&gt;
109   - &lt;string&gt;XML&lt;/string&gt;
110   - &lt;/dict&gt;
111   -&lt;/array&gt;
112   -</string>
113   - <key>___VARIABLE_documentClassName:identifier___.rb:implementation</key>
114   - <dict>
115   - <key>Beginning</key>
116   - <string>class ___VARIABLE_documentClassName:identifier___ &lt; NSPersistentDocument</string>
117   - <key>End</key>
118   - <string>end
119   -</string>
120   - <key>Indent</key>
121   - <integer>1</integer>
122   - </dict>
123   - <key>___VARIABLE_documentClassName:identifier___.xcdatamodeld</key>
124   - <dict>
125   - <key>Path</key>
126   - <string>___VARIABLE_documentClassName___.xcdatamodeld</string>
127   - </dict>
128   - </dict>
129   - </dict>
130   - <dict>
131   - <key>RequiredOptions</key>
132   - <dict>
133   - <key>documentBased</key>
134   - <string>false</string>
135   - </dict>
136   - <key>Nodes</key>
137   - <array>
138   - <string>AppDelegate.rb:framework:CoreData</string>
139   - <string>___PACKAGENAMEASIDENTIFIER___.xcdatamodeld</string>
140   - <string>AppDelegate.rb:implementation:ivars</string>
141   - <string>AppDelegate.rb:implementation:coreData</string>
142   - </array>
143   - <key>Definitions</key>
144   - <dict>
145   - <key>___PACKAGENAMEASIDENTIFIER___.xcdatamodeld</key>
146   - <dict>
147   - <key>Path</key>
148   - <string>___PACKAGENAMEASIDENTIFIER___.xcdatamodeld</string>
149   - </dict>
150   - <key>AppDelegate.rb:implementation:ivars</key>
151   - <string>
152   -# Persistence accessors
153   -attr_reader :persistentStoreCoordinator
154   -attr_reader :managedObjectModel
155   -attr_reader :managedObjectContext
156   -
157   -</string>
158   - <key>AppDelegate.rb:implementation:coreData</key>
159   - <string>#
160   -# Returns the directory the application uses to store the Core Data store file. This code uses a directory named &quot;___PACKAGENAMEASIDENTIFIER___&quot; in the user's Library directory.
161   -#
162   -def applicationFilesDirectory
163   - file_manager = NSFileManager.defaultManager
164   - library_url = file_manager.URLsForDirectory(NSLibraryDirectory, inDomains:NSUserDomainMask).lastObject
165   - library_url.URLByAppendingPathComponent(&quot;___PACKAGENAMEASIDENTIFIER___&quot;)
166   -end
167   -
168   -#
169   -# Creates if necessary and returns the managed object model for the application.
170   -#
171   -def managedObjectModel
172   - if @managedObjectModel.nil?
173   - model_url = NSBundle.mainBundle.URLForResource(&quot;___PACKAGENAMEASIDENTIFIER___&quot;, withExtension:&quot;momd&quot;)
174   - @managedObjectModel = NSManagedObjectModel.alloc.initWithContentsOfURL(model_url)
175   - else
176   - @managedObjectModel
177   - end
178   -end
179   -
180   -#
181   -# 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.)
182   -#
183   -def persistentStoreCoordinator
184   - return @persistentStoreCoordinator unless @persistentStoreCoordinator.nil?
185   -
186   - mom = self.managedObjectModel
187   - if mom.nil?
188   - puts &quot;#{self.class} No model to generate a store from&quot;
189   - return nil
190   - end
191   -
192   - file_manager = NSFileManager.defaultManager
193   - directory = self.applicationFilesDirectory
194   - error = Pointer.new_with_type('@')
195   -
196   - properties = directory.resourceValuesForKeys([NSURLIsDirectoryKey], error:error)
197   -
198   - if properties.nil?
199   - ok = false
200   - if error[0].code == NSFileReadNoSuchFileError
201   - ok = file_manager.createDirectoryAtPath(directory.path, withIntermediateDirectories:true, attributes:nil, error:error)
202   - end
203   - if ok == false
204   - NSApplication.sharedApplication.presentError(error[0])
205   - end
206   - elsif properties[NSURLIsDirectoryKey] != true
207   - # Customize and localize this error.
208   - failure_description = &quot;Expected a folder to store application data, found a file (#{directory.path}).&quot;
209   -
210   - error = NSError.errorWithDomain(&quot;YOUR_ERROR_DOMAIN&quot;, code:101, userInfo:{NSLocalizedDescriptionKey => failure_description})
211   -
212   - NSApplication.sharedApplication.presentError(error)
213   - return nil
214   - end
215   - end
216   -
217   - url = directory.URLByAppendingPathComponent(&quot;___PACKAGENAMEASIDENTIFIER___.storedata&quot;)
218   - @persistentStoreCoordinator = NSPersistentStoreCoordinator.alloc.initWithManagedObjectModel(mom)
219   -
220   - unless @persistentStoreCoordinator.addPersistentStoreWithType(NSXMLStoreType, configuration:nil, URL:url, options:nil, error:error)
221   - NSApplication.sharedApplication.presentError(error[0])
222   - return nil
223   - end
224   -
225   - @persistentStoreCoordinator
226   -end
227   -
228   -#
229   -# Returns the managed object context for the application (which is already
230   -# bound to the persistent store coordinator for the application.)
231   -#
232   -def managedObjectContext
233   - return @managedObjectContext unless @managedObjectContext.nil?
234   -
235   - coordinator = self.persistentStoreCoordinator
236   -
237   - if coordinator.nil?
238   - dict = {
239   - NSLocalizedDescriptionKey => &quot;Failed to initialize the store&quot;,
240   - NSLocalizedFailureReasonErrorKey => &quot;There was an error building up the data file.&quot;
241   - }
242   - error = NSError.errorWithDomain(&quot;YOUR_ERROR_DOMAIN&quot;, code:9999, userInfo:dict)
243   - NSApplication.sharedApplication.presentError(error)
244   - return nil
245   - end
246   -
247   - @managedObjectContext = NSManagedObjectContext.alloc.init
248   - @managedObjectContext.setPersistentStoreCoordinator(coordinator)
249   -
250   - @managedObjectContext
251   -end
252   -
253   -#
254   -# Returns the NSUndoManager for the application. In this case, the manager returned is that of the managed object context for the application.
255   -#
256   -def windowWillReturnUndoManager(window)
257   - self.managedObjectContext.undoManager
258   -end
259   -
260   -#
261   -# Performs the save action for the application, which is to send the save: message to the application&apos;s managed object context. Any encountered errors are presented to the user.
262   -#
263   -def saveAction(sender)
264   - error = Pointer.new_with_type('@')
265   -
266   - unless self.managedObjectContext.commitEditing
267   - puts &quot;#{self.class} unable to commit editing before saving&quot;
268   - end
269   -
270   - unless self.managedObjectContext.save(error)
271   - NSApplication.sharedApplication.presentError(error[0])
272   - end
273   -end
274   -
275   -def applicationShouldTerminate(sender)
276   - # Save changes in the application's managed object context before the application terminates.
277   -
278   - return NSTerminateNow if @managedObjectContext.nil?
279   -
280   - unless self.managedObjectContext.commitEditing
281   - puts &quot;%@ unable to commit editing to terminate&quot; % self.class
282   - end
283   -
284   - unless self.managedObjectContext.hasChanges
285   - return NSTerminateNow
286   - end
287   -
288   - error = Pointer.new_with_type('@')
289   - unless self.managedObjectContext.save(error)
290   - # Customize this code block to include application-specific recovery steps.
291   - if sender.presentError(error[0]) == true
292   - return NSTerminateCancel
293   - end
294   -
295   - alert = NSAlert.alloc.init
296   - alert.messageText = &quot;Could not save changes while quitting. Quit anyway?&quot;
297   - alert.informativeText = &quot;Quitting now will lose any changes you have made since the last successful save&quot;
298   - alert.addButtonWithTitle &quot;Quit anyway&quot;
299   - alert.addButtonWithTitle &quot;Cancel&quot;
300   -
301   - answer = alert.runModal
302   - if (answer == NSAlertAlternateReturn)
303   - return NSTerminateCancel
304   - end
305   -
306   - end
307   -
308   - NSTerminateNow
309   -end
310   -</string>
311   - </dict>
312   - </dict>
313   - </array>
314   - <key>false</key>
315   - <array>
316   - <dict>
317   - <key>RequiredOptions</key>
318   - <dict>
319   - <key>documentBased</key>
320   - <string>true</string>
321   - </dict>
322   - <key>Nodes</key>
323   - <array>
324   - <string>___VARIABLE_documentClassName:identifier___.rb:implementation:dataOfType:comments</string>
325   - <string>___VARIABLE_documentClassName:identifier___.rb:implementation:dataOfType:code</string>
326   - <string>___VARIABLE_documentClassName:identifier___.rb:implementation:readFromData:comments</string>
327   - <string>___VARIABLE_documentClassName:identifier___.rb:implementation:readFromData:code</string>
328   - <string>___VARIABLE_documentClassName:identifier___.rb:implementation:displayName:comments</string>
329   - <string>___VARIABLE_documentClassName:identifier___.rb:implementation:displayName:code</string>
330   - </array>
331   - <key>Definitions</key>
332   - <dict>
333   - <key>___VARIABLE_documentClassName:identifier___.rb:implementation:dataOfType</key>
334   - <dict>
335   - <key>Beginning</key>
336   - <string>def dataOfType(typeName, error:outError)</string>
337   - <key>End</key>
338   - <string>end
339   -
340   -</string>
341   - <key>Indent</key>
342   - <integer>1</integer>
343   - </dict>
344   - <key>___VARIABLE_documentClassName:identifier___.rb:implementation:dataOfType:comments</key>
345   - <string>#
346   -# Insert code here to write your document to data of the specified type. If outError != NULL, ensure that you create and set an appropriate error when returning nil.
347   -# You can also choose to override -fileWrapperOfType:error:, -writeToURL:ofType:error:, or -writeToURL:ofType:forSaveOperation:originalContentsURL:error: instead.
348   -#
349   -</string>
350   - <key>___VARIABLE_documentClassName:identifier___.rb:implementation:dataOfType:code</key>
351   - <string>if outError
352   - outError.assign(NSError.errorWithDomain(NSOSStatusErrorDomain, code:-4, userInfo:nil))
353   -end
354   -return nil
355   -</string>
356   - <key>___VARIABLE_documentClassName:identifier___.rb:implementation:readFromData</key>
357   - <dict>
358   - <key>Beginning</key>
359   - <string>def readFromData(data, ofType:typeName, error:outError)</string>
360   - <key>End</key>
361   - <string>end
362   -
363   -</string>
364   - <key>Indent</key>
365   - <integer>1</integer>
366   - </dict>
367   - <key>___VARIABLE_documentClassName:identifier___.rb:implementation:readFromData:comments</key>
368   - <string>#
369   -# Insert code here to read your document from the given data of the specified type. If outError != NULL, ensure that you create and set an appropriate error when returning NO.
370   -# You can also choose to override -readFromFileWrapper:ofType:error: or -readFromURL:ofType:error: instead.
371   -#
372   -</string>
373   - <key>___VARIABLE_documentClassName:identifier___.rb:implementation:readFromData:code</key>
374   - <string>if outError
375   - outError.assign(NSError.errorWithDomain(NSOSStatusErrorDomain, code:-4, userInfo:nil))
376   -end
377   -true
378   -</string>
379   - <key>___VARIABLE_documentClassName:identifier___.rb:implementation:displayName</key>
380   - <dict>
381   - <key>Beginning</key>
382   - <string>def displayName</string>
383   - <key>End</key>
384   - <string>end
385   -</string>
386   - <key>Indent</key>
387   - <integer>1</integer>
388   - </dict>
389   - <key>___VARIABLE_documentClassName:identifier___.rb:implementation:displayName:comments</key>
390   - <string># Return lowercase 'untitled', to comply with HIG
391   -</string>
392   - <key>___VARIABLE_documentClassName:identifier___.rb:implementation:displayName:code</key>
393   - <string>fileURL ? super : super.sub(/^[[:upper:]]/) { |s| s.downcase }
394   -</string>
395   - </dict>
396   - </dict>
397   - </array>
398   - </dict>
399   - </dict>
400   - </array>
401   -</dict>
402   -</plist>
8 ...on/MacRuby Core Data Application.xctemplate/___PACKAGENAMEASIDENTIFIER___.xcdatamodeld/.xccurrentversion
... ... @@ -1,8 +0,0 @@
1   -<?xml version="1.0" encoding="UTF-8"?>
2   -<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3   -<plist version="1.0">
4   -<dict>
5   - <key>_XCCurrentVersionName</key>
6   - <string>___PACKAGENAMEASIDENTIFIER___.xcdatamodel</string>
7   -</dict>
8   -</plist>
BIN  ...xctemplate/___PACKAGENAMEASIDENTIFIER___.xcdatamodeld/___PACKAGENAMEASIDENTIFIER___.xcdatamodel/elements
Binary file not shown
BIN  ...n.xctemplate/___PACKAGENAMEASIDENTIFIER___.xcdatamodeld/___PACKAGENAMEASIDENTIFIER___.xcdatamodel/layout
Binary file not shown
8 ...MacRuby Core Data Application.xctemplate/___VARIABLE_documentClassName___.xcdatamodeld/.xccurrentversion
... ... @@ -1,8 +0,0 @@
1   -<?xml version="1.0" encoding="UTF-8"?>
2   -<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3   -<plist version="1.0">
4   -<dict>
5   - <key>_XCCurrentVersionName</key>
6   - <string>___VARIABLE_documentClassName___.xcdatamodel</string>
7   -</dict>
8   -</plist>
BIN  ...late/___VARIABLE_documentClassName___.xcdatamodeld/___VARIABLE_documentClassName___.xcdatamodel/elements
Binary file not shown
BIN  ...mplate/___VARIABLE_documentClassName___.xcdatamodeld/___VARIABLE_documentClassName___.xcdatamodel/layout
Binary file not shown
69 ...tes/File Templates/Mac/Application/MacRuby Core Data Spotlight Application.xctemplate/TemplateInfo.plist
... ... @@ -1,69 +0,0 @@
1   -<?xml version="1.0" encoding="UTF-8"?>
2   -<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3   -<plist version="1.0">
4   -<dict>
5   - <key>Kind</key>
6   - <string>Xcode.Xcode3.ProjectTemplateUnitKind</string>
7   - <key>Identifier</key>
8   - <string>com.apple.dt.unit.macrubyCoreDataSpotlightApplication</string>
9   - <key>Concrete</key>
10   - <true/>
11   - <key>Name</key>
12   - <string>MacRuby Application</string>
13   - <key>Description</key>
14   - <string>This template builds a Cocoa-based application written in MacRuby.</string>
15   - <key>SortOrder</key>
16   - <integer>0</integer>
17   - <key>Ancestors</key>
18   - <array>
19   - <string>com.apple.dt.unit.macrubyCoreDataApplication</string>
20   - </array>
21   - <key>RequiredOptions</key>
22   - <dict>
23   - <key>coreData</key>
24   - <string>true</string>
25   - </dict>
26   - <key>Options</key>
27   - <array>
28   - <dict>
29   - <key>Identifier</key>
30   - <string>spotlightImporter</string>
31   - <key>Name</key>
32   - <string>Include Spotlight Importer</string>
33   - <key>Description</key>
34   - <string>Indicates whether the application should also create a Spotlight importer.</string>
35   - <key>Type</key>
36   - <string>checkbox</string>
37   - <key>SortOrder</key>
38   - <integer>1</integer>
39   - <key>Default</key>
40   - <string>false</string>
41   - <key>Units</key>
42   - <dict>
43   - <key>true</key>
44   - <array>
45   - <dict>
46   - <key>Components</key>
47   - <array>
48   - <dict>
49   - <key>Identifier</key>
50   - <string>com.apple.dt.unit.spotlightImporter</string>
51   - <key>Name</key>
52   - <string>___PACKAGENAME___Importer</string>
53   - <key>Dependents</key>
54   - <array>
55   - <string>0</string>
56   - </array>
57   - <key>ProductDependents</key>
58   - <array>
59   - <string>0</string>
60   - </array>
61   - </dict>
62   - </array>
63   - </dict>
64   - </array>
65   - </dict>
66   - </dict>
67   - </array>
68   -</dict>
69   -</plist>
252 ...ode4-templates/File Templates/Mac/Application/MacRuby Document-based Application.xctemplate/Document.xib
... ... @@ -1,252 +0,0 @@
1   -<?xml version="1.0" encoding="UTF-8"?>
2   -<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.06">
3   - <data>
4   - <int key="IBDocument.SystemTarget">1060</int>
5   - <string key="IBDocument.SystemVersion">10A261</string>
6   - <string key="IBDocument.InterfaceBuilderVersion">710</string>
7   - <string key="IBDocument.AppKitVersion">1005.2</string>
8   - <string key="IBDocument.HIToolboxVersion">409.00</string>
9   - <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
10   - <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
11   - <string key="NS.object.0">710</string>
12   - </object>
13   - <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
14   - <bool key="EncodedWithXMLCoder">YES</bool>
15   - <integer value="5"/>
16   - </object>
17   - <object class="NSArray" key="IBDocument.PluginDependencies">
18   - <bool key="EncodedWithXMLCoder">YES</bool>
19   - <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
20   - </object>
21   - <object class="NSMutableDictionary" key="IBDocument.Metadata">
22   - <bool key="EncodedWithXMLCoder">YES</bool>
23   - <object class="NSArray" key="dict.sortedKeys" id="0">
24   - <bool key="EncodedWithXMLCoder">YES</bool>
25   - </object>
26   - <object class="NSMutableArray" key="dict.values">
27   - <bool key="EncodedWithXMLCoder">YES</bool>
28   - </object>
29   - </object>
30   - <object class="NSMutableArray" key="IBDocument.RootObjects" id="580458321">
31   - <bool key="EncodedWithXMLCoder">YES</bool>
32   - <object class="NSCustomObject" id="512844837">
33   - <string key="NSClassName">___VARIABLE_documentClassName:identifier___</string>
34   - </object>
35   - <object class="NSCustomObject" id="613418571">
36   - <string key="NSClassName">FirstResponder</string>
37   - </object>
38   - <object class="NSWindowTemplate" id="275939982">
39   - <int key="NSWindowStyleMask">15</int>
40   - <int key="NSWindowBacking">2</int>
41   - <string key="NSWindowRect">{{133, 235}, {507, 413}}</string>
42   - <int key="NSWTFlags">1886912512</int>
43   - <string key="NSWindowTitle">Window</string>
44   - <string key="NSWindowClass">NSWindow</string>
45   - <string key="NSViewClass">View</string>
46   - <string key="NSWindowContentMaxSize">{3.40282e+38, 3.40282e+38}</string>
47   - <string key="NSWindowContentMinSize">{94, 86}</string>
48   - <object class="NSView" key="NSWindowView" id="568628114">
49   - <reference key="NSNextResponder"/>
50   - <int key="NSvFlags">256</int>
51   - <object class="NSMutableArray" key="NSSubviews">
52   - <bool key="EncodedWithXMLCoder">YES</bool>
53   - <object class="NSTextField" id="433022199">
54   - <reference key="NSNextResponder" ref="568628114"/>
55   - <int key="NSvFlags">256</int>
56   - <string key="NSFrame">{{119, 195}, {269, 22}}</string>
57   - <reference key="NSSuperview" ref="568628114"/>
58   - <bool key="NSEnabled">YES</bool>
59   - <object class="NSTextFieldCell" key="NSCell" id="566561048">
60   - <int key="NSCellFlags">67239424</int>
61   - <int key="NSCellFlags2">138412032</int>
62   - <string key="NSContents">Your document contents here</string>
63   - <object class="NSFont" key="NSSupport">
64   - <string key="NSName">LucidaGrande</string>
65   - <double key="NSSize">18</double>
66   - <int key="NSfFlags">16</int>
67   - </object>
68   - <reference key="NSControlView" ref="433022199"/>
69   - <object class="NSColor" key="NSBackgroundColor">
70   - <int key="NSColorSpace">6</int>
71   - <string key="NSCatalogName">System</string>
72   - <string key="NSColorName">controlColor</string>
73   - <object class="NSColor" key="NSColor">
74   - <int key="NSColorSpace">3</int>
75   - <bytes key="NSWhite">MC42NjY2NjY2ODY1AA</bytes>
76   - </object>
77   - </object>
78   - <object class="NSColor" key="NSTextColor">
79   - <int key="NSColorSpace">6</int>
80   - <string key="NSCatalogName">System</string>
81   - <string key="NSColorName">controlTextColor</string>
82   - <object class="NSColor" key="NSColor">
83   - <int key="NSColorSpace">3</int>
84   - <bytes key="NSWhite">MAA</bytes>
85   - </object>
86   - </object>
87   - </object>
88   - </object>
89   - </object>
90   - <string key="NSFrameSize">{507, 413}</string>
91   - <reference key="NSSuperview"/>
92   - </object>
93   - <string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
94   - <string key="NSMinSize">{94, 108}</string>
95   - <string key="NSMaxSize">{3.40282e+38, 3.40282e+38}</string>
96   - </object>
97   - <object class="NSCustomObject" id="796877042">
98   - <string key="NSClassName">NSApplication</string>
99   - </object>
100   - </object>
101   - <object class="IBObjectContainer" key="IBDocument.Objects">
102   - <object class="NSMutableArray" key="connectionRecords">
103   - <bool key="EncodedWithXMLCoder">YES</bool>
104   - <object class="IBConnectionRecord">
105   - <object class="IBOutletConnection" key="connection">
106   - <string key="label">delegate</string>
107   - <reference key="source" ref="275939982"/>
108   - <reference key="destination" ref="512844837"/>
109   - </object>
110   - <int key="connectionID">17</int>
111   - </object>
112   - <object class="IBConnectionRecord">
113   - <object class="IBOutletConnection" key="connection">
114   - <string key="label">window</string>
115   - <reference key="source" ref="512844837"/>
116   - <reference key="destination" ref="275939982"/>
117   - </object>
118   - <int key="connectionID">18</int>
119   - </object>
120   - </object>
121   - <object class="IBMutableOrderedSet" key="objectRecords">
122   - <object class="NSArray" key="orderedObjects">
123   - <bool key="EncodedWithXMLCoder">YES</bool>
124   - <object class="IBObjectRecord">
125   - <int key="objectID">0</int>
126   - <reference key="object" ref="0"/>
127   - <reference key="children" ref="580458321"/>
128   - <nil key="parent"/>
129   - </object>
130   - <object class="IBObjectRecord">
131   - <int key="objectID">-2</int>
132   - <reference key="object" ref="512844837"/>
133   - <reference key="parent" ref="0"/>
134   - <string type="base64-UTF8" key="objectName">RmlsZSdzIE93bmVyA</string>
135   - </object>
136   - <object class="IBObjectRecord">
137   - <int key="objectID">-1</int>
138   - <reference key="object" ref="613418571"/>
139   - <reference key="parent" ref="0"/>
140   - <string key="objectName">First Responder</string>
141   - </object>
142   - <object class="IBObjectRecord">
143   - <int key="objectID">5</int>
144   - <reference key="object" ref="275939982"/>
145   - <object class="NSMutableArray" key="children">
146   - <bool key="EncodedWithXMLCoder">YES</bool>
147   - <reference ref="568628114"/>
148   - </object>
149   - <reference key="parent" ref="0"/>
150   - <string key="objectName">Window</string>
151   - </object>
152   - <object class="IBObjectRecord">
153   - <int key="objectID">6</int>
154   - <reference key="object" ref="568628114"/>
155   - <object class="NSMutableArray" key="children">
156   - <bool key="EncodedWithXMLCoder">YES</bool>
157   - <reference ref="433022199"/>
158   - </object>
159   - <reference key="parent" ref="275939982"/>
160   - </object>
161   - <object class="IBObjectRecord">
162   - <int key="objectID">20</int>
163   - <reference key="object" ref="433022199"/>
164   - <object class="NSMutableArray" key="children">
165   - <bool key="EncodedWithXMLCoder">YES</bool>
166   - <reference ref="566561048"/>
167   - </object>
168   - <reference key="parent" ref="568628114"/>
169   - </object>
170   - <object class="IBObjectRecord">
171   - <int key="objectID">100020</int>
172   - <reference key="object" ref="566561048"/>
173   - <reference key="parent" ref="433022199"/>
174   - </object>
175   - <object class="IBObjectRecord">
176   - <int key="objectID">-3</int>
177   - <reference key="object" ref="796877042"/>
178   - <reference key="parent" ref="0"/>
179   - <string key="objectName">Application</string>
180   - </object>
181   - </object>
182   - </object>
183   - <object class="NSMutableDictionary" key="flattenedProperties">
184   - <bool key="EncodedWithXMLCoder">YES</bool>
185   - <object class="NSArray" key="dict.sortedKeys">