From 420dd041437d930b4d4b1373cf0b1b550b3f9803 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ku=C5=BAma?= Date: Sun, 14 Mar 2010 14:50:16 +0100 Subject: [PATCH] added YUI3 support --- .gitignore | 1 + Rakefile | 8 ++++++++ mustache-yui3/mustache.js.tpl.post | 4 ++++ mustache-yui3/mustache.js.tpl.pre | 1 + 4 files changed, 14 insertions(+) create mode 100644 mustache-yui3/mustache.js.tpl.post create mode 100644 mustache-yui3/mustache.js.tpl.pre diff --git a/.gitignore b/.gitignore index aaa1ddf..4c19b5d 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ runner.js lib jquery.mustache.js dojox +yui3 diff --git a/Rakefile b/Rakefile index 24f590c..3198ea2 100644 --- a/Rakefile +++ b/Rakefile @@ -37,6 +37,14 @@ task :dojo do print "Done, see ./dojox/string/#{target_js} Include using dojo.require('dojox.string.mustache.'); \n" end +task :yui3 do + print "Packaging for YUI3\n" + source = "mustache-yui3" + target_js = "mustache.js" + `mkdir -p yui3; mkdir -p yui3/mustache` + `cat #{source}/#{target_js}.tpl.pre mustache.js #{source}/#{target_js}.tpl.post > yui3/mustache/#{target_js}` + print "Done, see ./yui3/mustache/#{target_js}\n" +end task :clean do `for file in \`cat .gitignore\`; do rm -rf $file; done` diff --git a/mustache-yui3/mustache.js.tpl.post b/mustache-yui3/mustache.js.tpl.post new file mode 100644 index 0000000..373d827 --- /dev/null +++ b/mustache-yui3/mustache.js.tpl.post @@ -0,0 +1,4 @@ + + Y.mustache = Mustache.to_html; + +}, "0"); diff --git a/mustache-yui3/mustache.js.tpl.pre b/mustache-yui3/mustache.js.tpl.pre new file mode 100644 index 0000000..280de86 --- /dev/null +++ b/mustache-yui3/mustache.js.tpl.pre @@ -0,0 +1 @@ +YUI.add("mustache", function(Y) {