To ensure it's available for all initialisers, you can require the file within config/application.rb
by adding require_relative "settings"
as the last line within the Application class definition.
The defined settings will be available via the Settings constant: e.g. Settings.default_host
- Does not pay attention to
Rails.configuration
/Rails.application.credentials
- it's expecting all secrets as ENV variables. - Requires dry-types and dry-system gems.
- Allows for typed values (even if the above examples are all strings 😅).
- Allows for optional values and defaults.
- Inspired by Hanami's approach to such things.