2010-05-30 23:18:57 -04:00
|
|
|
require "rubygems"
|
|
|
|
require "bundler"
|
2020-01-29 18:56:34 -05:00
|
|
|
require "bundler/gem_tasks"
|
2010-05-30 23:18:57 -04:00
|
|
|
Bundler.setup
|
|
|
|
|
2009-02-26 23:42:20 -05:00
|
|
|
require 'rake'
|
2012-07-08 06:51:27 -04:00
|
|
|
require 'rspec/core'
|
|
|
|
require 'rspec/core/rake_task'
|
|
|
|
RSpec::Core::RakeTask.new(:spec) do |spec|
|
|
|
|
spec.pattern = FileList['spec/**/*_spec.rb']
|
2009-02-26 23:42:20 -05:00
|
|
|
end
|
|
|
|
|
2012-07-08 06:51:27 -04:00
|
|
|
RSpec::Core::RakeTask.new(:rcov) do |spec|
|
|
|
|
spec.pattern = 'spec/**/*_spec.rb'
|
|
|
|
spec.rcov = true
|
2009-02-26 23:42:20 -05:00
|
|
|
end
|
|
|
|
|
2018-05-25 22:41:12 -04:00
|
|
|
require 'cucumber/rake/task'
|
|
|
|
Cucumber::Rake::Task.new(:features)
|
2009-02-26 23:42:20 -05:00
|
|
|
|
2018-05-25 22:41:12 -04:00
|
|
|
desc "Run adapter test suites"
|
|
|
|
task :adapters do
|
|
|
|
Dir["adapters/*"].each do |adapter_dir|
|
|
|
|
Dir.chdir adapter_dir do
|
|
|
|
sh "bundle exec rake"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2011-02-04 11:32:30 -05:00
|
|
|
|
2018-05-25 22:41:12 -04:00
|
|
|
task :default => [:spec, :features, :adapters]
|
2011-02-04 11:32:30 -05:00
|
|
|
|
|
|
|
desc "Cleans the project of any tmp file that should not be included in the gemspec."
|
|
|
|
task :clean do
|
|
|
|
["examples/config/database.yml", "examples/db/activerecord_one.db", "examples/db/activerecord_two.db", "examples/db/datamapper_default.db",
|
|
|
|
"examples/db/datamapper_one.db", "examples/db/datamapper_two.db"].each do |f|
|
|
|
|
FileUtils.rm_f(f)
|
|
|
|
end
|
2011-06-20 21:32:32 -04:00
|
|
|
%w[*.sqlite3 *.log #* *.swp *.swo].each do |pattern|
|
2011-02-04 11:32:30 -05:00
|
|
|
`find . -name "#{pattern}" -delete`
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
desc "Cleans the dir and builds the gem"
|
|
|
|
task :prep => [:clean, :gemspec, :build]
|