Q:

Robe mode: how to automatically require all submodules of the project?

After some fight, I was able to get some code completion and navigation from robe. Specifically, in the *pry* buffer I modified $LOAD_PATH to point at my project's source directories. However, now in order to get code navigation and completion for submodules I need to require all of them one by one... this seems very strange and, I hope, shouldn't be necessary...
So, what is the right way to make robe automatically discover all the submodules of my project?

A:

That depends on what kind of project you're working on.
If it's a gem, it most likely require-s all modules in the top-level file (the one under lib). M-x inf-ruby-console-gem will load it and in turn, all modules.
If it's a Rails project, M-x inf-ruby-console-rails will load Rails console. Most modules use autoloads, but C-x C-k should load them all using ActionDispatch::Reloader. That's not a sure thing, though, if you have code outside of autoload_paths.
If it's some other kind of project, it should have a script that launches a console with all dependencies loaded (like bin/console). If it doesn't you should create one. M-x inf-ruby-console-script will launch it.
And, to be clear, M-x inf-ruby-console-auto should dispatch to the most appropriate of these commands.

