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) {