forked from janl/mustache.js
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
43 lines (34 loc) · 1.07 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
require 'rake'
require 'spec/rake/spectask'
task :default => :spec
Spec::Rake::SpecTask.new(:spec) do |t|
#t.spec_opts = ['--options', "\"#{File.dirname(__FILE__)}/spec/spec.opts\""]
t.spec_files = FileList['test/*_spec.rb']
end
desc "Run all specs"
task :spec do
end
task :commonjs do
print "Packaging for CommonJS\n"
`mkdir lib`
`cp mustache.js lib/mustache.js`
print "Done.\n"
end
task :jquery do
print "Packaging for jQuery\n"
source = "mustache-jquery"
target_jq = "jquery.mustache.js"
`cat #{source}/#{target_jq}.tpl.pre mustache.js #{source}/#{target_jq}.tpl.post > #{target_jq}`
print "Done, see ./#{target_jq}\n"
end
task :dojo do
print "Packaging for dojo\n"
source = "mustache-dojo"
target_js = "mustache.js"
`mkdir -p dojox; mkdir -p dojox/string`
`cat #{source}/#{target_js}.tpl.pre mustache.js #{source}/#{target_js}.tpl.post > dojox/string/#{target_js}`
print "Done, see ./dojox/string/#{target_js} Include using dojo.require('dojox.string.mustache.'); \n"
end
task :clean do
`for file in \`cat .gitignore\`; do rm -rf $file; done`
end