Skip to content

Commit 541aedf

Browse files
authored
Merge pull request #618 from danmayer/optimize-html-formatter-caching-14436881986665655346
⚡ Optimize HTMLFormatter with template caching
2 parents 7ab9822 + cc5e8cb commit 541aedf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/coverband/utils/html_formatter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def format_data(result)
7878

7979
# Returns the an erb instance for the template of given name
8080
def template(name)
81-
TEMPLATE_CACHE[name] ||= ERB.new(File.read(File.join(File.dirname(__FILE__), "../../../views/", "#{name}.erb")))
81+
TEMPLATE_CACHE[name] ||= ERB.new(File.read(File.expand_path("../../../views/#{name}.erb", __dir__)))
8282
end
8383

8484
def output_path

0 commit comments

Comments
 (0)