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

source_changes at macosforge.org source_changes at macosforge.org
Tue Nov 24 19:28:47 PST 2009


Revision: 3045
          http://trac.macosforge.org/projects/ruby/changeset/3045
Author:   lsansonetti at apple.com
Date:     2009-11-24 19:28:45 -0800 (Tue, 24 Nov 2009)
Log Message:
-----------
updated rb_main.rb to honor .rbo files

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	2009-11-25 03:20:22 UTC (rev 3044)
+++ MacRuby/trunk/misc/xcode-templates/Project Templates/Application/MacRuby Application/rb_main.rb	2009-11-25 03:28:45 UTC (rev 3045)
@@ -12,11 +12,11 @@
 
 # Loading all the Ruby project files.
 dir_path = NSBundle.mainBundle.resourcePath.fileSystemRepresentation
-Dir.entries(dir_path).each do |path|
-  if path != File.basename(__FILE__) and path[-3..-1] == '.rb'
+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.
-NSApplicationMain(0, nil)
+NSApplicationMain(0, nil)
\ No newline at end of file

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	2009-11-25 03:20:22 UTC (rev 3044)
+++ MacRuby/trunk/misc/xcode-templates/Project Templates/Application/MacRuby Core Data Application/rb_main.rb	2009-11-25 03:28:45 UTC (rev 3045)
@@ -13,11 +13,11 @@
 
 # Loading all the Ruby project files.
 dir_path = NSBundle.mainBundle.resourcePath.fileSystemRepresentation
-Dir.entries(dir_path).each do |path|
-  if path != File.basename(__FILE__) and path[-3..-1] == '.rb'
+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.
-NSApplicationMain(0, nil)
+NSApplicationMain(0, nil)
\ No newline at end of file

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	2009-11-25 03:20:22 UTC (rev 3044)
+++ MacRuby/trunk/misc/xcode-templates/Project Templates/Application/MacRuby Document-based Application/rb_main.rb	2009-11-25 03:28:45 UTC (rev 3045)
@@ -12,11 +12,11 @@
 
 # Loading all the Ruby project files.
 dir_path = NSBundle.mainBundle.resourcePath.fileSystemRepresentation
-Dir.entries(dir_path).each do |path|
-	if path != File.basename(__FILE__) and path[-3..-1] == '.rb'
-		require(path)
-	end
+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.
-NSApplicationMain(0, nil)
+NSApplicationMain(0, nil)
\ No newline at end of file
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20091124/c066f893/attachment.html>


More information about the macruby-changes mailing list