mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[ruby/irb] Suppress "method redefined" warning
https://github.com/ruby/irb/commit/5f0aee56fa
This commit is contained in:
parent
3864fbc6d8
commit
7e5253d15e
1 changed files with 6 additions and 3 deletions
|
@ -173,11 +173,14 @@ module IRB # :nodoc:
|
|||
args << "&block"
|
||||
args = args.join(", ")
|
||||
line = __LINE__; eval %[
|
||||
def #{cmd_name}(\#{args})
|
||||
unless self.class.class_variable_defined?(:@@#{cmd_name}_)
|
||||
self.class.class_variable_set(:@@#{cmd_name}_, true)
|
||||
def #{cmd_name}_(\#{args})
|
||||
ExtendCommand::#{cmd_class}.execute(irb_context, \#{args})
|
||||
end
|
||||
end
|
||||
], nil, __FILE__, line
|
||||
send :#{cmd_name}, *opts, &b
|
||||
send :#{cmd_name}_, *opts, &b
|
||||
end
|
||||
], nil, __FILE__, line
|
||||
else
|
||||
|
|
Loading…
Add table
Reference in a new issue