forked from shuber/sortable
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
35 lines (31 loc) · 1.03 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
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
desc 'Default: run the sortable tests'
task :default => :test
namespace :test do
desc 'Test the sortable gem/plugin with all active record versions >= 2.0.0'
task :all do
versions = `gem list`.match(/activerecord \((.+)\)/).captures[0].split(/, /).select { |v| v[0,1].to_i > 1 }
versions.each do |version|
puts "\n============================================================="
puts "TESTING WITH ACTIVE RECORD VERSION #{version}\n\n"
system "rake test ACTIVE_RECORD_VERSION=#{version}"
puts "\n\n"
end
end
end
desc 'Test the sortable gem/plugin.'
Rake::TestTask.new(:test) do |t|
t.libs << 'lib'
t.pattern = 'test/*_test.rb'
t.verbose = true
end
desc 'Generate documentation for the sortable gem/plugin.'
Rake::RDocTask.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = 'sortable'
rdoc.options << '--line-numbers' << '--inline-source'
rdoc.rdoc_files.include('README.rdoc')
rdoc.rdoc_files.include('lib/**/*.rb')
end