-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lazily load the multi-irb extension #472
Conversation
d1af591
to
c79147c
Compare
1503c81
to
3fc0fe8
Compare
We now have plan to implement a command that prints all commands' information, which will need to load all command files without actually running them. But because the `multi-irb` extension patches IRB's top-level methods, loading it would cause unintentional side-effects. So this commit moves related requires into command execution to avoid the problem.
3fc0fe8
to
b001cb4
Compare
class MultiIRBCommand < Nop | ||
def initialize(conf) | ||
super | ||
extend_irb_context |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is cleaner, wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✨
(ruby/irb#472) * Lazily load the multi-irb extension We now have plan to implement a command that prints all commands' information, which will need to load all command files without actually running them. But because the `multi-irb` extension patches IRB's top-level methods, loading it would cause unintentional side-effects. So this commit moves related requires into command execution to avoid the problem. * Make extend_irb_context private Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
We now have plan to implement a command that prints all commands'
information, which will need to load all commands files without actually
running them.
But because the
multi-irb
extension patches IRB's top-level methods,loading it would cause unintentional side-effects.
So this commit moves related requires into command execution to avoid the problem.