Class: Anyway::Loaders::YAML
Direct Known Subclasses
Instance Method Summary collapse
Methods inherited from Base
call, #initialize, #use_local?
Methods included from Tracing
capture, current_trace, current_trace_source, source_stack, trace!, trace_stack, with_trace_source
Constructor Details
This class inherits a constructor from Anyway::Loaders::Base
Instance Method Details
#call(config_path:, **_options) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/anyway/loaders/yaml.rb', line 12 def call(config_path:, **) rel_config_path = relative_config_path(config_path).to_s base_config = trace!(:yml, path: rel_config_path) do config = load_base_yml(config_path) environmental?(config) ? config_with_env(config) : config end return base_config unless use_local? local_path = local_config_path(config_path) local_config = trace!(:yml, path: relative_config_path(local_path).to_s) { load_local_yml(local_path) } Utils.deep_merge!(base_config, local_config) end |