freels-mongrel 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. data/CHANGELOG +12 -0
  2. data/COPYING +55 -0
  3. data/LICENSE +55 -0
  4. data/Manifest +70 -0
  5. data/README +74 -0
  6. data/Rakefile +237 -0
  7. data/TODO +4 -0
  8. data/bin/mongrel_rails +284 -0
  9. data/examples/builder.rb +29 -0
  10. data/examples/camping/README +3 -0
  11. data/examples/camping/blog.rb +294 -0
  12. data/examples/camping/tepee.rb +149 -0
  13. data/examples/httpd.conf +474 -0
  14. data/examples/mime.yaml +3 -0
  15. data/examples/mongrel.conf +9 -0
  16. data/examples/mongrel_simple_ctrl.rb +92 -0
  17. data/examples/mongrel_simple_service.rb +116 -0
  18. data/examples/monitrc +57 -0
  19. data/examples/random_thrash.rb +19 -0
  20. data/examples/simpletest.rb +52 -0
  21. data/examples/webrick_compare.rb +20 -0
  22. data/ext/http11/ext_help.h +15 -0
  23. data/ext/http11/extconf.rb +6 -0
  24. data/ext/http11/http11.c +527 -0
  25. data/ext/http11/http11_parser.c +1216 -0
  26. data/ext/http11/http11_parser.h +49 -0
  27. data/ext/http11/http11_parser.java.rl +171 -0
  28. data/ext/http11/http11_parser.rl +165 -0
  29. data/ext/http11/http11_parser_common.rl +55 -0
  30. data/ext/http11_java/Http11Service.java +13 -0
  31. data/ext/http11_java/org/jruby/mongrel/Http11.java +266 -0
  32. data/ext/http11_java/org/jruby/mongrel/Http11Parser.java +572 -0
  33. data/lib/mongrel.rb +359 -0
  34. data/lib/mongrel/camping.rb +107 -0
  35. data/lib/mongrel/cgi.rb +182 -0
  36. data/lib/mongrel/command.rb +220 -0
  37. data/lib/mongrel/configurator.rb +389 -0
  38. data/lib/mongrel/const.rb +114 -0
  39. data/lib/mongrel/debug.rb +203 -0
  40. data/lib/mongrel/gems.rb +22 -0
  41. data/lib/mongrel/handlers.rb +472 -0
  42. data/lib/mongrel/header_out.rb +28 -0
  43. data/lib/mongrel/http_request.rb +155 -0
  44. data/lib/mongrel/http_response.rb +163 -0
  45. data/lib/mongrel/init.rb +10 -0
  46. data/lib/mongrel/logger.rb +74 -0
  47. data/lib/mongrel/mime_types.yml +616 -0
  48. data/lib/mongrel/rails.rb +185 -0
  49. data/lib/mongrel/stats.rb +89 -0
  50. data/lib/mongrel/tcphack.rb +18 -0
  51. data/lib/mongrel/uri_classifier.rb +76 -0
  52. data/mongrel-public_cert.pem +20 -0
  53. data/mongrel.gemspec +47 -0
  54. data/setup.rb +1585 -0
  55. data/test/mime.yaml +3 -0
  56. data/test/mongrel.conf +1 -0
  57. data/test/test_cgi_wrapper.rb +26 -0
  58. data/test/test_command.rb +86 -0
  59. data/test/test_conditional.rb +107 -0
  60. data/test/test_configurator.rb +88 -0
  61. data/test/test_debug.rb +25 -0
  62. data/test/test_handlers.rb +104 -0
  63. data/test/test_http11.rb +272 -0
  64. data/test/test_redirect_handler.rb +44 -0
  65. data/test/test_request_progress.rb +100 -0
  66. data/test/test_response.rb +127 -0
  67. data/test/test_stats.rb +35 -0
  68. data/test/test_uriclassifier.rb +261 -0
  69. data/test/test_ws.rb +116 -0
  70. data/test/testhelp.rb +74 -0
  71. data/tools/trickletest.rb +45 -0
  72. metadata +202 -0
