Class: Configurate::Provider::TOML
- Inherits:
-
StringHash
- Object
- Base
- StringHash
- Configurate::Provider::TOML
- Defined in:
- lib/configurate/provider/toml.rb
Overview
This provider tries to open a TOML file and does nested lookups in it.
Instance Method Summary collapse
-
#initialize(file, namespace: nil, required: true, raise_on_missing: false) ⇒ TOML
constructor
A new instance of TOML.
Methods inherited from StringHash
Methods inherited from Base
Constructor Details
#initialize(file, namespace: nil, required: true, raise_on_missing: false) ⇒ TOML
Returns a new instance of TOML.
26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/configurate/provider/toml.rb', line 26 def initialize file, namespace: nil, required: true, raise_on_missing: false super(PARSER.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 |