3 # $Release Version: 0.9.5$
5 # $Date: 2007-02-12 15:01:19 -0800 (Mon, 12 Feb 2007) $
6 # by Keiju ISHITSUKA(keiju@ruby-lang.org)
13 require "irb/cmd/load"
14 require "irb/ext/loader"
17 alias __original__load__IRB_use_loader__ load
18 alias __original__require__IRB_use_loader__ require
22 module ExtendCommandBundle
23 def irb_load(*opts, &b)
24 ExtendCommand::Load.execute(irb_context, *opts, &b)
26 def irb_require(*opts, &b)
27 ExtendCommand::Require.execute(irb_context, *opts, &b)
33 IRB.conf[:USE_LOADER] = false
39 alias use_loader? use_loader
43 if IRB.conf[:USE_LOADER] != opt
44 IRB.conf[:USE_LOADER] = opt
46 if !$".include?("irb/cmd/load")
48 (class<<@workspace.main;self;end).instance_eval {
49 alias_method :load, :irb_load
50 alias_method :require, :irb_require
53 (class<<@workspace.main;self;end).instance_eval {
54 alias_method :load, :__original__load__IRB_use_loader__
55 alias_method :require, :__original__require__IRB_use_loader__
59 print "Switch to load/require#{unless use_loader; ' non';end} trace mode.\n" if verbose?