Sha256: 16a37b96512b10b30f188a784955fd1ab23affec096de6ac833e0cae8d8fc39d

Contents?: true

Size: 499 Bytes

Versions: 3

Compression:

Stored size: 499 Bytes

Contents

require 'malt/engines/abstract'

module Malt::Engine

  # Ruby as a template engine.
  #
  #   http://
  #
  class Ruby < Abstract

    default :rb

    #
    def render(params={}, &yld)
      text = params[:text]
      file = params[:file]
      data = params[:data]
      data = make_binding(data, &yld)
      eval(text, data, file)
    end

    # Ruby compiles to Ruby. How odd. ;)
    def compile(text, file)
      text
    end

    private

    #
    def initialize_engine
    end

  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
malt-0.3.0 lib/malt/engines/ruby.rb
malt-0.2.0 lib/malt/engines/ruby.rb
malt-0.1.1 lib/malt/engines/ruby.rb