From 9deebb7e7a98c80af390bff2eb47e28a33c49cb0 Mon Sep 17 00:00:00 2001 From: Chris Williams Date: Fri, 6 Nov 2009 17:07:42 -0500 Subject: [PATCH 1/3] Initial Dojo Library. --- Rakefile | 10 ++++++++++ mustache-dojo/dojo.mustache.js.tpl.post | 5 +++++ mustache-dojo/dojo.mustache.js.tpl.pre | 9 +++++++++ 3 files changed, 24 insertions(+) create mode 100644 mustache-dojo/dojo.mustache.js.tpl.post create mode 100644 mustache-dojo/dojo.mustache.js.tpl.pre 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) { From d9bcda56472c08f8a01cae5d6a6d0e8636318800 Mon Sep 17 00:00:00 2001 From: Chris Williams Date: Sat, 7 Nov 2009 09:15:57 -0500 Subject: [PATCH 2/3] Adding dojo support at dojox.string.mustache. --- Rakefile | 7 ++++--- .../{dojo.mustache.js.tpl.post => mustache.js.tpl.post} | 0 .../{dojo.mustache.js.tpl.pre => mustache.js.tpl.pre} | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) rename mustache-dojo/{dojo.mustache.js.tpl.post => mustache.js.tpl.post} (100%) rename mustache-dojo/{dojo.mustache.js.tpl.pre => mustache.js.tpl.pre} (50%) diff --git a/Rakefile b/Rakefile index 80aaa17..24f590c 100644 --- a/Rakefile +++ b/Rakefile @@ -31,9 +31,10 @@ 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" + target_js = "mustache.js" + `mkdir -p dojox; mkdir -p dojox/string` + `cat #{source}/#{target_js}.tpl.pre mustache.js #{source}/#{target_js}.tpl.post > dojox/string/#{target_js}` + print "Done, see ./dojox/string/#{target_js} Include using dojo.require('dojox.string.mustache.'); \n" end diff --git a/mustache-dojo/dojo.mustache.js.tpl.post b/mustache-dojo/mustache.js.tpl.post similarity index 100% rename from mustache-dojo/dojo.mustache.js.tpl.post rename to mustache-dojo/mustache.js.tpl.post diff --git a/mustache-dojo/dojo.mustache.js.tpl.pre b/mustache-dojo/mustache.js.tpl.pre similarity index 50% rename from mustache-dojo/dojo.mustache.js.tpl.pre rename to mustache-dojo/mustache.js.tpl.pre index 568b9ab..ac9a308 100644 --- a/mustache-dojo/dojo.mustache.js.tpl.pre +++ b/mustache-dojo/mustache.js.tpl.pre @@ -1,9 +1,9 @@ /* Shameless port of a shameless port -@defunkt => @janl => @aq +@defunkt => @janl => @aq => @voodootikigod See http://github.com/defunkt/mustache for more info. */ -dojo.provide("dojo.mustache"); -(function(d) { +dojo.provide("dojox.string.mustache"); +;(function(d) { From fc67bb5b6ff25cdd451a97246e61380485dfdf04 Mon Sep 17 00:00:00 2001 From: Jan Lehnardt Date: Sat, 14 Nov 2009 14:54:06 +0100 Subject: [PATCH 3/3] ignore dojox --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 7b9a915..aaa1ddf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ runner.js lib jquery.mustache.js +dojox