After https://github.com/rails/rails/pull/51705, the current way to add commands to the console will no longer work as Rails::ConsoleMethods will not be directly included to the IRB internal anymore.
So this commit uses the new IRB extension API to add commands instead, which would also bring a few benefits:
Commands can be displayed in IRB's help message to make them easier to discover.
The parameter of connect_to doesn't need to be a string anymore as registered commands aren't treated as Ruby methods. So this now works too:
irb(main):002> connect_to hey:resque
Connected to hey:resque
=> nil
After https://github.com/rails/rails/pull/51705, the current way to add commands to the console will no longer work as
Rails::ConsoleMethods
will not be directly included to the IRB internal anymore.So this commit uses the new IRB extension API to add commands instead, which would also bring a few benefits:
Commands can be displayed in IRB's help message to make them easier to discover.
The parameter of
connect_to
doesn't need to be a string anymore as registered commands aren't treated as Ruby methods. So this now works too: