Skip to content
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

Any paths inside a pack which contain app are added to autoload paths #21

Open
stevegeek opened this issue Feb 13, 2024 · 1 comment
Open

Comments

@stevegeek
Copy link

Hey all! Love the idea of this gem.

Ive been trying it out but it seems like any pack which uses automatic_pack_namespace will add any paths containing app/ in them to autoload, due to the glob https://github.com/gap777/automatic_namespaces/blob/main/lib/automatic_namespaces/autoloader.rb#L26

Just wondering if this is intentional?

A typical pack setup might include a test/ or spec/ directory which then might contain a app directory nested under it, eg test/app/models/foo_test.rb (since the test file is likely to start with require 'test_helper' this will then blow up at eager load time for example).

I assume the work around is to use the directory exclusions but it seems like the glob is pulling in too much.

Thanks for any thoughts!

@gap777
Copy link
Owner

gap777 commented Nov 13, 2024

@stevegeek If you want to tighten up the glob pattern, I'm not opposed to a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants