From 65eb4220ca866442317750142029cb0892885d24 Mon Sep 17 00:00:00 2001 From: Michael Jackson Date: Mon, 5 Dec 2011 13:33:58 -0800 Subject: [PATCH] Fix indentation --- Rakefile | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/Rakefile b/Rakefile index a19c5ea..f72af2a 100644 --- a/Rakefile +++ b/Rakefile @@ -11,6 +11,10 @@ task :spec do end end +def version + File.read("mustache.js").match('version: "([^\"]+)",$')[1] +end + def templated_build(name, opts={}) # Create a rule that uses the .tmpl.{pre,post} stuff to make a final, # wrapped, output file. @@ -25,7 +29,7 @@ def templated_build(name, opts={}) target_js = opts[:location] ? "mustache.js" : "#{short}.mustache.js" puts "Packaging for #{name}" - sh "mkdir -p #{opts[:location]}" if opts[:location] + 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}" @@ -33,10 +37,9 @@ def templated_build(name, opts={}) if opts[:extra] sh "sed -e 's/{{version}}/#{version}/' #{source}/#{opts[:extra]} \ > #{opts[:location]}/#{opts[:extra]}" - end - - puts "Done, see #{opts[:location] || '.'}/#{target_js}" + end + puts "Done, see #{opts[:location] || '.'}/#{target_js}" end end @@ -47,12 +50,6 @@ templated_build "Dojo", :location => "dojox/string" templated_build "YUI3", :location => "yui3/mustache" templated_build "requirejs" - -def version - File.read("mustache.js").match('version: "([^\"]+)",$')[1] -end - - desc "Remove temporary files." task :clean do sh "git clean -fdx"