Published 3 months ago

Requiring Files

Learn about how to require files in Crystal. You'll also learn that using wildcard requires with '*' will require files in the folder alphabetically, and what issues this might cause.

https://crystal-lang.org/docs/syntax_and_semantics/requiring_files.html

Comments

megatux@gmail.com - Thanks for explaining that gotcha. So, I guess it's safer to _always_ declare required deps? maybe even with a "./models/**" search path?

paulcsmith0218@gmail.com - I'm glad that was helpful. I tend to still only require when necessary. The compiler will catch if it doesn't have access to it so it isn't safer to always declare them. With that said if you always declare them it doesn't hurt!