Class: ConfigLoader::Base
- Inherits:
-
Object
- Object
- ConfigLoader::Base
- Defined in:
- lib/config_loader/base.rb
Overview
Inherit from ConfigLoader base to automatically load one or more yaml files into a @config hash. Config folders are found in config/ and each loader should specify its own subfolder by setting the config_folder class attribute.
Direct Known Subclasses
ExportsLoader, PipelinesLoader, PoolingsLoader, PurposesLoader
Constant Summary collapse
- BASE_CONFIG_PATH =
%w[config].freeze
- EXTENSION =
'.yml'
- WIP_EXTENSION =
'.wip.yml'
Instance Method Summary collapse
-
#initialize(files: nil, directory: default_path) ⇒ Base
constructor
Create a new config loader from yaml files.
Constructor Details
#initialize(files: nil, directory: default_path) ⇒ Base
Create a new config loader from yaml files
23 24 25 26 27 28 |
# File 'lib/config_loader/base.rb', line 23 def initialize(files: nil, directory: default_path) path = directory.is_a?(Pathname) ? directory : Pathname.new(directory) @files = path.children.select { |child| should_include_file?(files, child) } load_config end |