@@ -0,0 +1,12 @@
1
+
2
+ v1.1.2. Fix worker termination bug; fix JRuby 1.0.3 load order issue; fix require issue on systems without Rubygems.
3
+
4
+ v1.1.1. Fix mongrel_rails restart bug; fix bug with Rack status codes.
5
+
6
+ v1.1. Pure Ruby URIClassifier. More modular architecture. JRuby support. Move C URIClassifier into mongrel_experimental project.
7
+
8
+ v1.0.4. Backport fixes for versioning inconsistency, mongrel_rails bug, and DirHandler bug.
9
+
10
+ v1.0.3. Fix user-switching bug; make people upgrade to the latest from the RC.
11
+
12
+ 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
+
@@ -0,0 +1,70 @@
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/logger.rb
41
+ lib/mongrel/mime_types.yml
42
+ lib/mongrel/rails.rb
43
+ lib/mongrel/stats.rb
44
+ lib/mongrel/tcphack.rb
45
+ lib/mongrel/uri_classifier.rb
46
+ lib/mongrel.rb
47
+ LICENSE
48
+ Manifest
49
+ mongrel-public_cert.pem
50
+ mongrel.gemspec
51
+ README
52
+ setup.rb
53
+ test/mime.yaml
54
+ test/mongrel.conf
55
+ test/test_cgi_wrapper.rb
56
+ test/test_command.rb
57
+ test/test_conditional.rb
58
+ test/test_configurator.rb
59
+ test/test_debug.rb
60
+ test/test_handlers.rb
61
+ test/test_http11.rb
62
+ test/test_redirect_handler.rb
63
+ test/test_request_progress.rb
64
+ test/test_response.rb
65
+ test/test_stats.rb
66
+ test/test_uriclassifier.rb
67
+ test/test_ws.rb
68
+ test/testhelp.rb
69
+ TODO
70
+ 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.
@@ -0,0 +1,237 @@
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']
10
+ p.url = "http://mongrel.rubyforge.org"
11
+ p.rdoc_pattern = ['README', 'LICENSE', 'CHANGELOG', 'COPYING', 'lib/**/*.rb', 'doc/**/*.rdoc']
12
+ p.ignore_pattern = /^(pkg|site|projects|doc|log)|CVS|\.log/
13
+ p.ruby_version = '>=1.8.4'
14
+ p.dependencies = ['gem_plugin >=0.2.3']
15
+ p.extension_pattern = nil
16
+
17
+ p.certificate_chain = case ENV['USER']
18
+ when 'eweaver'
19
+ ['~/p/configuration/gem_certificates/mongrel/mongrel-public_cert.pem',
20
+ '~/p/configuration/gem_certificates/evan_weaver-mongrel-public_cert.pem']
21
+ when 'luislavena'
22
+ ['~/gem_certificates/mongrel-public_cert.pem',
23
+ '~/gem_certificates/luislavena-mongrel-public_cert.pem']
24
+ end
25
+
26
+ p.need_tar_gz = false
27
+ p.need_tgz = true
28
+
29
+ if RUBY_PLATFORM !~ /mswin|java/
30
+ p.extension_pattern = ["ext/**/extconf.rb"]
31
+ end
32
+
33
+ p.eval = proc do
34
+ case RUBY_PLATFORM
35
+ when /mswin/
36
+ self.files += ['lib/http11.so']
37
+ self.platform = Gem::Platform::CURRENT
38
+ add_dependency('cgi_multipart_eof_fix', '>= 2.4')
39
+ when /java/
40
+ self.files += ['lib/http11.jar']
41
+ self.platform = 'jruby' # XXX Is this right?
42
+ else
43
+ add_dependency('daemons', '>= 1.0.3')
44
+ add_dependency('fastthread', '>= 1.0.1')
45
+ add_dependency('cgi_multipart_eof_fix', '>= 2.4')
46
+ end
47
+ end
48
+
49
+ end
50
+
51
+ #### Ragel builder
52
+
53
+ desc "Rebuild the Ragel sources"
54
+ task :ragel do
55
+ Dir.chdir "ext/http11" do
56
+ target = "http11_parser.c"
57
+ File.unlink target if File.exist? target
58
+ sh "ragel http11_parser.rl | rlgen-cd -G2 -o #{target}"
59
+ raise "Failed to build C source" unless File.exist? target
60
+ end
61
+ Dir.chdir "ext/http11" do
62
+ target = "../../ext/http11_java/org/jruby/mongrel/Http11Parser.java"
63
+ File.unlink target if File.exist? target
64
+ sh "ragel -J http11_parser.java.rl | rlgen-java -o #{target}"
65
+ raise "Failed to build Java source" unless File.exist? target
66
+ end
67
+ end
68
+
69
+ #### Pre-compiled extensions for alternative platforms
70
+
71
+ def move_extensions
72
+ Dir["ext/**/*.#{Config::CONFIG['DLEXT']}"].each { |file| mv file, "lib/" }
73
+ end
74
+
75
+ def java_classpath_arg
76
+ # A myriad of ways to discover the JRuby classpath
77
+ classpath = begin
78
+ require 'java'
79
+ # Already running in a JRuby JVM
80
+ Java::java.lang.System.getProperty('java.class.path')
81
+ rescue LoadError
82
+ ENV['JRUBY_PARENT_CLASSPATH'] || ENV['JRUBY_HOME'] && FileList["#{ENV['JRUBY_HOME']}/lib/*.jar"].join(File::PATH_SEPARATOR)
83
+ end
84
+ classpath ? "-cp #{classpath}" : ""
85
+ end
86
+
87
+ case RUBY_PLATFORM
88
+ when /mswin/
89
+ filename = "lib/http11.so"
90
+ file filename do
91
+ Dir.chdir("ext/http11") do
92
+ ruby "extconf.rb"
93
+ system(PLATFORM =~ /mswin/ ? 'nmake' : 'make')
94
+ end
95
+ move_extensions
96
+ end
97
+ task :compile => [filename]
98
+
99
+ when /java/
100
+
101
+ # Avoid JRuby in-process launching problem
102
+ begin
103
+ require 'jruby'
104
+ JRuby.runtime.instance_config.run_ruby_in_process = false
105
+ rescue LoadError
106
+ end
107
+
108
+ filename = "lib/http11.jar"
109
+ file filename do
110
+ build_dir = "ext/http11_java/classes"
111
+ mkdir_p build_dir
112
+ sources = FileList['ext/http11_java/**/*.java'].join(' ')
113
+ sh "javac -target 1.4 -source 1.4 -d #{build_dir} #{java_classpath_arg} #{sources}"
114
+ sh "jar cf lib/http11.jar -C #{build_dir} ."
115
+ move_extensions
116
+ end
117
+ task :compile => [filename]
118
+
119
+ end
120
+
121
+ #### Project-wide install and uninstall tasks
122
+
123
+ def sub_project(project, *targets)
124
+ targets.each do |target|
125
+ Dir.chdir "projects/#{project}" do
126
+ unless RUBY_PLATFORM =~ /mswin/
127
+ sh("rake #{target.to_s}") # --trace
128
+ end
129
+ end
130
+ end
131
+ end
132
+
133
+ desc "Package Mongrel and all subprojects"
134
+ task :package_all => [:package] do
135
+ sub_project("gem_plugin", :package)
136
+ sub_project("cgi_multipart_eof_fix", :package)
137
+ sub_project("fastthread", :package)
138
+ sub_project("mongrel_status", :package)
139
+ sub_project("mongrel_upload_progress", :package)
140
+ sub_project("mongrel_console", :package)
141
+ sub_project("mongrel_cluster", :package)
142
+ sub_project("mongrel_experimental", :package)
143
+
144
+ sh("rake java package") unless RUBY_PLATFORM =~ /java/
145
+
146
+ # XXX Broken by RubyGems 0.9.5
147
+ # sub_project("mongrel_service", :package) if RUBY_PLATFORM =~ /mswin/
148
+ # sh("rake mswin package") unless RUBY_PLATFORM =~ /mswin/
149
+ end
150
+
151
+ task :install_requirements do
152
+ # These run before Mongrel is installed
153
+ sub_project("gem_plugin", :install)
154
+ sub_project("cgi_multipart_eof_fix", :install)
155
+ sub_project("fastthread", :install)
156
+ end
157
+
158
+ desc "for Mongrel and all subprojects"
159
+ task :install => [:install_requirements] do
160
+ # These run after Mongrel is installed
161
+ sub_project("mongrel_status", :install)
162
+ sub_project("mongrel_upload_progress", :install)
163
+ sub_project("mongrel_console", :install)
164
+ sub_project("mongrel_cluster", :install)
165
+ # sub_project("mongrel_experimental", :install)
166
+ sub_project("mongrel_service", :install) if RUBY_PLATFORM =~ /mswin/
167
+ end
168
+
169
+ desc "for Mongrel and all its subprojects"
170
+ task :uninstall => [:clean] do
171
+ sub_project("mongrel_status", :uninstall)
172
+ sub_project("cgi_multipart_eof_fix", :uninstall)
173
+ sub_project("mongrel_upload_progress", :uninstall)
174
+ sub_project("mongrel_console", :uninstall)
175
+ sub_project("gem_plugin", :uninstall)
176
+ sub_project("fastthread", :uninstall)
177
+ # sub_project("mongrel_experimental", :uninstall)
178
+ sub_project("mongrel_service", :uninstall) if RUBY_PLATFORM =~ /mswin/
179
+ end
180
+
181
+ desc "for Mongrel and all its subprojects"
182
+ task :clean do
183
+ sub_project("gem_plugin", :clean)
184
+ sub_project("cgi_multipart_eof_fix", :clean)
185
+ sub_project("fastthread", :clean)
186
+ sub_project("mongrel_status", :clean)
187
+ sub_project("mongrel_upload_progress", :clean)
188
+ sub_project("mongrel_console", :clean)
189
+ sub_project("mongrel_cluster", :clean)
190
+ sub_project("mongrel_experimental", :clean)
191
+ sub_project("mongrel_service", :clean) if RUBY_PLATFORM =~ /mswin/
192
+ end
193
+
194
+ #### Site upload tasks
195
+
196
+ namespace :site do
197
+
198
+ desc "Package and upload .gem files and .tgz files for Mongrel and all subprojects to http://mongrel.rubyforge.org/releases/"
199
+ task :source => [:package_all] do
200
+ rm_rf "pkg/gems"
201
+ rm_rf "pkg/tars"
202
+ mkdir_p "pkg/gems"
203
+ mkdir_p "pkg/tars"
204
+
205
+ FileList["**/*.gem"].each { |gem| mv gem, "pkg/gems" }
206
+ FileList["**/*.tgz"].each {|tgz| mv tgz, "pkg/tars" }
207
+
208
+ sh "rm -rf pkg/mongrel*"
209
+ sh "gem generate_index -d pkg"
210
+ sh "scp -r CHANGELOG pkg/* rubyforge.org:/var/www/gforge-projects/mongrel/releases/"
211
+ sh "svn log -v > SVN_LOG"
212
+ sh "scp -r SVN_LOG pkg/* rubyforge.org:/var/www/gforge-projects/mongrel/releases/"
213
+ rm "SVN_LOG"
214
+ end
215
+
216
+ desc "Upload the website"
217
+ task :web do
218
+ # Requires the 'webgem' gem
219
+ sh "cd site; webgen; webgen; curl 'http://feed43.com/mongrel.xml' > output/rss.xml; rsync -azv --no-perms --no-times output/* rubyforge.org:/var/www/gforge-projects/mongrel/"
220
+ puts "\nMake sure to re-run the site update 6 hours later if you updated the news. This delay is required for Feed43 to pick up the site changes."
221
+ end
222
+
223
+ desc "Upload the rdocs"
224
+ task :rdoc => [:doc] do
225
+ sh "rsync -azv --no-perms --no-times doc/* rubyforge.org:/var/www/gforge-projects/mongrel/rdoc/"
226
+ sh "cd projects/gem_plugin; rake site:rdoc"
227
+ end
228
+
229
+ desc "Upload the coverage report"
230
+ task :coverage => [:rcov] do
231
+ sh "rsync -azv --no-perms --no-times test/coverage/* rubyforge.org:/var/www/gforge-projects/mongrel/coverage/" rescue nil
232
+ end
233
+
234
+ desc "Upload the website, the rdocs, and the coverage report"
235
+ task :all => [:clean, :web, :rdoc, :coverage]
236
+
237
+ end