class CrConfig::Providers::FolderProfileConfigProvider
- CrConfig::Providers::FolderProfileConfigProvider
- CrConfig::Providers::AbstractProvider
- Reference
- Object
Overview
Will load different configuration files in a tree of folders based on configuration profile settings
Provider that will visit all folders directly under a root folder, and attempt to load config files in those folders using a ProfileFileConfigProvider to select which config files to load.
Assume a folder structure like: root_config ├── database │ ├── config.local.yml │ ├── config.test.yml │ └── config.yml ├── misc │ ├── config.test.yml │ └── config.yml └── server ├── config.local.yml └── config.yml
Then
FolderProfileConfigProvider.new
.folder("root_config")
.base_file("config.yml")
.profiles { ["test"] }
Will read configuration files in this order: root_config/database/config.yml root_config/database/config.test.yml root_config/misc/config.yml root_config/misc/config.test.yml root_config/server/config.yml
Defined in:
cr-config/abstract_provider.crInstance Method Summary
-
#base_file(base_file : String)
Base name for the configuration files
- #folder(folder_path : String)
-
#populate(builder : AbstractBuilder)
This method gets called with the instance of the configuration builder during config building.
-
#profiles(&block : -> Array(String))
Block to be run when determining which "profiles" to load
-
#separator(profile_separator : String)
Seperator to use when constructing the different profile versions of the config file.
Instance methods inherited from class CrConfig::Providers::AbstractProvider
populate(builder : AbstractBuilder)
populate
Instance Method Detail
This method gets called with the instance of the configuration builder during config building.
Use this method to populate the builder with any configuration name / values that this provider... provides