Sha256: bcba0fff19a5fddd1e7466f8dbdc91c5d838e4d6ac57de7602956ec86303997e

Contents?: true

Size: 461 Bytes

Versions: 6

Compression:

Stored size: 461 Bytes

Contents

# frozen_string_literal: true

require 'action_view'
require 'ostruct'

module ::AmberComponent
  module TemplateHandler
    # Handles rendering ERB with Rails-like syntax
    class ERB < ::ActionView::Template::Handlers::ERB::Erubi
      def initialize(input, properties = {})
        properties[:bufvar] ||= "@output_buffer"
        properties[:preamble] = "#{properties[:bufvar]}=#{::ActionView::OutputBuffer}.new;"
        super
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
amber_component-1.1.1 lib/amber_component/template_handler/erb.rb
amber_component-1.1.0 lib/amber_component/template_handler/erb.rb
amber_component-1.0.0 lib/amber_component/template_handler/erb.rb
amber_component-0.0.5 lib/amber_component/template_handler/erb.rb
amber_component-0.0.4 lib/amber_component/template_handler/erb.rb
amber_component-0.0.3 lib/amber_component/template_handler/erb.rb