class Tilt::RadiusTemplate

Radius Template github.com/jlong/radius/

Public Instance Methods

evaluate(scope, locals, &block) click to toggle source
# File lib/tilt.rb, line 804
def evaluate(scope, locals, &block)
  context = Class.new(Radius::Context).new
  context.define_tag("yield") do
    block.call
  end
  locals.each do |tag, value|
    context.define_tag(tag) do
      value
    end
  end
  (class << context; self; end).class_eval do
    define_method :tag_missing do |tag, attr|
      scope.__send__(tag)  # any way to support attr as args?
    end
  end
  options = {:tag_prefix => 'r'}.merge(@options)
  parser = Radius::Parser.new(context, options)
  parser.parse(data)
end
initialize_engine() click to toggle source
# File lib/tilt.rb, line 796
def initialize_engine
  return if defined? ::Radius
  require_template_library 'radius'
end
prepare() click to toggle source
# File lib/tilt.rb, line 801
def prepare
end