Sha256: b2d23e6b2ac9eabf407af35c460f3d6b519c2bf3459c98b4d4a745a4333ed260
Contents?: true
Size: 830 Bytes
Versions: 33
Compression:
Stored size: 830 Bytes
Contents
module Linner module Wrapper class Module def self.wrap(name, content) <<-WRAPPER this.require.define({"#{name}":function(exports, require, module){#{content};}}); WRAPPER end def self.definition File.read(File.join File.dirname(__FILE__), "../../vendor", "require_definition.js") end end class Template def self.wrap(name, content) <<-WRAPPER templates["#{name}"] = template(#{content}); WRAPPER end def self.partial_wrap(name, content) <<-PARTIAL Handlebars.registerPartial("#{name}", Handlebars.template(#{content})); PARTIAL end def self.definition(content) <<-DEFINITION (function() { var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {}; #{content} })(); DEFINITION end end end end
Version data entries
33 entries across 33 versions & 2 rubygems