Sha256: 88e25b87b280f93e65f7d216a53a014ffda591d537684bddba8266aa3d76f8ac

Contents?: true

Size: 605 Bytes

Versions: 144

Compression:

Stored size: 605 Bytes

Contents

require 'tilt'

module Sprockets
  # `Processor` creates an anonymous processor class from a block.
  #
  #     register_preprocessor :my_processor do |context, data|
  #       # ...
  #     end
  #
  class Processor < Tilt::Template
    # `processor` is a lambda or block
    def self.processor
      @processor
    end

    def self.name
      "Sprockets::Processor (#{@name})"
    end

    def self.to_s
      name
    end

    def prepare
    end

    # Call processor block with `context` and `data`.
    def evaluate(context, locals)
      self.class.processor.call(context, data)
    end
  end
end

Version data entries

144 entries across 119 versions & 19 rubygems

Version Path
active_mailer-0.0.10 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/processor.rb
judge-2.0.5 vendor/bundle/ruby/2.1.0/gems/sprockets-2.2.2/lib/sprockets/processor.rb
sprockets-2.9.4 lib/sprockets/processor.rb
sprockets-2.8.3 lib/sprockets/processor.rb
sprockets-2.7.1 lib/sprockets/processor.rb
sprockets-2.6.1 lib/sprockets/processor.rb
sprockets-2.5.1 lib/sprockets/processor.rb
sprockets-2.4.6 lib/sprockets/processor.rb
sprockets-2.3.3 lib/sprockets/processor.rb
sprockets-2.2.3 lib/sprockets/processor.rb
sprockets-2.1.4 lib/sprockets/processor.rb
sprockets-2.0.5 lib/sprockets/processor.rb
challah-1.0.0 vendor/bundle/gems/sprockets-2.10.0/lib/sprockets/processor.rb
swipe-rails-0.0.5 vendor/bundle/gems/sprockets-2.2.2/lib/sprockets/processor.rb
active_mailer-0.0.9 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/processor.rb
active_mailer-0.0.8 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/processor.rb
active_mailer-0.0.7 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/processor.rb
active_mailer-0.0.6 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/processor.rb
sprockets-2.10.0 lib/sprockets/processor.rb
font-awesome-rails-3.1.1.2 vendor/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/processor.rb