Sha256: 10480b99e8cc55f3f44fa391376b3a52fdea815a4fb879a31b264a0f2e3e1f43

Contents?: true

Size: 651 Bytes

Versions: 6

Compression:

Stored size: 651 Bytes

Contents

require 'delegate'

module Sprockets
  # Deprecated: Wraps legacy engine and process Tilt templates with new
  # processor call signature.
  #
  # Will be removed in Sprockets 4.x.
  #
  #     LegacyTiltProcessor.new(Tilt::CoffeeScriptTemplate)
  #
  class LegacyTiltProcessor < Delegator
    def initialize(klass)
      @klass = klass
    end

    def __getobj__
      @klass
    end

    def call(input)
      filename = input[:filename]
      data     = input[:data]
      context  = input[:environment].context_class.new(input)

      data = @klass.new(filename) { data }.render(context)
      context.metadata.merge(data: data)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
sprockets-3.0.0.beta.6 lib/sprockets/legacy_tilt_processor.rb
sprockets-3.0.0.beta.5 lib/sprockets/legacy_tilt_processor.rb
sprockets-3.0.0.beta.4 lib/sprockets/legacy_tilt_processor.rb
sprockets-3.0.0.beta.3 lib/sprockets/legacy_tilt_processor.rb
sprockets-3.0.0.beta.2 lib/sprockets/legacy_tilt_processor.rb
sprockets-3.0.0.beta.1 lib/sprockets/legacy_tilt_processor.rb