3 ms·
> The benefit of lib/ is clearer in my opinion. Files that live there are only explicitly loaded. Some might be loaded in development, some in production, some
by nightpool 3y ago
> The benefit of lib/ is clearer in my opinion. Files that live there are only explicitly loaded. Some might be loaded in development, some in production, some in test.
This sounds like such a recipe for confusion... why not just have a lib_dev for the very very rare case that something in lib/ isn't appropriate outside of a dev environment? Any RSpec already has spec/support for the test environment side. Saying that everything in lib/ has to be special and unique just because <10% of are dev-only makes zero sense to me. 90% of the lib code I've ever used/written is used in models, controllers, etc and it would make no sense to need to require it everywhere you use it when no other code in Rails works that way.