From 88d3d9cf32c121096b1a332c3ddffc0b36290cfb Mon Sep 17 00:00:00 2001 From: Jan Lehnardt Date: Tue, 18 May 2010 14:47:50 +0200 Subject: [PATCH] fix rake commonjs part 2 --- Rakefile | 11 +++++++---- mustache-commonjs/commonjs.mustache.js.tpl.post | 7 ------- mustache-commonjs/commonjs.mustache.js.tpl.pre | 6 ------ 3 files changed, 7 insertions(+), 17 deletions(-) delete mode 100644 mustache-commonjs/commonjs.mustache.js.tpl.post delete mode 100644 mustache-commonjs/commonjs.mustache.js.tpl.pre diff --git a/Rakefile b/Rakefile index 2941527..e27970c 100644 --- a/Rakefile +++ b/Rakefile @@ -12,8 +12,10 @@ desc "Run all specs" task :spec def templated_build(name, opts={}) - # Create a rule that uses the .tmpl.{pre,post} stuff to make a final, wrapped, output file. - # There is some extra complexity because Dojo and YUI3 use different template files and final locations. + # Create a rule that uses the .tmpl.{pre,post} stuff to make a final, + # wrapped, output file. + # There is some extra complexity because Dojo and YUI3 use different + # template files and final locations. short = name.downcase source = "mustache-#{short}" dependencies = ["mustache.js"] + Dir.glob("#{source}/*.tpl.*") @@ -24,12 +26,13 @@ def templated_build(name, opts={}) puts "Packaging for #{name}" sh "mkdir -p #{opts[:location]}" if opts[:location] - sh "cat #{source}/#{target_js}.tpl.pre mustache.js #{source}/#{target_js}.tpl.post > #{opts[:location] || '.'}/#{target_js}" + sh "cat #{source}/#{target_js}.tpl.pre mustache.js \ + #{source}/#{target_js}.tpl.post > #{opts[:location] || '.'}/#{target_js}" puts "Done, see #{opts[:location] || '.'}/#{target_js}" end end -templated_build "CommonJS" +templated_build "CommonJS", :location => "lib" templated_build "jQuery" templated_build "Dojo", :location => "dojox/string" templated_build "YUI3", :location => "yui3/mustache" diff --git a/mustache-commonjs/commonjs.mustache.js.tpl.post b/mustache-commonjs/commonjs.mustache.js.tpl.post deleted file mode 100644 index 885803f..0000000 --- a/mustache-commonjs/commonjs.mustache.js.tpl.post +++ /dev/null @@ -1,7 +0,0 @@ - -exports.name = Mustache.name; -exports.version = Mustache.version; - -exports.to_html = function() { - return Mustache.to_html.apply(this, arguments); -}; diff --git a/mustache-commonjs/commonjs.mustache.js.tpl.pre b/mustache-commonjs/commonjs.mustache.js.tpl.pre deleted file mode 100644 index 5e33b34..0000000 --- a/mustache-commonjs/commonjs.mustache.js.tpl.pre +++ /dev/null @@ -1,6 +0,0 @@ -/* - * CommonJS-compatible mustache.js module - * - * See http://github.com/janl/mustache.js for more info. - */ -