Sha256: 056fc3385c13a381f38feb23025755030af5dc26e003087ff1a7629412294726

Contents?: true

Size: 520 Bytes

Versions: 12

Compression:

Stored size: 520 Bytes

Contents

class Condenser::Erubi

  def self.setup(environment)
    require "erubi" unless defined?(::Erubi::Engine)
  end

  def self.call(environment, data)
    source = ::Erubi::Engine.new(data[:source], {
      preamble:   "@output_buffer = String.new;",
      bufvar:     "@output_buffer",
      postamble:  "@output_buffer.to_s"
    }).src
    
    source = eval("proc { #{source} }", nil, data[:filename] || "(erubi)")
    source = environment.new_context_class.instance_eval(&source)

    data[:source] = source
  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
condenser-1.4 lib/condenser/templating_engine/erb.rb
condenser-1.3 lib/condenser/templating_engine/erb.rb
condenser-1.2 lib/condenser/templating_engine/erb.rb
condenser-1.0 lib/condenser/templating_engine/erb.rb
condenser-1.0.rc1 lib/condenser/templating_engine/erb.rb
condenser-0.3 lib/condenser/templating_engine/erb.rb
condenser-0.2 lib/condenser/templating_engine/erb.rb
condenser-0.1 lib/condenser/templating_engine/erb.rb
condenser-0.0.12 lib/condenser/templating_engine/erb.rb
condenser-0.0.11 lib/condenser/templating_engine/erb.rb
condenser-0.0.10 lib/condenser/templating_engine/erb.rb
condenser-0.0.9 lib/condenser/templating_engine/erb.rb