Parent

Sprockets::JstProcessor

Attributes

namespace[R]

Public Class Methods

default_mime_type() click to toggle source
   # File lib/sprockets/jst_processor.rb, line 5
5:     def self.default_mime_type
6:       'application/javascript'
7:     end
default_namespace() click to toggle source
    # File lib/sprockets/jst_processor.rb, line 9
 9:     def self.default_namespace
10:       'this.JST'
11:     end

Public Instance Methods

evaluate(scope, locals, &block) click to toggle source
    # File lib/sprockets/jst_processor.rb, line 19
19:     def evaluate(scope, locals, &block)
20:       (function() {  #{namespace} || (#{namespace} = {});  #{namespace}[#{scope.logical_path.inspect}] = #{indent(data)};}).call(this);
21:     end
prepare() click to toggle source
    # File lib/sprockets/jst_processor.rb, line 13
13:     def prepare
14:       @namespace = self.class.default_namespace
15:     end

Private Instance Methods

indent(string) click to toggle source
    # File lib/sprockets/jst_processor.rb, line 29
29:       def indent(string)
30:         string.gsub(/$(.)/, "\\1  ").strip
31:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.