lib/template.rb in narou-3.2.5.1 vs lib/template.rb in narou-3.3.0

- old
+ new

@@ -1,6 +1,7 @@ -# -*- coding: utf-8 -*- +# frozen_string_literal: true + # # Copyright 2013 whiteleaf. All rights reserved. # require "erb" @@ -43,12 +44,12 @@ # 2. script_dir/template # def self.get(src_filename, _binding, binary_version) @@binary_version = binary_version @@src_filename = src_filename - [Narou.get_root_dir, Narou.get_script_dir].each do |dir| - path = File.join(dir, TEMPLATE_DIR, src_filename + ".erb") - next unless File.exist?(path) + [Narou.root_dir, Narou.script_dir].each do |dir| + path = dir.join(TEMPLATE_DIR, src_filename + ".erb") + next unless path.exist? src = Helper::CacheLoader.load(path) result = ERB.new(src, nil, "-").result(_binding) return result end raise LoadError, "テンプレートファイルが見つかりません。(#{src_filename}.erb)"