Sha256: 67f8ebdf49ec226821587fc45270cb21a1c2207d129206894e903e55b1cbb972

Contents?: true

Size: 701 Bytes

Versions: 4

Compression:

Stored size: 701 Bytes

Contents

require 'tilt'

module Temple
  module Templates
    class Tilt < ::Tilt::Template
      extend Mixins::Template

      # Prepare Temple template
      #
      # Called immediately after template data is loaded.
      #
      # @return [void]
      def prepare
        @src = self.class.build_engine({ :file => eval_file }, options).call(data)
      end

      # A string containing the (Ruby) source code for the template.
      #
      # @param [Hash]   locals Local variables
      # @return [String] Compiled template ruby code
      def precompiled_template(locals = {})
        @src
      end

      def self.register_as(name)
        ::Tilt.register name.to_s, self
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
temple-0.3.2 lib/temple/templates/tilt.rb
temple-0.3.1 lib/temple/templates/tilt.rb
temple-0.3.0 lib/temple/templates/tilt.rb
temple-0.2.0 lib/temple/templates/tilt.rb