[macruby-changes] [4705] DietRB/trunk

source_changes at macosforge.org source_changes at macosforge.org
Fri Oct 8 04:02:20 PDT 2010


Revision: 4705
          http://trac.macosforge.org/projects/ruby/changeset/4705
Author:   eloy.de.enige at gmail.com
Date:     2010-10-08 04:02:18 -0700 (Fri, 08 Oct 2010)
Log Message:
-----------
Instead of seemingly breaking the users original IRB installation, make it use DietRB.

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

Modified Paths:
--------------
    DietRB/trunk/README.rdoc
    DietRB/trunk/lib/irb.rb

Modified: DietRB/trunk/README.rdoc
===================================================================
--- DietRB/trunk/README.rdoc	2010-10-08 11:02:10 UTC (rev 4704)
+++ DietRB/trunk/README.rdoc	2010-10-08 11:02:18 UTC (rev 4705)
@@ -14,13 +14,11 @@
 = Important notice
 
 Since on Ruby 1.9 *all* latest gems are pushed onto the load path by default,
-installing the DietRB gem will break the existing IRB binary.
+installing the DietRB gem would break the existing IRB binary. Therefor, with
+the DietRB gem is installed, it will hijack the `irb' bin file.
 
-  % irb19
-  /usr/local/bin/irb19:12:in `<main>': undefined method `start' for IRB:Module (NoMethodError)
+The original IRB will still work when you uninstall the DietRB gem, though.
 
-So you probably just want to alias dietrb to irb.
-
 == Extensions
 
 * irb/ext/colorize.rb, adds support for colorizing the prompt and result. The

Modified: DietRB/trunk/lib/irb.rb
===================================================================
--- DietRB/trunk/lib/irb.rb	2010-10-08 11:02:10 UTC (rev 4704)
+++ DietRB/trunk/lib/irb.rb	2010-10-08 11:02:18 UTC (rev 4705)
@@ -16,3 +16,17 @@
 if !ENV['SPECCING'] && defined?(RUBY_ENGINE) && RUBY_ENGINE == "macruby"
   require 'irb/ext/macruby'
 end
+
+module IRB
+  class << self
+    # This is just here for so the ruby 1.9 IRB will seemingly work, but actually
+    # loads DietRB, how cunning...
+    #
+    # This will obviously be removed once we've conquered the world.
+    def start(*)
+      warn "[!] Note that you are now actually using DietRB (#{IRB::VERSION::STRING})\n"
+      load File.expand_path('../../bin/dietrb', __FILE__)
+    end
+    alias_method :setup, :start
+  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/8c25ea61/attachment.html>


More information about the macruby-changes mailing list