Class: Configurate::Provider::YAML
- Inherits:
-
StringHash
- Object
- Base
- StringHash
- Configurate::Provider::YAML
- Defined in:
- lib/configurate/provider/yaml.rb
Overview
This provider tries to open a YAML file and does nested lookups in it.
Instance Method Summary collapse
-
#initialize(file, namespace: nil, required: true, raise_on_missing: false) ⇒ YAML
constructor
A new instance of YAML.
Methods inherited from StringHash
Methods inherited from Base
Constructor Details
#initialize(file, namespace: nil, required: true, raise_on_missing: false) ⇒ YAML
Returns a new instance of YAML.
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/configurate/provider/yaml.rb', line 18 def initialize file, namespace: nil, required: true, raise_on_missing: false super(::YAML.load_file(file), namespace: namespace, required: required, raise_on_missing: raise_on_missing, source: file ) rescue Errno::ENOENT => e warn "WARNING: Configuration file #{file} not found, ensure it's present" raise e if required end |