forked from typhoeus/typhoeus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
43 lines (35 loc) · 862 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
43
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new do |t|
end
task :install do
rm_rf "*.gem"
puts `gem build typhoeus.gemspec`
puts `gem install typhoeus-#{Typhoeus::VERSION}.gem`
end
desc "Builds the native code"
task :build_native do
system("cd ext/typhoeus && ruby extconf.rb && make clean && make")
end
desc "Start up the test servers"
task :start_test_servers do
puts "Starting 3 test servers"
pids = []
[3000, 3001, 3002].each do |port|
if pid = fork
pids << pid
else
exec('ruby', 'spec/servers/app.rb', '-p', port.to_s)
end
end
at_exit do
pids.each do |pid|
puts "Killing pid #{pid}"
Process.kill("KILL", pid)
end
end
# Wait for kill.
sleep
end
desc "Build Typhoeus and run all the tests."
task :default => [:build_native, :spec]