mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/irb/extend-command.rb (IRB::ExtendCommandBundle): pacify
RDoc. a patch from Eric Hodel <drbrain at segment7.net>. [ruby-core:08522] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10707 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8adcd1d2b8
commit
7e5324e6c1
2 changed files with 11 additions and 5 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
Tue Aug 8 23:49:06 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* lib/irb/extend-command.rb (IRB::ExtendCommandBundle): pacify
|
||||||
|
RDoc. a patch from Eric Hodel <drbrain at segment7.net>.
|
||||||
|
[ruby-core:08522]
|
||||||
|
|
||||||
Tue Aug 8 19:26:10 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
|
Tue Aug 8 19:26:10 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* lib/resolv.rb (Resolv::DNS::Message::MessageDecoder::get_string):
|
* lib/resolv.rb (Resolv::DNS::Message::MessageDecoder::get_string):
|
||||||
|
|
|
@ -106,14 +106,14 @@ module IRB
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
def EXCB.install_extend_commands
|
def self.install_extend_commands
|
||||||
for args in @EXTEND_COMMANDS
|
for args in @EXTEND_COMMANDS
|
||||||
def_extend_command(*args)
|
def_extend_command(*args)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# aliases = [commans_alias, flag], ...
|
# aliases = [commans_alias, flag], ...
|
||||||
def EXCB.def_extend_command(cmd_name, cmd_class, load_file = nil, *aliases)
|
def self.def_extend_command(cmd_name, cmd_class, load_file = nil, *aliases)
|
||||||
case cmd_class
|
case cmd_class
|
||||||
when Symbol
|
when Symbol
|
||||||
cmd_class = cmd_class.id2name
|
cmd_class = cmd_class.id2name
|
||||||
|
@ -172,7 +172,7 @@ module IRB
|
||||||
"irb_" + method_name + "_org"
|
"irb_" + method_name + "_org"
|
||||||
end
|
end
|
||||||
|
|
||||||
def EXCB.extend_object(obj)
|
def self.extend_object(obj)
|
||||||
unless (class<<obj;ancestors;end).include?(EXCB)
|
unless (class<<obj;ancestors;end).include?(EXCB)
|
||||||
super
|
super
|
||||||
for ali, com, flg in @ALIASES
|
for ali, com, flg in @ALIASES
|
||||||
|
@ -196,13 +196,13 @@ module IRB
|
||||||
[:save_history=, "irb/ext/save-history.rb"],
|
[:save_history=, "irb/ext/save-history.rb"],
|
||||||
]
|
]
|
||||||
|
|
||||||
def CE.install_extend_commands
|
def self.install_extend_commands
|
||||||
for args in @EXTEND_COMMANDS
|
for args in @EXTEND_COMMANDS
|
||||||
def_extend_command(*args)
|
def_extend_command(*args)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def CE.def_extend_command(cmd_name, load_file, *aliases)
|
def self.def_extend_command(cmd_name, load_file, *aliases)
|
||||||
Context.module_eval %[
|
Context.module_eval %[
|
||||||
def #{cmd_name}(*opts, &b)
|
def #{cmd_name}(*opts, &b)
|
||||||
Context.module_eval {remove_method(:#{cmd_name})}
|
Context.module_eval {remove_method(:#{cmd_name})}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue