lib/irb/extend-command.rb in irb-1.2.9 vs lib/irb/extend-command.rb in irb-1.3.0

- old
+ new

@@ -175,12 +175,12 @@ args = (1..(arity < 0 ? ~arity : arity)).map {|i| "arg" + i.to_s } args << "*opts" if arity < 0 args << "&block" args = args.join(", ") line = __LINE__; eval %[ - unless self.class.class_variable_defined?(:@@#{cmd_name}_) - self.class.class_variable_set(:@@#{cmd_name}_, true) - def #{cmd_name}_(\#{args}) + 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}) end end ], nil, __FILE__, line __send__ :#{cmd_name}_, *opts, &b