Sha256: 5cb1aea020ef318394717cfaf991263ca54efb2fa7955c4a53111c38278dd9c1

Contents?: true

Size: 640 Bytes

Versions: 47

Compression:

Stored size: 640 Bytes

Contents

# frozen_string_literal: true

require 'action_view'

module Haml

  class ErubisTemplateHandler < ActionView::Template::Handlers::Erubis

    def initialize(*args, &blk)
      @newline_pending = 0
      super
    end
  end

  class SafeErubisTemplate < Tilt::ErubisTemplate

    def initialize_engine
    end

    def prepare
      @options.merge! :engine_class => Haml::ErubisTemplateHandler
      super
    end

    def precompiled_preamble(locals)
      [super, "@output_buffer = ActionView::OutputBuffer.new;"].join("\n")
    end

    def precompiled_postamble(locals)
      [super, '@output_buffer.to_s'].join("\n")
    end
  end
end

Version data entries

47 entries across 44 versions & 3 rubygems

Version Path
brakeman-5.1.0 bundle/ruby/2.7.0/gems/haml-5.2.1/lib/haml/helpers/safe_erubis_template.rb
brakeman-5.0.4 bundle/ruby/2.7.0/gems/haml-5.2.1/lib/haml/helpers/safe_erubis_template.rb
brakeman-5.0.2 bundle/ruby/2.7.0/gems/haml-5.2.1/lib/haml/helpers/safe_erubis_template.rb
brakeman-5.0.1 bundle/ruby/2.7.0/gems/haml-5.2.1/lib/haml/helpers/safe_erubis_template.rb
brakeman-5.0.0 bundle/ruby/2.7.0/gems/haml-5.2.1/lib/haml/helpers/safe_erubis_template.rb
brakeman-4.10.1 bundle/ruby/2.7.0/gems/haml-5.2.1/lib/haml/helpers/safe_erubis_template.rb
haml-5.2.1 lib/haml/helpers/safe_erubis_template.rb
brakeman-5.0.0.pre1 bundle/ruby/2.7.0/gems/haml-5.2.0/lib/haml/helpers/safe_erubis_template.rb
brakeman-4.10.0 bundle/ruby/2.7.0/gems/haml-5.1.2/lib/haml/helpers/safe_erubis_template.rb
haml-5.2.0 lib/haml/helpers/safe_erubis_template.rb
brakeman-4.9.1 bundle/ruby/2.7.0/gems/haml-5.1.2/lib/haml/helpers/safe_erubis_template.rb
brakeman-4.9.0 bundle/ruby/2.7.0/gems/haml-5.1.2/lib/haml/helpers/safe_erubis_template.rb
brakeman-4.8.2 bundle/ruby/2.7.0/gems/haml-5.1.2/lib/haml/helpers/safe_erubis_template.rb
brakeman-4.8.1 bundle/ruby/2.4.0/gems/haml-5.1.2/lib/haml/helpers/safe_erubis_template.rb
brakeman-4.8.0 bundle/ruby/2.7.0/gems/haml-5.1.2/lib/haml/helpers/safe_erubis_template.rb
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/brakeman-4.7.1/bundle/ruby/2.6.0/gems/haml-5.1.2/lib/haml/helpers/safe_erubis_template.rb
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/brakeman-4.7.2/bundle/ruby/2.6.0/gems/haml-5.1.2/lib/haml/helpers/safe_erubis_template.rb
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/brakeman-4.7.0/bundle/ruby/2.6.0/gems/haml-5.1.2/lib/haml/helpers/safe_erubis_template.rb
brakeman-4.7.2 bundle/ruby/2.6.0/gems/haml-5.1.2/lib/haml/helpers/safe_erubis_template.rb
zuora_connect_ui-0.9.2 vendor/ruby/2.6.0/gems/brakeman-4.7.1/bundle/ruby/2.6.0/gems/haml-5.1.2/lib/haml/helpers/safe_erubis_template.rb