2009-10-20 22:21:06 -04:00
|
|
|
# encoding: UTF-8
|
2017-12-21 12:36:29 -05:00
|
|
|
# frozen_string_literal: true
|
2015-03-26 18:47:20 -04:00
|
|
|
|
|
|
|
require 'bundler/gem_tasks'
|
2009-09-17 08:24:33 -04:00
|
|
|
require 'rake/testtask'
|
2011-07-01 19:37:21 -04:00
|
|
|
require 'rdoc/task'
|
2009-09-17 08:24:33 -04:00
|
|
|
|
2009-12-21 15:10:23 -05:00
|
|
|
desc 'Default: run tests for all ORMs.'
|
2014-02-25 12:25:55 -05:00
|
|
|
task default: :test
|
2009-09-17 08:24:33 -04:00
|
|
|
|
2009-12-21 15:10:23 -05:00
|
|
|
desc 'Run Devise tests for all ORMs.'
|
|
|
|
task :pre_commit do
|
|
|
|
Dir[File.join(File.dirname(__FILE__), 'test', 'orm', '*.rb')].each do |file|
|
|
|
|
orm = File.basename(file).split(".").first
|
2011-01-11 11:27:44 -05:00
|
|
|
# "Some day, my son, rake's inner wisdom will reveal itself. Until then,
|
|
|
|
# take this `system` -- may its brute force protect you well."
|
|
|
|
exit 1 unless system "rake test DEVISE_ORM=#{orm}"
|
2009-12-21 15:10:23 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
desc 'Run Devise unit tests.'
|
2009-09-17 08:24:33 -04:00
|
|
|
Rake::TestTask.new(:test) do |t|
|
|
|
|
t.libs << 'lib'
|
|
|
|
t.libs << 'test'
|
|
|
|
t.pattern = 'test/**/*_test.rb'
|
|
|
|
t.verbose = true
|
2013-05-07 10:22:06 -04:00
|
|
|
t.warning = false
|
2009-09-17 08:24:33 -04:00
|
|
|
end
|
|
|
|
|
2009-10-20 22:21:06 -04:00
|
|
|
desc 'Generate documentation for Devise.'
|
2009-09-17 08:24:33 -04:00
|
|
|
Rake::RDocTask.new(:rdoc) do |rdoc|
|
|
|
|
rdoc.rdoc_dir = 'rdoc'
|
|
|
|
rdoc.title = 'Devise'
|
|
|
|
rdoc.options << '--line-numbers' << '--inline-source'
|
2012-06-07 21:47:42 -04:00
|
|
|
rdoc.rdoc_files.include('README.md')
|
2009-09-17 08:24:33 -04:00
|
|
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
2011-02-06 16:19:15 -05:00
|
|
|
end
|