summaryrefslogtreecommitdiff
path: root/lib/hashie/extensions/parsers/yaml_erb_parser.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/hashie/extensions/parsers/yaml_erb_parser.rb')
-rw-r--r--lib/hashie/extensions/parsers/yaml_erb_parser.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/hashie/extensions/parsers/yaml_erb_parser.rb b/lib/hashie/extensions/parsers/yaml_erb_parser.rb
index 7b6a5c4..d0b1cb0 100644
--- a/lib/hashie/extensions/parsers/yaml_erb_parser.rb
+++ b/lib/hashie/extensions/parsers/yaml_erb_parser.rb
@@ -6,10 +6,13 @@ module Hashie
class YamlErbParser
def initialize(file_path)
@content = File.read(file_path)
+ @file_path = file_path
end
def perform
- YAML.load ERB.new(@content).result
+ template = ERB.new(@content)
+ template.filename = @file_path
+ YAML.load template.result
end
def self.perform(file_path)