test_exec: fix for temporary files not being cleaned
[unicorn.git] / Rakefile
blobb350f744d7e1bececbb96e927f8020245a2df994
2 require 'rubygems'
3 require 'echoe'
5 Echoe.new("unicorn") do |p|
6   p.summary = "A small fast HTTP library and server for Rack applications."
7   p.author = "Eric Wong"
8   p.email = "normalperson@yhbt.net"
9   p.clean_pattern = ['ext/http11/*.{bundle,so,o,obj,pdb,lib,def,exp}', 'lib/*.{bundle,so,o,obj,pdb,lib,def,exp}', 'ext/http11/Makefile', 'pkg', 'lib/*.bundle', '*.gem', 'site/output', '.config', 'coverage', 'test_*.log', 'log', 'doc']
10   p.url = "http://unicorn.bogomips.org"
11   p.rdoc_pattern = ['README', 'LICENSE', 'CONTRIBUTORS', 'CHANGELOG', 'COPYING', 'lib/**/*.rb', 'doc/**/*.rdoc']
12   p.ignore_pattern = /^(pkg|site|projects|doc|log)|CVS|\.log/
13   p.need_tar_gz = false
14   p.need_tgz = true
16   p.extension_pattern = ["ext/**/extconf.rb"]
18   # Eric hasn't bothered to figure out running exec tests properly
19   # from Rake, but Eric prefers GNU make to Rake for tests anyways...
20   p.test_pattern = [ 'test/unit/test*.rb' ]
21 end
23 #### Ragel builder
25 desc "Rebuild the Ragel sources"
26 task :ragel do
27   Dir.chdir "ext/http11" do
28     target = "http11_parser.c"
29     File.unlink target if File.exist? target
30     sh "ragel http11_parser.rl -C -G2 -o #{target}"
31     raise "Failed to build C source" unless File.exist? target
32   end
33 end
35 #### Pre-compiled extensions for alternative platforms
37 def move_extensions
38   Dir["ext/**/*.#{Config::CONFIG['DLEXT']}"].each { |file| mv file, "lib/" }
39 end