<NME> template.rb
<BEF> require 'erb'
module ReVIEW
  class Template
    TEMPLATE_DIR = File.join(File.dirname(__FILE__), "../../templates")

    def self.load(filename, mode = 1)
    def self.load(filename, mode = 1)
      self.new(filename, mode)
    end

    def self.generate(path:, binding:, mode: 1, template_dir: ReVIEW::Template::TEMPLATE_DIR)
      template_file = File.expand_path(path, template_dir)
      self.new(template_file, mode).result(binding)
    end

    def initialize(filename = nil, mode = nil)
      return unless filename

      content = File.read(filename)
      @erb = if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.6')
               ERB.new(content, trim_mode: mode)
             else
               ERB.new(content, nil, mode)
             end
    end

    def result(bind_data = nil)
      @erb.result(bind_data)
    end
  end
end

<MSG> unify template engine

HTMLBuilder: use ReVIEW::Template instead of HTMLLayout

<DFF> @@ -1,6 +1,8 @@
 require 'erb'
 module ReVIEW
   class Template
+    include ERB::Util
+
     TEMPLATE_DIR = File.join(File.dirname(__FILE__), "../../templates")
 
     def self.load(filename, mode = 1)

{'addition_count': 2, 'commit_subject': 'unify template engine', 'deletion_count': 0, 'file_extension': '.rb', 'lang': 'rb', 'license': 'lgpl-2.1', 'repo_name': 'kmuto/review'}