[macruby-changes] [4701] DietRB/trunk/bin/dietrb

source_changes at macosforge.org source_changes at macosforge.org
Fri Oct 8 04:01:47 PDT 2010


Revision: 4701
          http://trac.macosforge.org/projects/ruby/changeset/4701
Author:   eloy.de.enige at gmail.com
Date:     2010-10-08 04:01:46 -0700 (Fri, 08 Oct 2010)
Log Message:
-----------
Add -f switch to ignore ~/.irbrc.

Tip of the hat to comboy.

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

Modified Paths:
--------------
    DietRB/trunk/bin/dietrb

Modified: DietRB/trunk/bin/dietrb
===================================================================
--- DietRB/trunk/bin/dietrb	2010-10-08 11:01:38 UTC (rev 4700)
+++ DietRB/trunk/bin/dietrb	2010-10-08 11:01:46 UTC (rev 4701)
@@ -5,9 +5,12 @@
 unless ARGV.empty?
   require 'optparse'
   
+  ignore_irbrc = false
+  
   OptionParser.new do |opt|
     bin = File.basename($0)
     opt.banner = "Usage:  #{bin} [options] [programfile] [arguments]"
+    opt.on("-f",              "Ignore ~/.irbrc") { |ignore| ignore_irbrc = ignore  }
     opt.on("-r load-lib",     "Loads the given library (same as `ruby -r')") { |lib| require lib }
     opt.on("-d",              "Set $DEBUG to true (same as `ruby -d')") { $DEBUG = true }
     opt.on("-I path",         "Add path to $LOAD_PATH") { |path| $LOAD_PATH.unshift(path) }
@@ -20,8 +23,10 @@
   end.parse!(ARGV)
 end
 
-irbrc = File.expand_path("~/.irbrc")
-load(irbrc) if File.exist?(irbrc)
+unless ignore_irbrc
+  irbrc = File.expand_path("~/.irbrc")
+  load(irbrc) if File.exist?(irbrc)
+end
 
 IRB.formatter.filter_from_backtrace << /^#{__FILE__}/
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20101008/a3ec900d/attachment-0001.html>


More information about the macruby-changes mailing list