Yep, as 姜军 said — at the point in time where Rails tries to load all
available commands (in boot.rb) the {project_root}/lib directory isn't
included in $LOAD_PATH yet.

I can confirm that after the app boots, the lib folder is indeed in the
$LOAD_PATH. That definitely means lib/commands and lib/rails_commands are
indeed the correct place to put the commands.

In that case, do you think it'd be ok for me to submit a patch to add
{project_root}/lib to $LOAD_PATH before the command lookup happens?

After that, Kasper, I'll dig through the history (Basecamp, GitHub, etc) to
see where you left them off, figuring out what's missing for it to be a
full-fledged Rails feature, and give it another shot?

-Prem


On Wed, Jan 15, 2020 at 7:42 AM Xavier Noria <f...@hashref.com> wrote:

> Ah, I see now what is the point, commands are able to boot the application
> (eg, runner), but the lookup happens before.
>
> I would not recommend app for that, because by default any subdirectory of
> app is in the autoload paths and eager loaded if eager loading is enabled.
>
> Xavier
>
> PS: BTW, Zeitwerk has nothing to do with $LOAD_PATH, the variable is
> modified by railties code as part of the boot process.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Core" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to rubyonrails-core+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rubyonrails-core/CAM%3DYcdike7D%2BrMR-tUKvZwU4Op3RGn6sAa%2BaQibic2NxSoru3w%40mail.gmail.com
> <https://groups.google.com/d/msgid/rubyonrails-core/CAM%3DYcdike7D%2BrMR-tUKvZwU4Op3RGn6sAa%2BaQibic2NxSoru3w%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-core/CAG_6CsPrsaOshfz38-qTMhnY14Lc8doUg0VUP6TOQdWeNmPWHQ%40mail.gmail.com.

Reply via email to