Sha256: 0d497797b48cacd62a2968dcecd2bc2c7fce3473a814d93ba65153c0dacd6663
Contents?: true
Size: 709 Bytes
Versions: 14
Compression:
Stored size: 709 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) end end end
Version data entries
14 entries across 14 versions & 1 rubygems