Rakefile 978 B

12345678910111213141516171819202122232425262728293031323334
  1. # encoding: UTF-8
  2. require "bundler/gem_tasks"
  3. require 'rake/testtask'
  4. require 'rdoc/task'
  5. desc 'Default: run tests for all ORMs.'
  6. task :default => :test
  7. desc 'Run Devise tests for all ORMs.'
  8. task :pre_commit do
  9. Dir[File.join(File.dirname(__FILE__), 'test', 'orm', '*.rb')].each do |file|
  10. orm = File.basename(file).split(".").first
  11. # "Some day, my son, rake's inner wisdom will reveal itself. Until then,
  12. # take this `system` -- may its brute force protect you well."
  13. exit 1 unless system "rake test DEVISE_ORM=#{orm}"
  14. end
  15. end
  16. desc 'Run Devise unit tests.'
  17. Rake::TestTask.new(:test) do |t|
  18. t.libs << 'lib'
  19. t.libs << 'test'
  20. t.pattern = 'test/**/*_test.rb'
  21. t.verbose = true
  22. end
  23. desc 'Generate documentation for Devise.'
  24. Rake::RDocTask.new(:rdoc) do |rdoc|
  25. rdoc.rdoc_dir = 'rdoc'
  26. rdoc.title = 'Devise'
  27. rdoc.options << '--line-numbers' << '--inline-source'
  28. rdoc.rdoc_files.include('README.md')
  29. rdoc.rdoc_files.include('lib/**/*.rb')
  30. end