diff --git a/Rakefile b/Rakefile index 4bde737..80aaa17 100644 --- a/Rakefile +++ b/Rakefile @@ -27,6 +27,16 @@ task :jquery do print "Done, see ./#{target_jq}\n" end + +task :dojo do + print "Packaging for dojo\n" + source = "mustache-dojo" + target_js = "dojo.mustache.js" + `cat #{source}/#{target_js}.tpl.pre mustache.js #{source}/#{target_js}.tpl.post > #{target_js}` + print "Done, see ./#{target_js}\n" +end + + task :clean do `for file in \`cat .gitignore\`; do rm -rf $file; done` end diff --git a/mustache-dojo/dojo.mustache.js.tpl.post b/mustache-dojo/dojo.mustache.js.tpl.post new file mode 100644 index 0000000..f4f204a --- /dev/null +++ b/mustache-dojo/dojo.mustache.js.tpl.post @@ -0,0 +1,5 @@ + + d.mustache = function(template, view) { + return Mustache.to_html(template, view); + }; +})(dojo); \ No newline at end of file diff --git a/mustache-dojo/dojo.mustache.js.tpl.pre b/mustache-dojo/dojo.mustache.js.tpl.pre new file mode 100644 index 0000000..568b9ab --- /dev/null +++ b/mustache-dojo/dojo.mustache.js.tpl.pre @@ -0,0 +1,9 @@ +/* +Shameless port of a shameless port +@defunkt => @janl => @aq + +See http://github.com/defunkt/mustache for more info. +*/ + +dojo.provide("dojo.mustache"); +(function(d) {