forked from goncalossilva/acts_as_paranoid
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Rakefile
executable file
·52 lines (43 loc) · 1.45 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
require "bundler/gem_tasks"
require "rake/testtask"
require "rdoc/task"
gemspec = eval(File.read(Dir["*.gemspec"].first))
desc 'Default: run unit tests.'
task :default => "test:all"
namespace :test do
%w(active_record_40 active_record_41 active_record_42 active_record_50).each do |version|
desc "Test acts_as_paranoid against #{version}"
task version do
sh "BUNDLE_GEMFILE='gemfiles/#{version}.gemfile' bundle install --quiet"
sh "BUNDLE_GEMFILE='gemfiles/#{version}.gemfile' bundle exec rake -t test"
end
end
desc "Run all tests for acts_as_paranoid"
task :all do
%w(active_record_40 active_record_41 active_record_42 active_record_50).each do |version|
sh "BUNDLE_GEMFILE='gemfiles/#{version}.gemfile' bundle install --quiet"
sh "BUNDLE_GEMFILE='gemfiles/#{version}.gemfile' bundle exec rake -t test"
end
end
end
Rake::TestTask.new(:test) do |t|
t.libs << 'test'
t.pattern = 'test/test_*.rb'
t.verbose = true
end
desc 'Generate documentation for the acts_as_paranoid plugin.'
Rake::RDocTask.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = 'ActsAsParanoid'
rdoc.options << '--line-numbers' << '--inline-source'
rdoc.rdoc_files.include('README')
rdoc.rdoc_files.include('lib/**/*.rb')
end
desc "Install gem locally"
task :install => :build do
system "gem install pkg/#{gemspec.name}-#{gemspec.version}"
end
desc "Clean automatically generated files"
task :clean do
FileUtils.rm_rf "pkg"
end