You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 年之前
16 年之前
16 年之前
16 年之前
16 年之前
16 年之前
16 年之前
16 年之前
16 年之前
16 年之前
16 年之前
16 年之前
16 年之前
16 年之前
16 年之前
16 年之前
16 年之前
16 年之前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. require 'rake'
  2. require 'spec/rake/spectask'
  3. task :default => :spec
  4. Spec::Rake::SpecTask.new(:spec) do |t|
  5. #t.spec_opts = ['--options', "\"#{File.dirname(__FILE__)}/spec/spec.opts\""]
  6. t.spec_files = FileList['test/*_spec.rb']
  7. end
  8. desc "Run all specs"
  9. task :spec
  10. desc "Package for CommonJS"
  11. task :commonjs do
  12. puts "Packaging for CommonJS"
  13. `mkdir lib`
  14. `cp mustache.js lib/mustache.js`
  15. puts "Done."
  16. end
  17. desc "Package for jQuery"
  18. task :jquery do
  19. puts "Packaging for jQuery"
  20. source = "mustache-jquery"
  21. target_jq = "jquery.mustache.js"
  22. `cat #{source}/#{target_jq}.tpl.pre mustache.js #{source}/#{target_jq}.tpl.post > #{target_jq}`
  23. puts "Done, see ./#{target_jq}"
  24. end
  25. desc "Package for dojo"
  26. task :dojo do
  27. puts "Packaging for dojo"
  28. source = "mustache-dojo"
  29. target_js = "mustache.js"
  30. `mkdir -p dojox; mkdir -p dojox/string`
  31. `cat #{source}/#{target_js}.tpl.pre mustache.js #{source}/#{target_js}.tpl.post > dojox/string/#{target_js}`
  32. puts "Done, see ./dojox/string/#{target_js} Include using dojo.require('dojox.string.mustache.'); "
  33. end
  34. desc "Package for YUI3"
  35. task :yui3 do
  36. puts "Packaging for YUI3"
  37. source = "mustache-yui3"
  38. target_js = "mustache.js"
  39. `mkdir -p yui3; mkdir -p yui3/mustache`
  40. `cat #{source}/#{target_js}.tpl.pre mustache.js #{source}/#{target_js}.tpl.post > yui3/mustache/#{target_js}`
  41. puts "Done, see ./yui3/mustache/#{target_js}"
  42. end
  43. desc "Remove temporary files."
  44. task :clean do
  45. `git clean -fdx`
  46. end