Skip to content

Commit 8a13b6a

Browse files
committed
Associate file with erb
1 parent 942bbfe commit 8a13b6a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/thor/actions/file_manipulation.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,9 @@ def template(source, *args, &block)
113113
context = instance_eval("binding")
114114

115115
create_file destination, nil, config do
116-
content = ERB.new(::File.binread(source), nil, "-", "@output_buffer").result(context)
116+
content = ERB.new(::File.binread(source), nil, "-", "@output_buffer").tap do | erb |
117+
erb.filename = source
118+
end.result(context)
117119
content = block.call(content) if block
118120
content
119121
end

0 commit comments

Comments
 (0)