[macruby-changes] [4618] DietRB/trunk/lib/irb/ext/macruby.rb

source_changes at macosforge.org source_changes at macosforge.org
Fri Oct 8 03:49:27 PDT 2010


Revision: 4618
          http://trac.macosforge.org/projects/ruby/changeset/4618
Author:   eloy.de.enige at gmail.com
Date:     2010-10-08 03:49:25 -0700 (Fri, 08 Oct 2010)
Log Message:
-----------
Make the MacRuby extension work with multiple contexts too.

From: Eloy Duran <eloy.de.enige at gmail.com>

Modified Paths:
--------------
    DietRB/trunk/lib/irb/ext/macruby.rb

Modified: DietRB/trunk/lib/irb/ext/macruby.rb
===================================================================
--- DietRB/trunk/lib/irb/ext/macruby.rb	2010-10-08 10:49:17 UTC (rev 4617)
+++ DietRB/trunk/lib/irb/ext/macruby.rb	2010-10-08 10:49:25 UTC (rev 4618)
@@ -5,11 +5,15 @@
     alias_method :_run, :run
     
     def run
-      Thread.new do
+      if NSApplication.sharedApplication.running?
         _run
-        NSApplication.sharedApplication.terminate(self)
+      else
+        Thread.new do
+          _run
+          NSApplication.sharedApplication.terminate(self)
+        end
+        NSApplication.sharedApplication.run
       end
-      NSApplication.sharedApplication.run
     end
   end
 end
\ No newline at end of file
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20101008/9e517d61/attachment-0001.html>


More information about the macruby-changes mailing list