Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Get rid of MacRuby Cocoa dev hack

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

git-svn-id: http://svn.macosforge.org/repository/ruby/DietRB/trunk@4752 23306eb0-4c56-4727-a40e-e92c0eb68959
  • Loading branch information...
commit 62850f4e7869fa2d75c39a36b70f1d071867c50f 1 parent ffd1f33
Eloy Durán authored
34  README.rdoc
Source Rendered
@@ -49,16 +49,8 @@ The original IRB will still work when you uninstall the DietRB gem, though.
49 49
   
50 50
   * Kernel#clear_history! will clear the history and the history file.
51 51
 
52  
-* irb/ext/macruby.rb, adds support for Cocoa development by starting an
53  
-  NSRunloop. Loaded by default on MacRuby.
54  
-
55 52
 == Differences
56 53
 
57  
-* This IRB version specifically targets MacRuby, for now, and allows Cocoa
58  
-  development to be done from the command-line. Dietrb will automatically
59  
-  override the normal runloop to be ran in a thread and start a NSRunLoop on
60  
-  the main thread.
61  
-
62 54
 * Dietrb will try to warn about syntax errors as soon as a line is entered and
63 55
   only reset the buffer to the previous line. This means that you don't need to
64 56
   loose any previous work:
@@ -112,29 +104,3 @@ Normal usage:
112 104
   irb(#<#<Class:…>::A:…>):002:0> quit
113 105
   => nil
114 106
   irb(main):007:0> quit
115  
-
116  
-Or on MacRuby, try:
117  
-
118  
-  irb(main):001:0> win = NSWindow.alloc.initWithContentRect([200, 300, 250, 100],
119  
-  irb(main):002:0>                                styleMask: NSTitledWindowMask|NSResizableWindowMask,
120  
-  irb(main):003:0>                                  backing: NSBackingStoreBuffered,
121  
-  irb(main):004:0>                                    defer: false)
122  
-  => #<NSWindow:0x20023eb00>
123  
-  irb(main):005:0> win.orderFrontRegardless
124  
-  => #<NSWindow:0x20023eb00>
125  
-  irb(main):006:0> win.title = 'Hello World'
126  
-  => "Hello World"
127  
-  irb(main):007:0> bye = NSButton.alloc.initWithFrame([10, 10, 80, 80])
128  
-  => #<NSButton:0x20027f820>
129  
-  irb(main):008:0> win.contentView.addSubview(bye)
130  
-  => #<NSView:0x200210320>
131  
-  irb(main):009:0> bye.bezelStyle = NSThickerSquareBezelStyle
132  
-  => 4
133  
-  irb(main):010:0> bye.title = 'Goodbye!'
134  
-  => "Goodbye!"
135  
-  irb(main):011:0> bye.target = NSApp
136  
-  => #<NSApplication:0x200257fe0>
137  
-  irb(main):012:0> bye.action = 'terminate:'
138  
-  => "terminate:"
139  
-  irb(main):013:0> bye.sound = NSSound.soundNamed('Basso')
140  
-  => #<NSSound:0x200248b20>
4  lib/irb.rb
@@ -10,10 +10,6 @@
10 10
 
11 11
 require 'irb/deprecated'
12 12
 
13  
-# if !ENV['SPECCING'] && defined?(RUBY_ENGINE) && RUBY_ENGINE == "macruby"
14  
-#   require 'irb/ext/macruby'
15  
-# end
16  
-
17 13
 module IRB
18 14
   class << self
19 15
     # This is just here for so the ruby 1.9 IRB will seemingly work, but actually
25  lib/irb/ext/macruby.rb
... ...
@@ -1,25 +0,0 @@
1  
-# MacRuby implementation of IRB.
2  
-#
3  
-# This file is covered by the Ruby license. See COPYING for more details.
4  
-# 
5  
-# Copyright (C) 2009-2010, Eloy Duran <eloy.de.enige@gmail.com>
6  
-
7  
-framework 'AppKit'
8  
-
9  
-module IRB
10  
-  class Context
11  
-    alias_method :_run, :run
12  
-    
13  
-    def run
14  
-      if NSApplication.sharedApplication.running?
15  
-        _run
16  
-      else
17  
-        Thread.new do
18  
-          _run
19  
-          NSApplication.sharedApplication.terminate(self)
20  
-        end
21  
-        NSApplication.sharedApplication.run
22  
-      end
23  
-    end
24  
-  end
25  
-end

0 notes on commit 62850f4

Please sign in to comment.
Something went wrong with that request. Please try again.