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

source_changes at macosforge.org source_changes at macosforge.org
Fri Jan 15 17:41:27 PST 2010


Revision: 3282
          http://trac.macosforge.org/projects/ruby/changeset/3282
Author:   lsansonetti at apple.com
Date:     2010-01-15 17:41:23 -0800 (Fri, 15 Jan 2010)
Log Message:
-----------
do not load rb_main.rb twice (second try)

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 20:52:26 UTC (rev 3281)
+++ MacRuby/trunk/misc/xcode-templates/Project Templates/Application/MacRuby Application/rb_main.rb	2010-01-16 01:41:23 UTC (rev 3282)
@@ -11,12 +11,13 @@
 framework 'Cocoa'
 
 # Loading all the Ruby project files.
+main = File.basename(__FILE__, File.extname(__FILE__))
 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__)
+Dir.glob(File.join(dir_path, '*.{rb,rbo}')).map { |x| File.basename(x, File.extname(x)) }.uniq.each do |path|
+  if path != main
     require(path)
   end
 end
 
 # Starting the Cocoa main loop.
-NSApplicationMain(0, nil)
\ No newline at end of file
+NSApplicationMain(0, nil)

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 20:52:26 UTC (rev 3281)
+++ MacRuby/trunk/misc/xcode-templates/Project Templates/Application/MacRuby Core Data Application/rb_main.rb	2010-01-16 01:41:23 UTC (rev 3282)
@@ -9,15 +9,15 @@
 # Loading the Cocoa framework. If you need to load more frameworks, you can
 # do that here too.
 framework 'Cocoa'
-framework 'CoreData'
 
 # Loading all the Ruby project files.
+main = File.basename(__FILE__, File.extname(__FILE__))
 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__)
+Dir.glob(File.join(dir_path, '*.{rb,rbo}')).map { |x| File.basename(x, File.extname(x)) }.uniq.each do |path|
+  if path != main
     require(path)
   end
 end
 
 # Starting the Cocoa main loop.
-NSApplicationMain(0, nil)
\ No newline at end of file
+NSApplicationMain(0, nil)

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 20:52:26 UTC (rev 3281)
+++ MacRuby/trunk/misc/xcode-templates/Project Templates/Application/MacRuby Document-based Application/rb_main.rb	2010-01-16 01:41:23 UTC (rev 3282)
@@ -11,12 +11,13 @@
 framework 'Cocoa'
 
 # Loading all the Ruby project files.
+main = File.basename(__FILE__, File.extname(__FILE__))
 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__)
+Dir.glob(File.join(dir_path, '*.{rb,rbo}')).map { |x| File.basename(x, File.extname(x)) }.uniq.each do |path|
+  if path != main
     require(path)
   end
 end
 
 # Starting the Cocoa main loop.
-NSApplicationMain(0, nil)
\ No newline at end of file
+NSApplicationMain(0, nil)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20100115/db3200de/attachment-0001.html>


More information about the macruby-changes mailing list