2010-05-30 23:18:57 -04:00
|
|
|
require "rubygems"
|
|
|
|
require "bundler"
|
|
|
|
Bundler.setup
|
|
|
|
|
2009-02-26 23:42:20 -05:00
|
|
|
require 'rake'
|
|
|
|
|
|
|
|
begin
|
|
|
|
require 'jeweler'
|
|
|
|
Jeweler::Tasks.new do |s|
|
|
|
|
s.name = "database_cleaner"
|
2009-05-08 23:52:37 -04:00
|
|
|
s.summary = %Q{Strategies for cleaning databases. Can be used to ensure a clean state for testing.}
|
2009-02-26 23:42:20 -05:00
|
|
|
s.email = "ben@benmabey.com"
|
|
|
|
s.homepage = "http://github.com/bmabey/database_cleaner"
|
2009-05-08 23:52:37 -04:00
|
|
|
s.description = "Strategies for cleaning databases. Can be used to ensure a clean state for testing."
|
2009-03-04 23:48:20 -05:00
|
|
|
s.files = FileList["[A-Z]*.*", "{examples,lib,features,spec}/**/*", "Rakefile", "cucumber.yml"]
|
2009-02-26 23:42:20 -05:00
|
|
|
s.authors = ["Ben Mabey"]
|
|
|
|
end
|
|
|
|
rescue LoadError
|
|
|
|
puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
|
|
|
|
end
|
|
|
|
|
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 10:18:35 -04:00
|
|
|
RSpec::Core::RakeTask.new(:travis) do |spec|
|
|
|
|
spec.pattern = FileList['spec/travis.rb']
|
|
|
|
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
|
|
|
|
|
|
|
|
begin
|
|
|
|
require 'cucumber/rake/task'
|
|
|
|
Cucumber::Rake::Task.new(:features)
|
|
|
|
rescue LoadError
|
|
|
|
puts "Cucumber is not available. In order to run features, you must: sudo gem install cucumber"
|
|
|
|
end
|
|
|
|
|
2009-05-08 20:46:52 -04:00
|
|
|
task :default => [:spec, :features]
|
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]
|