rakefile.rb 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. namespace 'run' do
  2. desc "compiles and runs the spelling-sharelatex server"
  3. task :app => ["compile:app"] do
  4. sh %{node app.js | bunyan}
  5. end
  6. end
  7. namespace 'compile' do
  8. desc "compiles application files"
  9. task :app do
  10. FileUtils.rm_rf "app/js"
  11. sh %{coffee -c -o app/js/ app/coffee/} do |ok, res|
  12. if ! ok
  13. raise "error compiling app folder tests : #{res}"
  14. end
  15. puts 'finished app/coffee compile'
  16. end
  17. sh %{coffee -c app.coffee} do |ok, res|
  18. if ! ok
  19. raise "error compiling root app file: #{res}"
  20. end
  21. puts 'finished app.coffee compile'
  22. end
  23. end
  24. desc "compiles unit tests"
  25. task :unit_tests => ["compile:app"] do
  26. FileUtils.rm_rf "test/UnitTests/js"
  27. puts "Compiling Unit Tests to JS"
  28. sh %{coffee -c -o test/UnitTests/js/ test/UnitTests/coffee/} do |ok, res|
  29. if ! ok
  30. raise "error compiling tests : #{res}"
  31. end
  32. puts 'finished unit tests compile'
  33. end
  34. end
  35. end
  36. namespace 'test' do
  37. desc "Run Unit Tests"
  38. task :unit => ["compile:unit_tests"]do
  39. puts "Running Unit Tests"
  40. sh %{mocha -R spec test/UnitTests/js/*} do |ok, res|
  41. if ! ok
  42. raise "error running unit tests : #{res}"
  43. end
  44. end
  45. end
  46. end