Re: [Rails-core] [Proposal] Add additional in-project directory to load custom Rails Command within the app

2020-01-14 Thread Xavier Noria
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 h

Re: [Rails-core] [Proposal] Add additional in-project directory to load custom Rails Command within the app

2020-01-14 Thread 姜军
Nope, because code loader (Zeitwerk) isn't setup on Rails commands, it's only load `config/boot.rb` (see https://github.com/rails/rails/blob/master/railties/lib/rails/generators/rails/app/templates/bin/rails.tt#L2 ), and the `boot.rb` only load gems and Bootsnap (see https://github.com/rails/rai

Re: [Rails-core] [Proposal] Add additional in-project directory to load custom Rails Command within the app

2020-01-14 Thread Xavier Noria
Hey Prem! The lib directory is indeed in $LOAD_PATH, maybe your app does not have it for some reason? -- 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 ruby

Re: [Rails-core] [Proposal] Add additional in-project directory to load custom Rails Command within the app

2020-01-14 Thread Kasper Timm Hansen
Hey Prem, The Rails command infrastructure is still private and I don’t like the current internal API that much. Don’t feel good exposing that. There’s also no way to mark command dependencies yet. Now I did write the initial infrastructure 3-4 years ago for Rails 5.0, so it’s been some time c