lib/sprockets_spacely/mustache/template/generator.rb in sprockets_spacely-0.0.2 vs lib/sprockets_spacely/mustache/template/generator.rb in sprockets_spacely-0.1.0
- old
+ new
@@ -3,14 +3,15 @@
module Template
class Generator
attr_reader :template_name
- def initialize(namespace, logical_path, template_string)
+ def initialize(namespace, logical_path, template_string, library)
@template_name = logical_path
@namespace = namespace
@template_string = template_string
+ @library = library
end
def generate
js_function = <<-JS
@@ -22,10 +23,10 @@
};
function render(obj, partials) {
return Mustache.to_html(#{@namespace}.mustache['#{@template_name}'].template, obj, partials);
}
-}(jQuery));
+}(#{@library}));
JS
end
end
end