Sha256: 849396b651e61a2a3feab15f1615dda6389a6f4cd414787b13183614c346564c

Contents?: true

Size: 491 Bytes

Versions: 4

Compression:

Stored size: 491 Bytes

Contents

require 'erb'
require 'review/extentions'
module ReVIEW
  class Template
    include ERB::Util

    TEMPLATE_DIR = File.join(File.dirname(__FILE__), "../../templates")

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

    def initialize(filename = nil, mode = nil)
      if filename
        content = File.read(filename)
        @erb = ERB.new(content, nil, mode)
      end
    end

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
review-2.3.0 lib/review/template.rb
review-2.2.0 lib/review/template.rb
review-2.1.0 lib/review/template.rb
review-2.0.0 lib/review/template.rb