Sha256: e606d03e546ced495b71f22ab0c847f062ef8dcd5d123d84244d49593d56756a

Contents?: true

Size: 716 Bytes

Versions: 75

Compression:

Stored size: 716 Bytes

Contents

require 'delegate'

module Sprockets
  # Deprecated: Wraps legacy process Procs with new processor call signature.
  #
  # Will be removed in Sprockets 4.x.
  #
  #     LegacyProcProcessor.new(:compress,
  #       proc { |context, data| data.gsub(...) })
  #
  class LegacyProcProcessor < Delegator
    def initialize(name, proc)
      @name = name
      @proc = proc
    end

    def __getobj__
      @proc
    end

    def name
      "Sprockets::LegacyProcProcessor (#{@name})"
    end

    def to_s
      name
    end

    def call(input)
      context = input[:environment].context_class.new(input)
      data = @proc.call(context, input[:data])
      context.metadata.merge(data: data.to_str)
    end
  end
end

Version data entries

75 entries across 69 versions & 15 rubygems

Version Path
sprockets-3.7.5 lib/sprockets/legacy_proc_processor.rb
sprockets-3.7.4 lib/sprockets/legacy_proc_processor.rb
sprockets-3.7.3 lib/sprockets/legacy_proc_processor.rb
files.com-1.0.55 docs/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/legacy_proc_processor.rb
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/legacy_proc_processor.rb
zuora_connect_ui-0.9.2 vendor/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/legacy_proc_processor.rb
chatops-rpc-0.0.2 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/legacy_proc_processor.rb
chatops-rpc-0.0.1 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/sprockets-3.7.2/lib/sprockets/legacy_proc_processor.rb
zuora_connect_ui-0.9.1 vendor/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/legacy_proc_processor.rb
zuora_connect_ui-0.9.0 vendor/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/legacy_proc_processor.rb
zuora_connect_ui-0.8.3 vendor/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/legacy_proc_processor.rb
zuora_connect_ui-0.8.2 vendor/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/legacy_proc_processor.rb
zuora_connect_ui-0.8.1 vendor/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/legacy_proc_processor.rb
zuora_connect_ui-0.8.0 vendor/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/legacy_proc_processor.rb
spiral_form-0.1.1 vendor/bundle/gems/sprockets-3.7.2/lib/sprockets/legacy_proc_processor.rb
spiral_form-0.1.0 vendor/bundle/gems/sprockets-3.7.2/lib/sprockets/legacy_proc_processor.rb
zuora_connect_ui-0.7.1 vendor/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/legacy_proc_processor.rb
zuora_connect_ui-0.7.0 vendor/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/legacy_proc_processor.rb
tdiary-5.0.11 vendor/bundle/gems/sprockets-3.7.2/lib/sprockets/legacy_proc_processor.rb
sprokovuln-0.2.0 vendor/ruby/gems/sprockets-3.7.1/lib/sprockets/legacy_proc_processor.rb