Sha256: 8f899e7c3a6d315b07b1fd204ba3d72d09f17a741e0c0f2e665d43b04232b96b

Contents?: true

Size: 440 Bytes

Versions: 10

Compression:

Stored size: 440 Bytes

Contents

require 'erb'
module ReVIEW
  class Template
    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

10 entries across 10 versions & 2 rubygems

Version Path
review-1.7.2 lib/review/template.rb
review-1.7.1 lib/review/template.rb
review-peg-0.2.2 lib/review/template.rb
review-peg-0.2.1 lib/review/template.rb
review-peg-0.2.0 lib/review/template.rb
review-peg-0.1.3 lib/review/template.rb
review-peg-0.1.2 lib/review/template.rb
review-peg-0.1.1 lib/review/template.rb
review-peg-0.1.0 lib/review/template.rb
review-1.7.0 lib/review/template.rb