Sfoglia il codice sorgente

fix rake commonjs part 2

tags/0.3.0
Jan Lehnardt 16 anni fa
parent
commit
88d3d9cf32
3 ha cambiato i file con 7 aggiunte e 17 eliminazioni
  1. +7
    -4
      Rakefile
  2. +0
    -7
      mustache-commonjs/commonjs.mustache.js.tpl.post
  3. +0
    -6
      mustache-commonjs/commonjs.mustache.js.tpl.pre

+ 7
- 4
Rakefile Vedi File

@@ -12,8 +12,10 @@ desc "Run all specs"
task :spec task :spec


def templated_build(name, opts={}) 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 short = name.downcase
source = "mustache-#{short}" source = "mustache-#{short}"
dependencies = ["mustache.js"] + Dir.glob("#{source}/*.tpl.*") dependencies = ["mustache.js"] + Dir.glob("#{source}/*.tpl.*")
@@ -24,12 +26,13 @@ def templated_build(name, opts={})


puts "Packaging for #{name}" puts "Packaging for #{name}"
sh "mkdir -p #{opts[:location]}" if opts[:location] 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}" puts "Done, see #{opts[:location] || '.'}/#{target_js}"
end end
end end


templated_build "CommonJS"
templated_build "CommonJS", :location => "lib"
templated_build "jQuery" templated_build "jQuery"
templated_build "Dojo", :location => "dojox/string" templated_build "Dojo", :location => "dojox/string"
templated_build "YUI3", :location => "yui3/mustache" templated_build "YUI3", :location => "yui3/mustache"


+ 0
- 7
mustache-commonjs/commonjs.mustache.js.tpl.post Vedi File

@@ -1,7 +0,0 @@

exports.name = Mustache.name;
exports.version = Mustache.version;

exports.to_html = function() {
return Mustache.to_html.apply(this, arguments);
};

+ 0
- 6
mustache-commonjs/commonjs.mustache.js.tpl.pre Vedi File

@@ -1,6 +0,0 @@
/*
* CommonJS-compatible mustache.js module
*
* See http://github.com/janl/mustache.js for more info.
*/


Loading…
Annulla
Salva