Module: IRB::ContextExtender
- Defined in:
- lib/irb/extend-command.rb
Overview
extension support for Context
Constant Summary collapse
- CE =
ContextExtender
Class Method Summary collapse
Class Method Details
.def_extend_command(cmd_name, load_file, *aliases) ⇒ Object
209 210 211 212 213 214 215 216 217 218 219 220 |
# File 'lib/irb/extend-command.rb', line 209 def self.def_extend_command(cmd_name, load_file, *aliases) line = __LINE__; Context.module_eval %[ def #{cmd_name}(*opts, &b) Context.module_eval {remove_method(:#{cmd_name})} require "#{load_file}" send :#{cmd_name}, *opts, &b end for ali in aliases alias_method ali, cmd_name end ], __FILE__, line end |
.install_extend_commands ⇒ Object
203 204 205 206 207 |
# File 'lib/irb/extend-command.rb', line 203 def self.install_extend_commands for args in @EXTEND_COMMANDS def_extend_command(*args) end end |