lib/text_filters.rb
# Use this to create and register your TextFilters
Use this to create and register your TextFilters
Use this to create and register your TextFilters
def define(name, title, &block)
      begin
        p = new(name, title)
        p.instance_eval(&block)
        if p.respond_to? :render_text
          registered_titles[title] = name
          registered_filters[name] = p
        else
          raise "#render_text isn't implemented in this class"
        end
      rescue LoadError
        TextFilters.logger.debug "Filter '#{name}' was not included: #{$!}" unless TextFilters.logger.nil?
      rescue
        TextFilters.logger.debug "Filter '#{name}' was not included: #{$!}" unless TextFilters.logger.nil?
      end
    end
def define ( name , title , & block ) begin p = new ( name , title ) p . instance_eval ( & block ) if p . respond_to? :render_text registered_titles [ title ] = name registered_filters [ name ] = p else raise "#render_text isn't implemented in this class" end rescue LoadError TextFilters . logger . debug "Filter '#{name}' was not included: #{$!}" unless TextFilters . logger . nil? rescue TextFilters . logger . debug "Filter '#{name}' was not included: #{$!}" unless TextFilters . logger . nil? end end
Use this to create and register your TextFilters
Use this to create and register your TextFilters
name
<not_specific>
title
<not_specific>
block
<not_specific>