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 年之前
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. source = "mustache-commonjs"
  14. target_jq = "commonjs.mustache.js"
  15. `cat #{source}/#{target_jq}.tpl.pre mustache.js #{source}/#{target_jq}.tpl.post > #{target_jq}`
  16. puts "Done."
  17. end
  18. desc "Package for jQuery"
  19. task :jquery do
  20. puts "Packaging for jQuery"
  21. source = "mustache-jquery"
  22. target_jq = "jquery.mustache.js"
  23. `cat #{source}/#{target_jq}.tpl.pre mustache.js #{source}/#{target_jq}.tpl.post > #{target_jq}`
  24. puts "Done, see ./#{target_jq}"
  25. end
  26. desc "Package for dojo"
  27. task :dojo do
  28. puts "Packaging for dojo"
  29. source = "mustache-dojo"
  30. target_js = "mustache.js"
  31. `mkdir -p dojox; mkdir -p dojox/string`
  32. `cat #{source}/#{target_js}.tpl.pre mustache.js #{source}/#{target_js}.tpl.post > dojox/string/#{target_js}`
  33. puts "Done, see ./dojox/string/#{target_js} Include using dojo.require('dojox.string.mustache.'); "
  34. end
  35. desc "Package for YUI3"
  36. task :yui3 do
  37. puts "Packaging for YUI3"
  38. source = "mustache-yui3"
  39. target_js = "mustache.js"
  40. `mkdir -p yui3; mkdir -p yui3/mustache`
  41. `cat #{source}/#{target_js}.tpl.pre mustache.js #{source}/#{target_js}.tpl.post > yui3/mustache/#{target_js}`
  42. puts "Done, see ./yui3/mustache/#{target_js}"
  43. end
  44. desc "Remove temporary files."
  45. task :clean do
  46. `git clean -fdx`
  47. end