irb icon indicating copy to clipboard operation
irb copied to clipboard

Merge extensions under `EXTEND_COMMANDS` into `Context` class

Open st0012 opened this issue 2 years ago • 0 comments

There are a few features defined as extensions:

https://github.com/ruby/irb/blob/0e862c5751968c589904ed93c3d707d919390597/lib/irb/extend-command.rb#L314-L319

The intention was that those files will be lazily-loaded until the related methods are called. But if we look at context.rb, we can see that all of the methods are called in Context#initialize. So none of them are lazily loaded anymore.

Consider this lazy-loading mechanism + individual extensions' hacks to extend Context introduces unnecessary complexity to IRB (example), I think we should start merging them one by one.

st0012 avatar Apr 23 '23 14:04 st0012