File tree Expand file tree Collapse file tree 3 files changed +21
-9
lines changed Expand file tree Collapse file tree 3 files changed +21
-9
lines changed Original file line number Diff line number Diff line change @@ -28,15 +28,27 @@ def templated_build(name, opts={})
28
28
sh "mkdir -p #{ opts [ :location ] } " if opts [ :location ]
29
29
sh "cat #{ source } /#{ target_js } .tpl.pre mustache.js \
30
30
#{ source } /#{ target_js } .tpl.post > #{ opts [ :location ] || '.' } /#{ target_js } "
31
- puts "Done, see #{ opts [ :location ] || '.' } /#{ target_js } "
31
+
32
+ # extra
33
+ if opts [ :extra ]
34
+ sh "cat #{ source } /#{ opts [ :extra ] } | sed -e 's/{{version}}/#{ version } /' > #{ opts [ :location ] } /#{ opts [ :extra ] } "
35
+ end
36
+
37
+ puts "Done, see #{ opts [ :location ] || '.' } /#{ target_js } "
38
+
32
39
end
33
40
end
34
41
35
- templated_build "CommonJS" , :location => "lib"
42
+ templated_build "CommonJS" , :location => "lib" , :extra => "package.json"
36
43
templated_build "jQuery"
37
44
templated_build "Dojo" , :location => "dojox/string"
38
45
templated_build "YUI3" , :location => "yui3/mustache"
39
46
47
+ def version
48
+ File . read ( "mustache.js" ) . match ( 'version: "([^\"]+)",$' ) [ 1 ]
49
+ end
50
+
51
+
40
52
desc "Remove temporary files."
41
53
task :clean do
42
54
sh "git clean -fdx"
Original file line number Diff line number Diff line change
1
+ {
2
+ "name" : " mustache" ,
3
+ "author" : " http://mustache.github.com/" ,
4
+ "description" : " {{ mustache }} in JavaScript — Logic-less templates." ,
5
+ "keywords" : [" template" ],
6
+ "version" : " {{version}}"
7
+ }
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments