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.

39 line
862B

  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 do
  10. end
  11. task :commonjs do
  12. print "Packaging for CommonJS\n"
  13. target = "mustache-commonjs"
  14. copy_distfiles(target);
  15. `mkdir #{target}/lib`
  16. `cp mustache.js #{target}/lib`
  17. print "Done, see ./#{target}\n"
  18. end
  19. task :jquery do
  20. print "Packaging for jQuery\n"
  21. target = "mustache-jquery/"
  22. target_jq = "#{target}/jquery.mustache.js"
  23. `cat #{target_jq}.tpl.pre mustache.js #{target_jq}.tpl.post > #{target_jq}`
  24. copy_distfiles(target);
  25. print "Done, see ./#{target}\n"
  26. end
  27. private
  28. def copy_distfiles(target)
  29. files = "LICENSE README.md test examples"
  30. `cp -r #{files} #{target}`
  31. end