[macruby-changes] [3281] MacRuby/trunk/misc/xcode-templates/Project Templates/Application

source_changes at macosforge.org source_changes at macosforge.org
Fri Jan 15 12:52:29 PST 2010


Revision: 3281
          http://trac.macosforge.org/projects/ruby/changeset/3281
Author:   lsansonetti at apple.com
Date:     2010-01-15 12:52:26 -0800 (Fri, 15 Jan 2010)
Log Message:
-----------
reverting 3280

Modified Paths:
--------------
    MacRuby/trunk/misc/xcode-templates/Project Templates/Application/MacRuby Application/rb_main.rb
    MacRuby/trunk/misc/xcode-templates/Project Templates/Application/MacRuby Core Data Application/rb_main.rb
    MacRuby/trunk/misc/xcode-templates/Project Templates/Application/MacRuby Document-based Application/rb_main.rb

Modified: MacRuby/trunk/misc/xcode-templates/Project Templates/Application/MacRuby Application/rb_main.rb
===================================================================
--- MacRuby/trunk/misc/xcode-templates/Project Templates/Application/MacRuby Application/rb_main.rb	2010-01-15 12:59:15 UTC (rev 3280)
+++ MacRuby/trunk/misc/xcode-templates/Project Templates/Application/MacRuby Application/rb_main.rb	2010-01-15 20:52:26 UTC (rev 3281)
@@ -10,13 +10,12 @@
 # do that here too.
 framework 'Cocoa'
 
-main = File.basename(__FILE__, File.extname(__FILE__))
-resources = NSBundle.mainBundle.resourcePath.fileSystemRepresentation
-
 # Loading all the Ruby project files.
-Dir.glob(File.join(resources, '*.{rb,rbo}')).each do |file|
-  file = File.basename(file, File.extname(file))
-  require file unless file == main
+dir_path = NSBundle.mainBundle.resourcePath.fileSystemRepresentation
+Dir.glob(dir_path + '/*.{rb,rbo}').map { |x| File.basename(x, File.extname(x)) }.uniq.each do |path|
+  if path != File.basename(__FILE__)
+    require(path)
+  end
 end
 
 # Starting the Cocoa main loop.

Modified: MacRuby/trunk/misc/xcode-templates/Project Templates/Application/MacRuby Core Data Application/rb_main.rb
===================================================================
--- MacRuby/trunk/misc/xcode-templates/Project Templates/Application/MacRuby Core Data Application/rb_main.rb	2010-01-15 12:59:15 UTC (rev 3280)
+++ MacRuby/trunk/misc/xcode-templates/Project Templates/Application/MacRuby Core Data Application/rb_main.rb	2010-01-15 20:52:26 UTC (rev 3281)
@@ -11,13 +11,12 @@
 framework 'Cocoa'
 framework 'CoreData'
 
-main = File.basename(__FILE__, File.extname(__FILE__))
-resources = NSBundle.mainBundle.resourcePath.fileSystemRepresentation
-
 # Loading all the Ruby project files.
-Dir.glob(File.join(resources, '*.{rb,rbo}')).each do |file|
-  file = File.basename(file, File.extname(file))
-  require file unless file == main
+dir_path = NSBundle.mainBundle.resourcePath.fileSystemRepresentation
+Dir.glob(dir_path + '/*.{rb,rbo}').map { |x| File.basename(x, File.extname(x)) }.uniq.each do |path|
+  if path != File.basename(__FILE__)
+    require(path)
+  end
 end
 
 # Starting the Cocoa main loop.

Modified: MacRuby/trunk/misc/xcode-templates/Project Templates/Application/MacRuby Document-based Application/rb_main.rb
===================================================================
--- MacRuby/trunk/misc/xcode-templates/Project Templates/Application/MacRuby Document-based Application/rb_main.rb	2010-01-15 12:59:15 UTC (rev 3280)
+++ MacRuby/trunk/misc/xcode-templates/Project Templates/Application/MacRuby Document-based Application/rb_main.rb	2010-01-15 20:52:26 UTC (rev 3281)
@@ -10,13 +10,12 @@
 # do that here too.
 framework 'Cocoa'
 
-main = File.basename(__FILE__, File.extname(__FILE__))
-resources = NSBundle.mainBundle.resourcePath.fileSystemRepresentation
-
 # Loading all the Ruby project files.
-Dir.glob(File.join(resources, '*.{rb,rbo}')).each do |file|
-  file = File.basename(file, File.extname(file))
-  require file unless file == main
+dir_path = NSBundle.mainBundle.resourcePath.fileSystemRepresentation
+Dir.glob(dir_path + '/*.{rb,rbo}').map { |x| File.basename(x, File.extname(x)) }.uniq.each do |path|
+  if path != File.basename(__FILE__)
+    require(path)
+  end
 end
 
 # Starting the Cocoa main loop.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20100115/663afe4d/attachment.html>


More information about the macruby-changes mailing list