Sha256: 8d4ece87f6388751bc3846dd8e192950c1bee2623e3f94c5f1a658a3bed3a4cb

Contents?: true

Size: 531 Bytes

Versions: 14

Compression:

Stored size: 531 Bytes

Contents

# frozen_string_literal: true
require_relative 'template'

module Tilt
  # Superclass used for pipeline templates.  Should not be used directly.
  class Pipeline < Template
    def prepare
      @pipeline = self.class::TEMPLATES.inject(proc{|*| data}) do |data, (klass, options)|
        proc do |s,l,&sb|
          klass.new(file, line, options, &proc{|*| data.call(s, l, &sb)}).render(s, l, &sb)
        end
      end
    end

    def evaluate(scope, locals, &block)
      @pipeline.call(scope, locals, &block)
    end
  end
end

Version data entries

14 entries across 13 versions & 5 rubygems

Version Path
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/pipeline.rb
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.3.0/gems/tilt-2.4.0/lib/tilt/pipeline.rb
tilt-2.6.0 lib/tilt/pipeline.rb
brakeman-7.0.0 bundle/ruby/3.1.0/gems/tilt-2.5.0/lib/tilt/pipeline.rb
tilt-2.5.0 lib/tilt/pipeline.rb
brakeman-6.2.2 bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/pipeline.rb
brakeman-6.2.2.rc1 bundle/ruby/3.3.0/gems/tilt-2.4.0/lib/tilt/pipeline.rb
brakeman-6.2.1 bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/pipeline.rb
brakeman-6.2.0 bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/pipeline.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/tilt-2.4.0/lib/tilt/pipeline.rb
tilt-2.4.0 lib/tilt/pipeline.rb
getargv-0.3.3-universal-darwin vendor/bundle/ruby/3.3.0/gems/tilt-2.3.0/lib/tilt/pipeline.rb
tilt-2.3.0 lib/tilt/pipeline.rb
tilt-2.2.0 lib/tilt/pipeline.rb