headius-mongrel 1.1.6.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +21 -0
- data/COPYING +55 -0
- data/LICENSE +55 -0
- data/Manifest +69 -0
- data/README +74 -0
- data/Rakefile +202 -0
- data/TODO +5 -0
- data/bin/mongrel_rails +283 -0
- data/examples/builder.rb +29 -0
- data/examples/camping/README +3 -0
- data/examples/camping/blog.rb +294 -0
- data/examples/camping/tepee.rb +149 -0
- data/examples/httpd.conf +474 -0
- data/examples/mime.yaml +3 -0
- data/examples/mongrel.conf +9 -0
- data/examples/mongrel_simple_ctrl.rb +92 -0
- data/examples/mongrel_simple_service.rb +116 -0
- data/examples/monitrc +57 -0
- data/examples/random_thrash.rb +19 -0
- data/examples/simpletest.rb +52 -0
- data/examples/webrick_compare.rb +20 -0
- data/ext/http11/ext_help.h +14 -0
- data/ext/http11/extconf.rb +6 -0
- data/ext/http11/http11.c +402 -0
- data/ext/http11/http11_parser.c +1221 -0
- data/ext/http11/http11_parser.h +49 -0
- data/ext/http11/http11_parser.java.rl +170 -0
- data/ext/http11/http11_parser.rl +152 -0
- data/ext/http11/http11_parser_common.rl +54 -0
- data/ext/http11_java/Http11Service.java +13 -0
- data/ext/http11_java/org/jruby/mongrel/Http11.java +353 -0
- data/ext/http11_java/org/jruby/mongrel/Http11Parser.java +572 -0
- data/lib/mongrel.rb +364 -0
- data/lib/mongrel/camping.rb +107 -0
- data/lib/mongrel/cgi.rb +181 -0
- data/lib/mongrel/command.rb +222 -0
- data/lib/mongrel/configurator.rb +388 -0
- data/lib/mongrel/const.rb +110 -0
- data/lib/mongrel/debug.rb +203 -0
- data/lib/mongrel/gems.rb +22 -0
- data/lib/mongrel/handlers.rb +468 -0
- data/lib/mongrel/header_out.rb +28 -0
- data/lib/mongrel/http_request.rb +155 -0
- data/lib/mongrel/http_response.rb +163 -0
- data/lib/mongrel/init.rb +10 -0
- data/lib/mongrel/mime_types.yml +616 -0
- data/lib/mongrel/rails.rb +192 -0
- data/lib/mongrel/stats.rb +89 -0
- data/lib/mongrel/tcphack.rb +18 -0
- data/lib/mongrel/uri_classifier.rb +76 -0
- data/mongrel-public_cert.pem +20 -0
- data/mongrel.gemspec +47 -0
- data/setup.rb +1585 -0
- data/test/mime.yaml +3 -0
- data/test/mongrel.conf +1 -0
- data/test/test_cgi_wrapper.rb +26 -0
- data/test/test_command.rb +86 -0
- data/test/test_conditional.rb +107 -0
- data/test/test_configurator.rb +88 -0
- data/test/test_debug.rb +25 -0
- data/test/test_handlers.rb +126 -0
- data/test/test_http11.rb +156 -0
- data/test/test_redirect_handler.rb +45 -0
- data/test/test_request_progress.rb +100 -0
- data/test/test_response.rb +127 -0
- data/test/test_stats.rb +35 -0
- data/test/test_uriclassifier.rb +261 -0
- data/test/test_ws.rb +115 -0
- data/test/testhelp.rb +79 -0
- data/tools/trickletest.rb +45 -0
- metadata +199 -0
data/CHANGELOG
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
v1.1.6.1. HTTP keepalive support (experimental)
|
2
|
+
|
3
|
+
v1.1.6. Optimizations, threading patch, and cleanup for JRuby
|
4
|
+
|
5
|
+
v1.1.5. Fix bug where num_processors is not actually set from mongrel_rails.
|
6
|
+
|
7
|
+
v1.1.4. Fix camping handler. Correct treatment of @throttle parameter.
|
8
|
+
|
9
|
+
v1.1.3. Fix security flaw of DirHandler; reported on mailing list.
|
10
|
+
|
11
|
+
v1.1.2. Fix worker termination bug; fix JRuby 1.0.3 load order issue; fix require issue on systems without Rubygems.
|
12
|
+
|
13
|
+
v1.1.1. Fix mongrel_rails restart bug; fix bug with Rack status codes.
|
14
|
+
|
15
|
+
v1.1. Pure Ruby URIClassifier. More modular architecture. JRuby support. Move C URIClassifier into mongrel_experimental project.
|
16
|
+
|
17
|
+
v1.0.4. Backport fixes for versioning inconsistency, mongrel_rails bug, and DirHandler bug.
|
18
|
+
|
19
|
+
v1.0.3. Fix user-switching bug; make people upgrade to the latest from the RC.
|
20
|
+
|
21
|
+
v1.0.2. Signed gem; many minor bugfixes and patches.
|
data/COPYING
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
Mongrel Web Server (Mongrel) is copyrighted free software by Zed A. Shaw
|
2
|
+
<zedshaw at zedshaw dot com> You can redistribute it and/or modify it under
|
3
|
+
either the terms of the GPL or the conditions below:
|
4
|
+
|
5
|
+
1. You may make and give away verbatim copies of the source form of the
|
6
|
+
software without restriction, provided that you duplicate all of the
|
7
|
+
original copyright notices and associated disclaimers.
|
8
|
+
|
9
|
+
2. You may modify your copy of the software in any way, provided that
|
10
|
+
you do at least ONE of the following:
|
11
|
+
|
12
|
+
a) place your modifications in the Public Domain or otherwise make them
|
13
|
+
Freely Available, such as by posting said modifications to Usenet or an
|
14
|
+
equivalent medium, or by allowing the author to include your
|
15
|
+
modifications in the software.
|
16
|
+
|
17
|
+
b) use the modified software only within your corporation or
|
18
|
+
organization.
|
19
|
+
|
20
|
+
c) rename any non-standard executables so the names do not conflict with
|
21
|
+
standard executables, which must also be provided.
|
22
|
+
|
23
|
+
d) make other distribution arrangements with the author.
|
24
|
+
|
25
|
+
3. You may distribute the software in object code or executable
|
26
|
+
form, provided that you do at least ONE of the following:
|
27
|
+
|
28
|
+
a) distribute the executables and library files of the software,
|
29
|
+
together with instructions (in the manual page or equivalent) on where
|
30
|
+
to get the original distribution.
|
31
|
+
|
32
|
+
b) accompany the distribution with the machine-readable source of the
|
33
|
+
software.
|
34
|
+
|
35
|
+
c) give non-standard executables non-standard names, with
|
36
|
+
instructions on where to get the original software distribution.
|
37
|
+
|
38
|
+
d) make other distribution arrangements with the author.
|
39
|
+
|
40
|
+
4. You may modify and include the part of the software into any other
|
41
|
+
software (possibly commercial). But some files in the distribution
|
42
|
+
are not written by the author, so that they are not under this terms.
|
43
|
+
|
44
|
+
5. The scripts and library files supplied as input to or produced as
|
45
|
+
output from the software do not automatically fall under the
|
46
|
+
copyright of the software, but belong to whomever generated them,
|
47
|
+
and may be sold commercially, and may be aggregated with this
|
48
|
+
software.
|
49
|
+
|
50
|
+
6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
|
51
|
+
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
52
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
53
|
+
PURPOSE.
|
54
|
+
|
55
|
+
|
data/LICENSE
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
Mongrel Web Server (Mongrel) is copyrighted free software by Zed A. Shaw
|
2
|
+
<zedshaw at zedshaw dot com> and contributors. You can redistribute it
|
3
|
+
and/or modify it under either the terms of the GPL2 or the conditions below:
|
4
|
+
|
5
|
+
1. You may make and give away verbatim copies of the source form of the
|
6
|
+
software without restriction, provided that you duplicate all of the
|
7
|
+
original copyright notices and associated disclaimers.
|
8
|
+
|
9
|
+
2. You may modify your copy of the software in any way, provided that
|
10
|
+
you do at least ONE of the following:
|
11
|
+
|
12
|
+
a) place your modifications in the Public Domain or otherwise make them
|
13
|
+
Freely Available, such as by posting said modifications to Usenet or an
|
14
|
+
equivalent medium, or by allowing the author to include your
|
15
|
+
modifications in the software.
|
16
|
+
|
17
|
+
b) use the modified software only within your corporation or
|
18
|
+
organization.
|
19
|
+
|
20
|
+
c) rename any non-standard executables so the names do not conflict with
|
21
|
+
standard executables, which must also be provided.
|
22
|
+
|
23
|
+
d) make other distribution arrangements with the author.
|
24
|
+
|
25
|
+
3. You may distribute the software in object code or executable
|
26
|
+
form, provided that you do at least ONE of the following:
|
27
|
+
|
28
|
+
a) distribute the executables and library files of the software,
|
29
|
+
together with instructions (in the manual page or equivalent) on where
|
30
|
+
to get the original distribution.
|
31
|
+
|
32
|
+
b) accompany the distribution with the machine-readable source of the
|
33
|
+
software.
|
34
|
+
|
35
|
+
c) give non-standard executables non-standard names, with
|
36
|
+
instructions on where to get the original software distribution.
|
37
|
+
|
38
|
+
d) make other distribution arrangements with the author.
|
39
|
+
|
40
|
+
4. You may modify and include the part of the software into any other
|
41
|
+
software (possibly commercial). But some files in the distribution
|
42
|
+
are not written by the author, so that they are not under this terms.
|
43
|
+
|
44
|
+
5. The scripts and library files supplied as input to or produced as
|
45
|
+
output from the software do not automatically fall under the
|
46
|
+
copyright of the software, but belong to whomever generated them,
|
47
|
+
and may be sold commercially, and may be aggregated with this
|
48
|
+
software.
|
49
|
+
|
50
|
+
6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
|
51
|
+
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
52
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
53
|
+
PURPOSE.
|
54
|
+
|
55
|
+
|
data/Manifest
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
bin/mongrel_rails
|
2
|
+
CHANGELOG
|
3
|
+
COPYING
|
4
|
+
examples/builder.rb
|
5
|
+
examples/camping/blog.rb
|
6
|
+
examples/camping/README
|
7
|
+
examples/camping/tepee.rb
|
8
|
+
examples/httpd.conf
|
9
|
+
examples/mime.yaml
|
10
|
+
examples/mongrel.conf
|
11
|
+
examples/mongrel_simple_ctrl.rb
|
12
|
+
examples/mongrel_simple_service.rb
|
13
|
+
examples/monitrc
|
14
|
+
examples/random_thrash.rb
|
15
|
+
examples/simpletest.rb
|
16
|
+
examples/webrick_compare.rb
|
17
|
+
ext/http11/ext_help.h
|
18
|
+
ext/http11/extconf.rb
|
19
|
+
ext/http11/http11.c
|
20
|
+
ext/http11/http11_parser.c
|
21
|
+
ext/http11/http11_parser.h
|
22
|
+
ext/http11/http11_parser.java.rl
|
23
|
+
ext/http11/http11_parser.rl
|
24
|
+
ext/http11/http11_parser_common.rl
|
25
|
+
ext/http11_java/Http11Service.java
|
26
|
+
ext/http11_java/org/jruby/mongrel/Http11.java
|
27
|
+
ext/http11_java/org/jruby/mongrel/Http11Parser.java
|
28
|
+
lib/mongrel/camping.rb
|
29
|
+
lib/mongrel/cgi.rb
|
30
|
+
lib/mongrel/command.rb
|
31
|
+
lib/mongrel/configurator.rb
|
32
|
+
lib/mongrel/const.rb
|
33
|
+
lib/mongrel/debug.rb
|
34
|
+
lib/mongrel/gems.rb
|
35
|
+
lib/mongrel/handlers.rb
|
36
|
+
lib/mongrel/header_out.rb
|
37
|
+
lib/mongrel/http_request.rb
|
38
|
+
lib/mongrel/http_response.rb
|
39
|
+
lib/mongrel/init.rb
|
40
|
+
lib/mongrel/mime_types.yml
|
41
|
+
lib/mongrel/rails.rb
|
42
|
+
lib/mongrel/stats.rb
|
43
|
+
lib/mongrel/tcphack.rb
|
44
|
+
lib/mongrel/uri_classifier.rb
|
45
|
+
lib/mongrel.rb
|
46
|
+
LICENSE
|
47
|
+
Manifest
|
48
|
+
mongrel-public_cert.pem
|
49
|
+
mongrel.gemspec
|
50
|
+
README
|
51
|
+
setup.rb
|
52
|
+
test/mime.yaml
|
53
|
+
test/mongrel.conf
|
54
|
+
test/test_cgi_wrapper.rb
|
55
|
+
test/test_command.rb
|
56
|
+
test/test_conditional.rb
|
57
|
+
test/test_configurator.rb
|
58
|
+
test/test_debug.rb
|
59
|
+
test/test_handlers.rb
|
60
|
+
test/test_http11.rb
|
61
|
+
test/test_redirect_handler.rb
|
62
|
+
test/test_request_progress.rb
|
63
|
+
test/test_response.rb
|
64
|
+
test/test_stats.rb
|
65
|
+
test/test_uriclassifier.rb
|
66
|
+
test/test_ws.rb
|
67
|
+
test/testhelp.rb
|
68
|
+
TODO
|
69
|
+
tools/trickletest.rb
|
data/README
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
= Mongrel: Simple Fast Mostly Ruby Web Server
|
2
|
+
|
3
|
+
Mongrel is a small library that provides a very fast HTTP 1.1 server for Ruby web applications. It is not particular to any framework, and is intended to be just enough to get a web application running behind a more complete and robust web server.
|
4
|
+
|
5
|
+
What makes Mongrel so fast is the careful use of an Ragel extension to provide fast, accurate HTTP 1.1 protocol parsing. This makes the server scream without too many portability issues.
|
6
|
+
|
7
|
+
See http://mongrel.rubyforge.org for more information.
|
8
|
+
|
9
|
+
== License
|
10
|
+
|
11
|
+
Mongrel is copyright 2007 Zed A. Shaw and contributors. It is licensed under the Ruby license and the GPL2. See the include LICENSE file for details.
|
12
|
+
|
13
|
+
== Quick Start
|
14
|
+
|
15
|
+
The easiest way to get started with Mongrel is to install it via RubyGems and then run a Ruby on Rails application. You can do this easily:
|
16
|
+
|
17
|
+
$ gem install mongrel
|
18
|
+
|
19
|
+
Now you should have the mongrel_rails command available in your PATH, so just do the following:
|
20
|
+
|
21
|
+
$ cd myrailsapp
|
22
|
+
$ mongrel_rails start
|
23
|
+
|
24
|
+
This will start it in the foreground so you can play with it. It runs your application in production mode. To get help do:
|
25
|
+
|
26
|
+
$ mongrel_rails start -h
|
27
|
+
|
28
|
+
Finally, you can then start in background mode:
|
29
|
+
|
30
|
+
$ mongrel_rails start -d
|
31
|
+
|
32
|
+
And you can stop it whenever you like with:
|
33
|
+
|
34
|
+
$ mongrel_rails stop
|
35
|
+
|
36
|
+
All of which should be done from your application's directory. It writes the PID of the process you ran into log/mongrel.pid.
|
37
|
+
|
38
|
+
There are also many more new options for configuring the rails runner including changing to a different directory, adding more MIME types, and setting processor threads and timeouts.
|
39
|
+
|
40
|
+
== Install
|
41
|
+
|
42
|
+
It doesn't explicitly require Camping, but if you want to run the examples/camping/ examples then you'll need to install Camping 1.2 at least (and redcloth I think). These are all available from RubyGems.
|
43
|
+
|
44
|
+
The library consists of a C extension so you'll need a C compiler or at least a friend who can build it for you.
|
45
|
+
|
46
|
+
Finally, the source includes a setup.rb for those who hate RubyGems.
|
47
|
+
|
48
|
+
== Usage
|
49
|
+
|
50
|
+
The examples/simpletest.rb file has the following code as the simplest example:
|
51
|
+
|
52
|
+
require 'mongrel'
|
53
|
+
|
54
|
+
class SimpleHandler < Mongrel::HttpHandler
|
55
|
+
def process(request, response)
|
56
|
+
response.start(200) do |head,out|
|
57
|
+
head["Content-Type"] = "text/plain"
|
58
|
+
out.write("hello!\n")
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
h = Mongrel::HttpServer.new("0.0.0.0", "3000")
|
64
|
+
h.register("/test", SimpleHandler.new)
|
65
|
+
h.register("/files", Mongrel::DirHandler.new("."))
|
66
|
+
h.run.join
|
67
|
+
|
68
|
+
If you run this and access port 3000 with a browser it will say "hello!". If you access it with any url other than "/test" it will give a simple 404. Check out the Mongrel::Error404Handler for a basic way to give a more complex 404 message.
|
69
|
+
|
70
|
+
This also shows the DirHandler with directory listings. This is still rough but it should work for basic hosting. *File extension to mime type mapping is missing though.*
|
71
|
+
|
72
|
+
== Contact
|
73
|
+
|
74
|
+
E-mail the Mongrel list at http://rubyforge.org/mailman/listinfo/mongrel-users and someone will help you. Comments about the API are welcome.
|
data/Rakefile
ADDED
@@ -0,0 +1,202 @@
|
|
1
|
+
|
2
|
+
require 'rubygems'
|
3
|
+
gem 'echoe', '>=2.7.5'
|
4
|
+
require 'echoe'
|
5
|
+
|
6
|
+
e = Echoe.new("mongrel") do |p|
|
7
|
+
p.summary = "A small fast HTTP library and server that runs Rails, Camping, Nitro and Iowa apps."
|
8
|
+
p.author ="Zed A. Shaw"
|
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', 'lib/http11.jar', 'ext/http11_java/classes', 'coverage', 'doc']
|
10
|
+
p.url = "http://mongrel.rubyforge.org"
|
11
|
+
p.rdoc_pattern = ['README', 'LICENSE', 'CHANGELOG', 'COPYING', 'lib/**/*.rb', 'doc/**/*.rdoc']
|
12
|
+
p.docs_host = 'mongrel.cloudbur.st:/home/eweaver/www/mongrel/htdocs/web'
|
13
|
+
p.ignore_pattern = /^(pkg|site|projects|doc|log)|CVS|\.log/
|
14
|
+
p.ruby_version = '>=1.8.4'
|
15
|
+
p.dependencies = ['gem_plugin >=0.2.3']
|
16
|
+
p.extension_pattern = nil
|
17
|
+
|
18
|
+
p.certificate_chain = case ENV['USER'] || ENV['USERNAME']
|
19
|
+
when 'eweaver'
|
20
|
+
['~/p/configuration/gem_certificates/mongrel/mongrel-public_cert.pem',
|
21
|
+
'~/p/configuration/gem_certificates/evan_weaver-mongrel-public_cert.pem']
|
22
|
+
when 'Luis', 'luislavena'
|
23
|
+
['~/projects/gem_certificates/mongrel-public_cert.pem',
|
24
|
+
'~/projects/gem_certificates/luislavena-mongrel-public_cert.pem']
|
25
|
+
end
|
26
|
+
|
27
|
+
p.need_tar_gz = false
|
28
|
+
p.need_tgz = true
|
29
|
+
|
30
|
+
if RUBY_PLATFORM !~ /mswin|mingw|java/
|
31
|
+
p.extension_pattern = ["ext/**/extconf.rb"]
|
32
|
+
end
|
33
|
+
|
34
|
+
p.eval = proc do
|
35
|
+
case RUBY_PLATFORM
|
36
|
+
when /mswin|mingw/
|
37
|
+
self.files += ['lib/http11.so']
|
38
|
+
self.platform = Gem::Platform::CURRENT
|
39
|
+
add_dependency('cgi_multipart_eof_fix', '>= 2.4')
|
40
|
+
when /java/
|
41
|
+
self.files += ['lib/http11.jar']
|
42
|
+
self.platform = 'jruby' # XXX Is this right?
|
43
|
+
else
|
44
|
+
add_dependency('daemons', '>= 1.0.3')
|
45
|
+
add_dependency('fastthread', '>= 1.0.1')
|
46
|
+
add_dependency('cgi_multipart_eof_fix', '>= 2.4')
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
end
|
51
|
+
|
52
|
+
#### Ragel builder
|
53
|
+
|
54
|
+
desc "Rebuild the Ragel sources"
|
55
|
+
task :ragel do
|
56
|
+
Dir.chdir "ext/http11" do
|
57
|
+
target = "http11_parser.c"
|
58
|
+
File.unlink target if File.exist? target
|
59
|
+
sh "ragel http11_parser.rl | rlgen-cd -G2 -o #{target}"
|
60
|
+
raise "Failed to build C source" unless File.exist? target
|
61
|
+
end
|
62
|
+
Dir.chdir "ext/http11" do
|
63
|
+
target = "../../ext/http11_java/org/jruby/mongrel/Http11Parser.java"
|
64
|
+
File.unlink target if File.exist? target
|
65
|
+
sh "ragel -J http11_parser.java.rl | rlgen-java -o #{target}"
|
66
|
+
raise "Failed to build Java source" unless File.exist? target
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
#### Pre-compiled extensions for alternative platforms
|
71
|
+
|
72
|
+
def move_extensions
|
73
|
+
Dir["ext/**/*.#{Config::CONFIG['DLEXT']}"].each { |file| mv file, "lib/" }
|
74
|
+
end
|
75
|
+
|
76
|
+
def java_classpath_arg
|
77
|
+
# A myriad of ways to discover the JRuby classpath
|
78
|
+
classpath = begin
|
79
|
+
require 'java'
|
80
|
+
# Already running in a JRuby JVM
|
81
|
+
Java::java.lang.System.getProperty('java.class.path')
|
82
|
+
rescue LoadError
|
83
|
+
ENV['JRUBY_PARENT_CLASSPATH'] || ENV['JRUBY_HOME'] && FileList["#{ENV['JRUBY_HOME']}/lib/*.jar"].join(File::PATH_SEPARATOR)
|
84
|
+
end
|
85
|
+
classpath ? "-cp #{classpath}" : ""
|
86
|
+
end
|
87
|
+
|
88
|
+
case RUBY_PLATFORM
|
89
|
+
when /mswin|mingw/
|
90
|
+
filename = "lib/http11.so"
|
91
|
+
file filename do
|
92
|
+
Dir.chdir("ext/http11") do
|
93
|
+
ruby "extconf.rb"
|
94
|
+
system(PLATFORM =~ /mswin/ ? 'nmake' : 'make')
|
95
|
+
end
|
96
|
+
move_extensions
|
97
|
+
end
|
98
|
+
task :compile => [filename]
|
99
|
+
|
100
|
+
when /java/
|
101
|
+
|
102
|
+
# Avoid JRuby in-process launching problem
|
103
|
+
begin
|
104
|
+
require 'jruby'
|
105
|
+
JRuby.runtime.instance_config.run_ruby_in_process = false
|
106
|
+
rescue LoadError
|
107
|
+
end
|
108
|
+
|
109
|
+
filename = "lib/http11.jar"
|
110
|
+
file filename do
|
111
|
+
build_dir = "ext/http11_java/classes"
|
112
|
+
mkdir_p build_dir
|
113
|
+
sources = FileList['ext/http11_java/**/*.java'].join(' ')
|
114
|
+
sh "javac -target 1.4 -source 1.4 -d #{build_dir} #{java_classpath_arg} #{sources}"
|
115
|
+
sh "jar cf lib/http11.jar -C #{build_dir} ."
|
116
|
+
move_extensions
|
117
|
+
end
|
118
|
+
task :compile => [filename]
|
119
|
+
|
120
|
+
end
|
121
|
+
|
122
|
+
#### Project-wide install and uninstall tasks
|
123
|
+
|
124
|
+
def sub_project(project, *targets)
|
125
|
+
targets.each do |target|
|
126
|
+
Dir.chdir "projects/#{project}" do
|
127
|
+
unless RUBY_PLATFORM =~ /mswin/
|
128
|
+
sh("rake #{target.to_s}") # --trace
|
129
|
+
end
|
130
|
+
end
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
desc "Package Mongrel and all subprojects"
|
135
|
+
task :package_all => [:package] do
|
136
|
+
sub_project("gem_plugin", :package)
|
137
|
+
sub_project("cgi_multipart_eof_fix", :package)
|
138
|
+
sub_project("fastthread", :package)
|
139
|
+
sub_project("mongrel_status", :package)
|
140
|
+
sub_project("mongrel_upload_progress", :package)
|
141
|
+
sub_project("mongrel_console", :package)
|
142
|
+
sub_project("mongrel_cluster", :package)
|
143
|
+
sub_project("mongrel_experimental", :package)
|
144
|
+
|
145
|
+
sh("rake java package") unless RUBY_PLATFORM =~ /java/
|
146
|
+
|
147
|
+
# XXX Broken by RubyGems 0.9.5
|
148
|
+
# sub_project("mongrel_service", :package) if RUBY_PLATFORM =~ /mswin/
|
149
|
+
# sh("rake mswin package") unless RUBY_PLATFORM =~ /mswin/
|
150
|
+
end
|
151
|
+
|
152
|
+
task :install_requirements do
|
153
|
+
# These run before Mongrel is installed
|
154
|
+
sub_project("gem_plugin", :install)
|
155
|
+
sub_project("cgi_multipart_eof_fix", :install)
|
156
|
+
sub_project("fastthread", :install)
|
157
|
+
end
|
158
|
+
|
159
|
+
desc "for Mongrel and all subprojects"
|
160
|
+
task :install => [:install_requirements] do
|
161
|
+
# These run after Mongrel is installed
|
162
|
+
sub_project("mongrel_status", :install)
|
163
|
+
sub_project("mongrel_upload_progress", :install)
|
164
|
+
sub_project("mongrel_console", :install)
|
165
|
+
sub_project("mongrel_cluster", :install)
|
166
|
+
# sub_project("mongrel_experimental", :install)
|
167
|
+
sub_project("mongrel_service", :install) if RUBY_PLATFORM =~ /mswin|mingw/
|
168
|
+
end
|
169
|
+
|
170
|
+
desc "for Mongrel and all its subprojects"
|
171
|
+
task :uninstall => [:clean] do
|
172
|
+
sub_project("mongrel_status", :uninstall)
|
173
|
+
sub_project("cgi_multipart_eof_fix", :uninstall)
|
174
|
+
sub_project("mongrel_upload_progress", :uninstall)
|
175
|
+
sub_project("mongrel_console", :uninstall)
|
176
|
+
sub_project("gem_plugin", :uninstall)
|
177
|
+
sub_project("fastthread", :uninstall)
|
178
|
+
# sub_project("mongrel_experimental", :uninstall)
|
179
|
+
sub_project("mongrel_service", :uninstall) if RUBY_PLATFORM =~ /mswin|mingw/
|
180
|
+
end
|
181
|
+
|
182
|
+
desc "for Mongrel and all its subprojects"
|
183
|
+
task :clean do
|
184
|
+
sub_project("gem_plugin", :clean)
|
185
|
+
sub_project("cgi_multipart_eof_fix", :clean)
|
186
|
+
sub_project("fastthread", :clean)
|
187
|
+
sub_project("mongrel_status", :clean)
|
188
|
+
sub_project("mongrel_upload_progress", :clean)
|
189
|
+
sub_project("mongrel_console", :clean)
|
190
|
+
sub_project("mongrel_cluster", :clean)
|
191
|
+
sub_project("mongrel_experimental", :clean)
|
192
|
+
sub_project("mongrel_service", :clean) if RUBY_PLATFORM =~ /mswin|mingw/
|
193
|
+
end
|
194
|
+
|
195
|
+
#### Site upload tasks
|
196
|
+
|
197
|
+
namespace :site do
|
198
|
+
desc "Upload the coverage report"
|
199
|
+
task :coverage => [:rcov] do
|
200
|
+
sh "rsync -azv --no-perms --no-times test/coverage/* mongrel.cloudbur.st:/home/eweaver/www/mongrel/htdocs/web/coverage" rescue nil
|
201
|
+
end
|
202
|
+
end
|