Class: D13n::Configuration::YamlSource
- Inherits:
-
DottedHash
- Object
- Hash
- DottedHash
- D13n::Configuration::YamlSource
- Defined in:
- lib/d13n/configuration/yaml_source.rb
Instance Attribute Summary collapse
-
#failures ⇒ Object
Returns the value of attribute failures.
-
#file_path ⇒ Object
Returns the value of attribute file_path.
Instance Method Summary collapse
-
#initialize(path, env) ⇒ YamlSource
constructor
A new instance of YamlSource.
Methods inherited from DottedHash
Constructor Details
#initialize(path, env) ⇒ YamlSource
Returns a new instance of YamlSource.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/d13n/configuration/yaml_source.rb', line 6 def initialize(path,env) config = {} @failures = [] begin @file_path = validate_config_file(path) return unless @file_path D13n.logger.info("Reading configuration from #{path} (#{Dir.pwd})") raw_file = File.read(@file_path) erb_file = process_erb(raw_file) config = process_yaml(erb_file, env, config, @file_path) rescue ScriptError, StandardError => e log_failure("Failed to read or parse configuration file at #{path}", e) end super(config, true) end |
Instance Attribute Details
#failures ⇒ Object
Returns the value of attribute failures.
4 5 6 |
# File 'lib/d13n/configuration/yaml_source.rb', line 4 def failures @failures end |
#file_path ⇒ Object
Returns the value of attribute file_path.
4 5 6 |
# File 'lib/d13n/configuration/yaml_source.rb', line 4 def file_path @file_path end |