Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

39 lignes
864B

  1. require 'rake'
  2. require 'rake/testtask'
  3. task :default => :test
  4. task :test do
  5. Rake::TestTask.new do |t|
  6. Dir.glob("examples/*.html") do |file|
  7. test = File.basename(file, ".html")
  8. cmd = "ruby test/mustache_test.rb #{test}"
  9. print `#{cmd}`
  10. end
  11. end
  12. end
  13. task :commonjs do
  14. print "Packaging for CommonJS\n"
  15. target = "mustache-commonjs"
  16. copy_distfiles(target);
  17. `mkdir #{target}/lib`
  18. `cp mustache.js #{target}/lib`
  19. print "Done, see ./#{target}\n"
  20. end
  21. task :jquery do
  22. print "Packaging for jQuery\n"
  23. target = "mustache-jquery/"
  24. target_jq = "#{target}/jquery.mustache.js"
  25. `cat #{target_jq}.tpl.pre mustache.js #{target_jq}.tpl.post > #{target_jq}`
  26. copy_distfiles(target);
  27. print "Done, see ./#{target}\n"
  28. end
  29. private
  30. def copy_distfiles(target)
  31. files = "LICENSE README.md test examples"
  32. `cp -r #{files} #{target}`
  33. end