lib/irb/extend-command.rb in irb-1.6.2 vs lib/irb/extend-command.rb in irb-1.6.3

- old
+ new

@@ -1,16 +1,11 @@ # frozen_string_literal: false # # irb/extend-command.rb - irb extend command -# $Release Version: 0.9.6$ -# $Revision$ # by Keiju ISHITSUKA(keiju@ruby-lang.org) # -# -- -# -# -# + module IRB # :nodoc: # Installs the default irb extensions command bundle. module ExtendCommandBundle EXCB = ExtendCommandBundle # :nodoc: @@ -262,30 +257,30 @@ if load_file kwargs = ", **kwargs" if RUBY_ENGINE == "ruby" && RUBY_VERSION >= "2.7.0" line = __LINE__; eval %[ def #{cmd_name}(*opts#{kwargs}, &b) - require_relative "#{load_file}" - arity = ExtendCommand::#{cmd_class}.instance_method(:execute).arity + Kernel.require_relative "#{load_file}" + arity = ::IRB::ExtendCommand::#{cmd_class}.instance_method(:execute).arity args = (1..(arity < 0 ? ~arity : arity)).map {|i| "arg" + i.to_s } args << "*opts#{kwargs}" if arity < 0 args << "&block" args = args.join(", ") line = __LINE__; eval %[ unless singleton_class.class_variable_defined?(:@@#{cmd_name}_) singleton_class.class_variable_set(:@@#{cmd_name}_, true) def self.#{cmd_name}_(\#{args}) - ExtendCommand::#{cmd_class}.execute(irb_context, \#{args}) + ::IRB::ExtendCommand::#{cmd_class}.execute(irb_context, \#{args}) end end ], nil, __FILE__, line __send__ :#{cmd_name}_, *opts#{kwargs}, &b end ], nil, __FILE__, line else line = __LINE__; eval %[ def #{cmd_name}(*opts, &b) - ExtendCommand::#{cmd_class}.execute(irb_context, *opts, &b) + ::IRB::ExtendCommand::#{cmd_class}.execute(irb_context, *opts, &b) end ], nil, __FILE__, line end for ali, flag in aliases