Sha256: 7cf6752ecc976b07b059c0c1c0719c8f050585a4e9bbca3d343ccf07bb4091e4

Contents?: true

Size: 564 Bytes

Versions: 1

Compression:

Stored size: 564 Bytes

Contents

module Sprockets
  module Mustache
    module Template
      class Processor < Tilt::Template
        include ActionView::Helpers::JavaScriptHelper

        def self.default_mime_type
          'application/javascript'
        end

        def prepare
        end

        def evaluate(scope, locals, &block)

          namespace = Namespace.value || "window"

          Generator.new(namespace, scope.logical_path, escape_javascript(data)).generate
        end
      end
    end
  end

  register_engine '.mustache', ::Sprockets::Mustache::Template::Processor
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sprockets_spacely-0.0.2 lib/sprockets_spacely/mustache/template/processor.rb