Learn more  » Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Bower components Debian packages RPM packages NuGet packages

vistahigherlearning / logstash   deb

Repository URL to install this package:

/ opt / logstash / vendor / bundle / jruby / 1.9 / gems / tilt-1.4.1 / lib / tilt / textile.rb

require 'tilt/template'

module Tilt
  # RedCloth implementation. See:
  # http://redcloth.org/
  class RedClothTemplate < Template
    def self.engine_initialized?
      defined? ::RedCloth
    end

    def initialize_engine
      require_template_library 'redcloth'
    end

    def prepare
      @engine = RedCloth.new(data)
      options.each {|k, v| @engine.send("#{k}=", v) if @engine.respond_to? "#{k}="}
      @output = nil
    end

    def evaluate(scope, locals, &block)
      @output ||= @engine.to_html
    end

    def allows_script?
      false
    end
  end
end