1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00

Make 'ragel' task actually work

This commit is contained in:
Luis Lavena 2012-01-08 15:53:28 -03:00
parent a4a346877b
commit 3e98339c31

View file

@ -16,6 +16,7 @@ HOE = Hoe.spec "puma" do
end
# puma.gemspec
file "#{HOE.spec.name}.gemspec" => ['Rakefile'] do |t|
puts "Generating #{t.name}"
File.open(t.name, 'wb') { |f| f.write HOE.spec.to_ruby }
@ -24,6 +25,28 @@ end
desc "Generate or update the standalone gemspec file for the project"
task :gemspec => ["#{HOE.spec.name}.gemspec"]
# generate extension code using Ragel (C and Java)
desc "Generate extension code (C and Java) using Ragel"
task :ragel
file 'ext/puma_http11/http11_parser.c' => ['ext/puma_http11/http11_parser.rl'] do |t|
begin
sh "ragel #{t.prerequisites.last} -C -G2 -I ext/puma_http11 -o #{t.name}"
rescue
fail "Could not build wrapper using Ragel (it failed or not installed?)"
end
end
task :ragel => ['ext/puma_http11/http11_parser.c']
file 'ext/puma_http11/org/jruby/puma/Http11Parser.java' => ['ext/puma_http11/http11_parser.java.rl'] do |t|
begin
sh "ragel #{t.prerequisites.last} -J -G2 -I ext/puma_http11 -o #{t.name}"
rescue
fail "Could not build wrapper using Ragel (it failed or not installed?)"
end
end
task :ragel => ['ext/puma_http11/org/jruby/puma/Http11Parser.java']
# tests require extension be compiled
task :test => [:compile]