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 година
123456789101112131415161718192021222324252627282930313233343536373839
  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. def templated_build(name, opts={})
  11. # Create a rule that uses the .tmpl.{pre,post} stuff to make a final, wrapped, output file.
  12. # There is some extra complexity because Dojo and YUI3 use different template files and final locations.
  13. short = name.downcase
  14. source = "mustache-#{short}"
  15. dependencies = ["mustache.js"] + Dir.glob("#{source}/*.tpl.*")
  16. desc "Package for #{name}"
  17. task short.to_sym => dependencies do
  18. target_js = opts[:location] ? "mustache.js" : "#{short}.mustache.js"
  19. puts "Packaging for #{name}"
  20. sh "mkdir -p #{opts[:location]}" if opts[:location]
  21. sh "cat #{source}/#{target_js}.tpl.pre mustache.js #{source}/#{target_js}.tpl.post > #{opts[:location] || '.'}/#{target_js}"
  22. end
  23. end
  24. templated_build "CommonJS"
  25. templated_build "jQuery"
  26. templated_build "Dojo", :location => "dojox/string"
  27. templated_build "YUI3", :location => "yui3/mustache"
  28. desc "Remove temporary files."
  29. task :clean do
  30. sh "git clean -fdx"
  31. end