lib/phobos.rb in phobos-1.2.1 vs lib/phobos.rb in phobos-1.3.0

- old
+ new

@@ -27,10 +27,10 @@ attr_reader :config, :logger attr_accessor :silence_log def configure(yml_path) ENV['RAILS_ENV'] = ENV['RACK_ENV'] ||= 'development' - @config = DeepStruct.new(YAML.load_file(File.expand_path(yml_path))) + @config = DeepStruct.new(YAML.load(ERB.new(File.read(File.expand_path(yml_path))).result)) @config.class.send(:define_method, :producer_hash) { Phobos.config.producer&.to_hash } @config.class.send(:define_method, :consumer_hash) { Phobos.config.consumer&.to_hash } configure_logger logger.info { Hash(message: 'Phobos configured', env: ENV['RACK_ENV']) } end