Sha256: 4c3148c04f883a3482bb8a5590768938217f22d425ae60d92e1daf78daf6bed8

Contents?: true

Size: 488 Bytes

Versions: 14

Compression:

Stored size: 488 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)
      return unless filename
      content = File.read(filename)
      @erb = ERB.new(content, nil, mode)
    end

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

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
review-5.0.0 lib/review/template.rb
review-4.2.0 lib/review/template.rb
review-4.1.0 lib/review/template.rb
review-4.0.0 lib/review/template.rb
review-3.2.0 lib/review/template.rb
review-3.1.0 lib/review/template.rb
review-3.0.0 lib/review/template.rb
review-3.0.0.rc1 lib/review/template.rb
review-3.0.0.preview4 lib/review/template.rb
review-3.0.0.preview3 lib/review/template.rb
review-3.0.0.preview2 lib/review/template.rb
review-3.0.0.preview1 lib/review/template.rb
review-2.5.0 lib/review/template.rb
review-2.4.0 lib/review/template.rb