Sha256: 9ccd06fbc89c11b6b266e7734cf7d01bc841bfd41676608dc412a464df711604

Contents?: true

Size: 368 Bytes

Versions: 12

Compression:

Stored size: 368 Bytes

Contents

module AutoHtml
  extend self

  def self.add_filter(name, &block)
    AutoHtml::Builder.add_filter(name, &block)
  end

  def auto_html(raw, &proc)
    return "" if raw.blank?
    builder = Builder.new(raw)
    result = builder.instance_eval(&proc)
    return raw if result.nil?
    result.respond_to?(:html_safe) ?
      result.html_safe :
        result
  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
auto_html-1.6.4 lib/auto_html/base.rb
auto_html-1.6.3 lib/auto_html/base.rb
auto_html-1.5.1.1 lib/auto_html/base.rb
auto_html-1.6.2 lib/auto_html/base.rb
auto_html-1.6.1 lib/auto_html/base.rb
auto_html-1.6.0 lib/auto_html/base.rb
auto_html-1.5.3 lib/auto_html/base.rb
auto_html-1.5.2 lib/auto_html/base.rb
auto_html-1.5.1 lib/auto_html/base.rb
auto_html-1.5.0 lib/auto_html/base.rb
auto_html-1.4.2 lib/auto_html/base.rb
auto_html-1.4.1 lib/auto_html/base.rb