class Sprockets::JstProcessor


mime_type: ‘application/javascript’
JstProcessor.new(namespace: ‘App.templates’),
environment.register_engine ‘.jst’,
Change the default namespace.
mime_type: ‘application/javascript’
JstProcessor,
environment.register_engine ‘.jst’,
To accept the default options
Name your template “users/show.jst.ejs”, “users/new.jst.eco”, etc.
Exports server side compiled templates to an object.
Public: .jst engine.

def self.call(input)

def self.call(input)
  instance.call(input)
end

def self.default_namespace

def self.default_namespace
  'this.JST'
end

def self.instance

Returns JstProcessor object.

Public: Return singleton instance with default options.
def self.instance
  @instance ||= new
end

def call(input)

def call(input)
  data = input[:data].gsub(/$(.)/m, "\\1  ").strip
  key  = input[:name]
  <<-JST
ction() { #{@namespace} || (#{@namespace} = {}); #{@namespace}[#{key.inspect}] = #{data};
all(this);
  JST
end

def initialize(options = {})

def initialize(options = {})
  @namespace = options[:namespace] || self.class.default_namespace
end