浏览代码

fix rake commonjs part 2

tags/0.3.0
Jan Lehnardt 16 年前
父节点
当前提交
88d3d9cf32
共有 3 个文件被更改,包括 7 次插入17 次删除
  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 查看文件

@@ -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"


+ 0
- 7
mustache-commonjs/commonjs.mustache.js.tpl.post 查看文件

@@ -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 查看文件

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


正在加载...
取消
保存