lib/dossier/configuration.rb in dossier-2.9.2 vs lib/dossier/configuration.rb in dossier-2.9.3
- old
+ new
@@ -1,5 +1,6 @@
+require 'erb'
require 'yaml'
module Dossier
class Configuration
@@ -11,10 +12,10 @@
end
private
def setup_client!
- @connection_options = YAML.load_file(@config_path)[Rails.env].symbolize_keys
+ @connection_options = YAML.load(ERB.new(File.read(@config_path)).result)[Rails.env].symbolize_keys
@client = Dossier::Client.new(@connection_options)
rescue Errno::ENOENT => e
raise ConfigurationMissingError.new(
"#{e.message}. #{@config_path} must exist for Dossier to connect to the database."