-
Notifications
You must be signed in to change notification settings - Fork 9
/
Rakefile
42 lines (36 loc) · 940 Bytes
/
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
require 'rake'
require 'rake/clean'
require 'rake/testtask'
CLEAN.include("**/*.gem", "**/*.rbc")
namespace 'gem' do
desc 'Build the windows-pr gem'
task :create => [:clean] do
spec = eval(IO.read('windows-pr.gemspec'))
if Gem::VERSION < "2.0"
Gem::Builder.new(spec).build
else
require 'rubygems/package'
Gem::Package.build(spec)
end
end
desc 'Install the windows-pr gem'
task :install => [:create] do
file = Dir["*.gem"].first
sh "gem install -l #{file}"
end
end
namespace 'test' do
Rake::TestTask.new('all') do |t|
t.warning = true
t.test_files = FileList['test/helper.rb', 'test/tc*']
end
# Dynamically generate individual test tasks.
Dir['test/*.rb'].each{ |file|
name = File.basename(file.split('tc_').last, '.rb')
Rake::TestTask.new(name) do |t|
t.warning = true
t.test_files = FileList[file]
end
}
end
task :default => 'test:all'