Class: Sprockets::JstProcessor

Inherits:
Tilt::Template
  • Object
show all
Defined in:
lib/sprockets/jst_processor.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.default_mime_typeObject



5
6
7
# File 'lib/sprockets/jst_processor.rb', line 5

def self.default_mime_type
  'application/javascript'
end

Instance Method Details

#evaluate(scope, locals, &block) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/sprockets/jst_processor.rb', line 12

def evaluate(scope, locals, &block)
  <<-JST
(function() {
  this.JST || (this.JST = {});
  this.JST[#{scope.logical_path.inspect}] = #{indent(data)};
}).call(this);
  JST
end

#prepareObject



9
10
# File 'lib/sprockets/jst_processor.rb', line 9

def prepare
end