Sha256: 55d5d6152c3354d604101217c231c09afc1e1cd505d878c55fab5bdb1677752d

Contents?: true

Size: 663 Bytes

Versions: 66

Compression:

Stored size: 663 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::CoffeeScriptProcessor)
  #
  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.to_str)
    end
  end
end

Version data entries

66 entries across 60 versions & 13 rubygems

Version Path
tdiary-5.0.9 vendor/bundle/gems/sprockets-3.7.2/lib/sprockets/legacy_tilt_processor.rb
sprockets-3.7.2 lib/sprockets/legacy_tilt_processor.rb
tdiary-5.0.8 vendor/bundle/gems/tdiary-5.0.7/vendor/bundle/gems/sprockets-3.7.1/lib/sprockets/legacy_tilt_processor.rb
tdiary-5.0.8 vendor/bundle/gems/sprockets-3.7.1/lib/sprockets/legacy_tilt_processor.rb
tdiary-5.0.8 vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.1/lib/sprockets/legacy_tilt_processor.rb
tdiary-5.0.7 vendor/bundle/gems/sprockets-3.7.1/lib/sprockets/legacy_tilt_processor.rb
tdiary-5.0.6 vendor/bundle/gems/sprockets-3.7.1/lib/sprockets/legacy_tilt_processor.rb
tdiary-5.0.5 vendor/bundle/gems/sprockets-3.7.1/lib/sprockets/legacy_tilt_processor.rb
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/gems/sprockets-3.7.1/lib/sprockets/legacy_tilt_processor.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/sprockets-3.7.1/lib/sprockets/legacy_tilt_processor.rb
tdiary-5.0.4 vendor/bundle/gems/sprockets-3.7.1/lib/sprockets/legacy_tilt_processor.rb
autocompl-0.2.2 test/dummy/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/legacy_tilt_processor.rb
autocompl-0.2.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/legacy_tilt_processor.rb
autocompl-0.2.0 test/dummy/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/legacy_tilt_processor.rb
autocompl-0.1.2 test/dummy/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/legacy_tilt_processor.rb
autocompl-0.1.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/legacy_tilt_processor.rb
autocompl-0.1.0 test/dummy/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/legacy_tilt_processor.rb
autocompl-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/sprockets-3.7.1/lib/sprockets/legacy_tilt_processor.rb
abaci-0.3.0 vendor/bundle/gems/sprockets-3.6.3/lib/sprockets/legacy_tilt_processor.rb
sprockets-3.7.1 lib/sprockets/legacy_tilt_processor.rb