Sha256: 4e25f0014320a483532ba22acc83584e5886c1040f0321a902bf96b2a2922351

Contents?: true

Size: 812 Bytes

Versions: 49

Compression:

Stored size: 812 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({ :streaming => false, # Overwrite option: No streaming support in Tilt
                                         :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

49 entries across 49 versions & 2 rubygems

Version Path
classiccms-0.3.4 vendor/bundle/gems/temple-0.4.0/lib/temple/templates/tilt.rb
classiccms-0.3.3 vendor/bundle/gems/temple-0.4.0/lib/temple/templates/tilt.rb
classiccms-0.3.2 vendor/bundle/gems/temple-0.4.0/lib/temple/templates/tilt.rb
classiccms-0.3.1 vendor/bundle/gems/temple-0.4.0/lib/temple/templates/tilt.rb
classiccms-0.3.0 vendor/bundle/gems/temple-0.4.0/lib/temple/templates/tilt.rb
classiccms-0.2.4.pre vendor/bundle/gems/temple-0.4.0/lib/temple/templates/tilt.rb
temple-0.4.0 lib/temple/templates/tilt.rb
temple-0.3.5 lib/temple/templates/tilt.rb
temple-0.3.4 lib/temple/templates/tilt.rb