thin 1.8.0 → 2.0.0.pre

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of thin might be problematic. Click here for more details.

Files changed (108) hide show
  1. data/.gitignore +9 -0
  2. data/CHANGELOG +29 -107
  3. data/Gemfile +8 -0
  4. data/README.md +44 -78
  5. data/Rakefile +28 -18
  6. data/bin/thin +4 -4
  7. data/examples/async.ru +21 -0
  8. data/examples/thin.conf.rb +39 -0
  9. data/lib/thin.rb +2 -44
  10. data/lib/thin/async.rb +108 -0
  11. data/lib/thin/backends/prefork.rb +44 -0
  12. data/lib/thin/backends/single_process.rb +28 -0
  13. data/lib/thin/chunked_body.rb +28 -0
  14. data/lib/thin/configurator.rb +118 -0
  15. data/lib/thin/connection.rb +246 -172
  16. data/lib/thin/listener.rb +114 -0
  17. data/lib/thin/request.rb +94 -76
  18. data/lib/thin/response.rb +112 -45
  19. data/lib/thin/runner.rb +134 -197
  20. data/lib/thin/server.rb +203 -252
  21. data/lib/thin/system.rb +49 -0
  22. data/lib/thin/version.rb +11 -26
  23. data/man/index.txt +3 -0
  24. data/man/thin-conf.5.ronn +121 -0
  25. data/man/thin.1.ronn +105 -0
  26. data/site/.gitignore +2 -0
  27. data/site/README.md +21 -0
  28. data/site/Rakefile +20 -0
  29. data/site/config.ru +4 -0
  30. data/site/public/images/grid.png +0 -0
  31. data/site/public/javascripts/dd_belatedpng.js +13 -0
  32. data/site/public/javascripts/modernizr-1.6.min.js +30 -0
  33. data/site/public/man/thin-conf.5.html +220 -0
  34. data/site/public/man/thin.1.html +177 -0
  35. data/site/site/assets/javascripts/main.coffee +2 -0
  36. data/site/site/assets/stylesheets/_config.scss +55 -0
  37. data/site/site/assets/stylesheets/main.scss +24 -0
  38. data/site/site/helpers.rb +17 -0
  39. data/site/site/layouts/base.erb +55 -0
  40. data/site/site/layouts/default.erb +17 -0
  41. data/site/site/pages/about.md +5 -0
  42. data/site/site/pages/index.erb +10 -0
  43. data/site/site/partials/.gitkeep +0 -0
  44. data/test/fixtures/big.txt +1 -0
  45. data/test/fixtures/small.txt +1 -0
  46. data/test/fixtures/thin.conf.rb +15 -0
  47. data/test/integration/async_test.rb +35 -0
  48. data/test/integration/big_request_test.rb +30 -0
  49. data/test/integration/config.ru +57 -0
  50. data/test/integration/daemonize_test.rb +26 -0
  51. data/test/integration/env_test.rb +44 -0
  52. data/test/integration/error_test.rb +37 -0
  53. data/test/integration/file_sending_test.rb +24 -0
  54. data/test/integration/keep_alive_test.rb +35 -0
  55. data/test/integration/robustness_test.rb +37 -0
  56. data/test/integration/single_process_test.rb +15 -0
  57. data/test/integration/socket_family_test.rb +38 -0
  58. data/test/integration/worker_test.rb +22 -0
  59. data/test/test_helper.rb +195 -0
  60. data/test/unit/configurator_test.rb +43 -0
  61. data/test/unit/connection_test.rb +94 -0
  62. data/test/unit/listener_test.rb +74 -0
  63. data/test/unit/request_test.rb +74 -0
  64. data/test/unit/response_test.rb +90 -0
  65. data/test/unit/server_test.rb +29 -0
  66. data/test/unit/system_test.rb +17 -0
  67. data/thin.gemspec +26 -0
  68. data/v2.todo +21 -0
  69. metadata +138 -93
  70. checksums.yaml +0 -7
  71. data/example/adapter.rb +0 -32
  72. data/example/async_app.ru +0 -126
  73. data/example/async_chat.ru +0 -247
  74. data/example/async_tailer.ru +0 -100
  75. data/example/config.ru +0 -22
  76. data/example/monit_sockets +0 -20
  77. data/example/monit_unixsock +0 -20
  78. data/example/myapp.rb +0 -1
  79. data/example/ramaze.ru +0 -12
  80. data/example/thin.god +0 -80
  81. data/example/thin_solaris_smf.erb +0 -36
  82. data/example/thin_solaris_smf.readme.txt +0 -150
  83. data/example/vlad.rake +0 -72
  84. data/ext/thin_parser/common.rl +0 -59
  85. data/ext/thin_parser/ext_help.h +0 -14
  86. data/ext/thin_parser/extconf.rb +0 -6
  87. data/ext/thin_parser/parser.c +0 -1447
  88. data/ext/thin_parser/parser.h +0 -49
  89. data/ext/thin_parser/parser.rl +0 -152
  90. data/ext/thin_parser/thin.c +0 -435
  91. data/lib/rack/adapter/loader.rb +0 -75
  92. data/lib/rack/adapter/rails.rb +0 -178
  93. data/lib/rack/handler/thin.rb +0 -38
  94. data/lib/thin/backends/base.rb +0 -169
  95. data/lib/thin/backends/swiftiply_client.rb +0 -56
  96. data/lib/thin/backends/tcp_server.rb +0 -34
  97. data/lib/thin/backends/unix_server.rb +0 -56
  98. data/lib/thin/command.rb +0 -53
  99. data/lib/thin/controllers/cluster.rb +0 -178
  100. data/lib/thin/controllers/controller.rb +0 -189
  101. data/lib/thin/controllers/service.rb +0 -76
  102. data/lib/thin/controllers/service.sh.erb +0 -39
  103. data/lib/thin/daemonizing.rb +0 -199
  104. data/lib/thin/headers.rb +0 -40
  105. data/lib/thin/logging.rb +0 -174
  106. data/lib/thin/stats.html.erb +0 -216
  107. data/lib/thin/stats.rb +0 -52
  108. data/lib/thin/statuses.rb +0 -48
@@ -0,0 +1,9 @@
1
+ *.gem
2
+ *.log
3
+ *.pid
4
+ .bundle
5
+ Gemfile.lock
6
+ pkg/*
7
+ tmp
8
+ .yardoc
9
+ test.conf.rb
data/CHANGELOG CHANGED
@@ -1,81 +1,3 @@
1
- == 1.7.2 Bachmanity
2
- * Add config support for ssl_version and ssl_cipher_list [frameworked]
3
-
4
- == 1.7.1 Muffin Mode
5
- * Ruby 2.4 support (Fixnum deprecation) [nimish-mehta]
6
- * Allow ERB templates in config files [markets]
7
-
8
- == 1.7.0 Dunder Mifflin
9
- * Rack 2 support
10
- * Ensure Response body.close is called in the same thread
11
- Fixes issues with ActiveRecord connection management [#307]
12
- * Fix TCP/IP Backend reports incorrect port when asked to bind to 0 [meschbach]
13
- * Work with ruby 2.3's --enable-frozen-string-literal [jeremyevans]
14
-
15
- == 1.6.4 Gob Bluth
16
- * Increase REQUEST_PATH to 2048 symbols [X2rdas]
17
- * Fix warning in logger [tenderlove]
18
- * Add :timeout option for Rack::Server.new [sugitak]
19
- * When restarting, exit on a next tick so we can send response back to a client [rsamoilov]
20
- * Check for empty PID files [z1dane]
21
- * Update Event Machine version to 1.0.4, Ruby 2.2.0 fix [freemanoid]
22
-
23
- == 1.6.3 Protein Powder
24
- * Add HTTP 422 status code [rajcybage]
25
- * Add warning about EM reactor still running when stopping.
26
- * Remove version number from "Server" HTTP header. [benbasson]
27
- * Adding `--ssl-disable-verify` to allow disabling of client cert requests when SSL enabled [brucek]
28
- * Ensure Tempfiles created by a large request are closed and deleted. [Tonkpils]
29
-
30
- == 1.6.2 Doc Brown
31
- * No longer replace response's body on HEAD request. Ensuring body.close will be called.
32
- * Remove `---ssl-verify` option as EventMachine doesn't verify the certificate.
33
- * Fix env['rack.peer_cert'] to return SSL certifcate.
34
-
35
- == 1.6.1 Death Proof
36
- * Regression: Default logger to STDOUT when using outside of CLI.
37
- * Regression: Downgrade Rack required version back to 1.0 to work w/ prior Rails versions.
38
-
39
- == 1.6.0 Greek Yogurt
40
- * Accept absolute URL in request line, eg.: 'GET http://site.com/he/lo HTTP/1.1'.
41
- * HEAD request no longer return a body in the response.
42
- * No longer stop EventMachine's reactor loop unless it was started by Thin.
43
- * Make request env keys upcasing locale-agnostic.
44
- * Use Ruby's `Logger` for logging. [Akshay Moghe].
45
- The logger can now be set using `Thin::Logging.logger=`.
46
- Tracing of request is handled by a second logger, `Thin::Logging.trace_logger=`.
47
- * Add --threadpool-size option to configure EM's thread pool size (default: 20).
48
- * Pipelining is no longer supported.
49
-
50
- == 1.5.1 Straight Razor
51
- * Fix issue when running as another user/group without a PID file.
52
- * Allow overriding Connection & Server response headers.
53
- * Update vlad example [Mathieu Lemoine]
54
- * Keep connections in a Hash to speedup deletion [slivu]
55
- * Force kill using already known pid. Prevents "thin stop" from leaving a process that removed its
56
- pid file, but is still running (e.g. hung on some at_exit callback) [Michal Kwiatkowski]
57
-
58
- == 1.5.0 Knife
59
- * Fix compilation under Ubuntu 12.04 with -Werror=format-security option.
60
- * Raise an error when no PID file.
61
- * Prevent duplicate response headers.
62
- * Make proper response on exception [MasterLambaster].
63
- * Automatically close idling pipeline connections on server stop [MasterLambaster].
64
-
65
- == 1.4.1 Chromeo Fix
66
- * Fix error when sending USR1 signal and no log file is supplied.
67
-
68
- == 1.4.0 Chromeo
69
- * kill -USR1 $PID for log rotation [catwell].
70
- * Fix HUP signal being reseted after deamonization [atotic].
71
- * Fix error with nil addresses in Connection#socket_address.
72
-
73
- == 1.3.2 Low-bar Squat
74
- * Remove mack and halcyon Rack adapters from automatic detection.
75
-
76
- == 1.3.1 Triple Espresso
77
- * Fix service not working pre 1.9.
78
-
79
1
  == 1.3.0 Double Espresso
80
2
  * BREAKING CHANGE: Thin no longer ships with fat Windows binaries.
81
3
  From now on, to install on Windows, install https://github.com/oneclick/rubyinstaller/wiki/Development-Kit.
@@ -83,10 +5,10 @@
83
5
  It is now the responsibility of the app (or a middleware) to set the Content-Length.
84
6
  * Log errors to STDERR [textgoeshere]
85
7
  * Shut down gracefully when receiving SIGTERM [ddollar]
86
-
8
+
87
9
  Processes are allowed a chance to shut down gracefully when receiving
88
10
  SIGTERM (http://en.wikipedia.org/wiki/SIGTERM).
89
-
11
+
90
12
  On Heroku, when shutting down a process, we send a SIGTERM followed 10
91
13
  seconds later with a SIGKILL, similar to the behavior of the init daemon
92
14
  on most Unix systems. This patch will allow Heroku apps to shut down
@@ -111,7 +33,7 @@
111
33
  the existing connection to another protocol, and specifically is NOT
112
34
  used to upgrade a separate connection. Therefore, the connection must
113
35
  remain open after this response in order to facilitate that.
114
-
36
+
115
37
  * Accept IE7 badly encoded URL (eg.: %uEEEE)
116
38
  * Fix gemspec to work w/ Bundler [smparkes]
117
39
  * Add SSL support [tmm1]
@@ -127,10 +49,10 @@
127
49
  --ssl-key-file PATH Path to private key
128
50
  --ssl-cert-file PATH Path to certificate
129
51
  --ssl-verify Enables SSL certificate verification
130
-
52
+
131
53
  * Expose peer SSL certificate in env (rack.peer_cert) [fd]
132
54
  * Adjusting unix socket permissions to be more open [mbj]
133
-
55
+
134
56
  == 1.2.7 No Hup
135
57
  * Support multiple Ruby version (fat binaries under windows)
136
58
  * Do not trap unsupported HUP signal on Windows
@@ -154,7 +76,7 @@
154
76
  == 1.2.2 I Find Your Lack of Sauce Disturbing release
155
77
  * Fix force kill under 1.9 [Alexey Chebotar]
156
78
  * Fix regression when --only option is used w/ --socket.
157
- * Add process name 'tag' functionality. Easier to distinguish thin daemons
79
+ * Add process name 'tag' functionality. Easier to distinguish thin daemons
158
80
  from eachother in process listing [ctcherry]
159
81
 
160
82
  == 1.2.1 Asynctilicious Ultra Supreme release
@@ -164,11 +86,11 @@
164
86
  * Allow String for response body
165
87
  * Require openssl before eventmachine to prevent crash in 1.9
166
88
 
167
- == 1.2.0 Asynctilicious Supreme release
89
+ == 1.2.0 Asynctilicious Supreme release
168
90
  * Add support for Windows mingw Ruby distro [Juan C. Rodriguez]
169
91
  * Add async response support, see example/async_*.ru [raggi]
170
92
 
171
- == 1.1.1 Super Disco Power Plus release
93
+ == 1.1.1 Super Disco Power Plus release
172
94
  * Fix bug when running with only options [hasimo]
173
95
 
174
96
  == 1.1.0 Super Disco Power release
@@ -265,20 +187,20 @@
265
187
  * Add tasks for Vlad the Deployer in example/vlad.rake [cnantais]
266
188
  * Add Ramaze Rackup config file in example dir [tmm1]
267
189
  Use like this from you Ramaze app dir:
268
-
190
+
269
191
  thin start -r /path/to/thin/example/ramaze.ru
270
-
192
+
271
193
  * Add the --rackup option to load a Rack config file instead of the Rails adapter.
272
194
  So you can use any framework with the thin script and start cluster and stuff like that.
273
195
  A Rack config file is one that is usable through the rackup command and looks like this:
274
-
196
+
275
197
  use Rack::CommonLogger
276
198
  run MyCrazyRackAdapter.new(:uterly, 'cool')
277
-
199
+
278
200
  Then use it with thin like this:
279
-
201
+
280
202
  thin start --rackup config.ru
281
-
203
+
282
204
  * thin config --chrdir ... -C thin/yml do not change current directory anymore, fixes #33.
283
205
  * Add a better sample god config file in example/thin.god that loads all info from config
284
206
  files in /etc/thin. Drop-in replacement for the thin runlevel service [Gump].
@@ -286,9 +208,9 @@
286
208
  configuration.
287
209
  * Add a script to run thin as a runlevel service that can start at startup, closes #31 [Gump]
288
210
  Setup the service like this:
289
-
211
+
290
212
  sudo thin install /etc/thin
291
-
213
+
292
214
  This will install the boot script under /etc/init.d/thin. Then copy your config files to
293
215
  /etc/thin. Works only under Linux.
294
216
  * Set process name to 'thin server (0.0.0.0:3000)' when running as a daemon, closes #32.
@@ -314,9 +236,9 @@
314
236
  * Add example config files for http://www.tildeslash.com/monit usage.
315
237
  Include the example file using "include /path/to/thin/monit/file" in your monitrc file.
316
238
  The group settings let you do this to manage your clusters:
317
-
239
+
318
240
  sudo monit -g blog restart all
319
-
241
+
320
242
  There are examples of thin listening on sockets and thin listening on unix sockets.
321
243
 
322
244
  == 0.6.1 Cheesecake release
@@ -327,20 +249,20 @@
327
249
  * Add support for connection through UNIX domain socket.
328
250
  Use the --socket (-S) option w/ the thin script to configure the socket filename.
329
251
  Nginx support binding to a UNIX socket like this:
330
-
252
+
331
253
  upstream backend {
332
254
  server unix:/tmp/thin.0.sock;
333
255
  server unix:/tmp/thin.1.sock;
334
256
  server unix:/tmp/thin.2.sock;
335
257
  }
336
-
258
+
337
259
  Start your servers like this:
338
-
260
+
339
261
  thin start -s3 -S/tmp/thin.sock
340
-
262
+
341
263
  * Remove Server#listen! method. Use Server#start instead.
342
264
  * Server can now yield a Rack::Builder to allow building an app in one call:
343
-
265
+
344
266
  Server.start '0.0.0.0', 3000 do
345
267
  use Rack::CommonLogger
346
268
  use Rack::ShowExceptions
@@ -349,13 +271,13 @@
349
271
  run Rack::Lobster.new
350
272
  end
351
273
  end
352
-
274
+
353
275
  * Add a very basic stats page through Stats adapter, load w/ --stats and browse to /stats.
354
276
  * Add --trace (-V) option to trace request/response and get backtrace w/out all Ruby debug stuff.
355
277
  * Add --config (-C) option to load options from a config file in thin script [Matt Todd].
356
278
  * Alter response headers to output directly to a string.
357
279
  * Improve specs stability.
358
- * Move request body to a Tempfile if too big (> 112 KB)
280
+ * Move request body to a Tempfile if too big (> 112 MB)
359
281
  * Remove useless check for max header size in Request (already done in the parser)
360
282
 
361
283
  == 0.5.4 Flying Mustard release
@@ -367,7 +289,7 @@
367
289
  Thanks to Kent Sibilev and Ezra for their help on that one.
368
290
  * Add 'Server' response header
369
291
  * Fix --user and --group option not changing daemon process privileges
370
-
292
+
371
293
  == 0.5.3 Purple Yogurt release
372
294
  * win32 pre-compiled gem now available
373
295
  * change rake task configuration to allow win32 gem build
@@ -387,7 +309,7 @@
387
309
  --log-file => --log
388
310
  --pid-file => --pid
389
311
  --env => --environment
390
-
312
+
391
313
  == 0.5.1 LOLCAT release
392
314
  * Add URL rewriting to Rails adapter so that page caching works and / fetches index.html if present.
393
315
  * Fix bug in multiline response header parsing.
@@ -402,9 +324,9 @@
402
324
 
403
325
  == 0.5.0
404
326
  * Full rewrite to use EventMachine, Rack and Mongrel parser
405
-
327
+
406
328
  == 0.4.1
407
329
  * Fix Rails environment option not being used in thin script.
408
-
330
+
409
331
  == 0.4.0
410
332
  * First alphaish release as a gem.
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in thin.gemspec
4
+ gemspec
5
+
6
+ group :test do
7
+ gem "mocha", "~> 0.10.0"
8
+ end
data/README.md CHANGED
@@ -1,102 +1,68 @@
1
- # Thin
2
-
3
- A small and fast Ruby web server
4
-
5
- ## Installation
6
-
7
- ```
8
- gem install thin
9
- ```
10
-
11
- Or add `thin` to your `Gemfile`:
12
-
13
- ```ruby
14
- gem 'thin'
15
- ```
16
-
17
- ## Usage
1
+ ---
18
2
 
19
- A +thin+ script offers an easy way to start your Rack application:
3
+ # This is alpha software. Things might break, people will cry and it will be your fault.
4
+ ### When reporting issues, make sure to mention you're using Thin v2.
20
5
 
21
- ```
22
- thin start
23
- ```
6
+ ---
24
7
 
25
- Browse the `example` directory for sample applications.
26
-
27
- ## Usage with Rails Action Cable
8
+ # Thin
9
+ Tiny, fast & funny Ruby server
28
10
 
29
- To use Thin with Action Cable, add the following to your `Gemfile`:
11
+ Thin is a high performance and customizable Ruby server. It's structured much like Nginx. A
12
+ master process listen to incoming requests and dispatch to its worker processes, each one
13
+ running an EventMachine event loop.
30
14
 
31
- ```ruby
32
- gem 'faye-websocket'
33
- gem 'thin' # If not already done
34
- ```
15
+ Which makes it, with all humility, the most secure, stable, fast and extensible Ruby web server
16
+ bundled in an easy to use gem for your own pleasure.
35
17
 
36
- Create a `config/initializers/thin_action_cable.rb`:
18
+ **Site:** http://code.macournoyer.com/thin/
19
+ **Group:** http://groups.google.com/group/thin-ruby/topics
20
+ **Bugs:** http://github.com/macournoyer/thin/issues
21
+ **Code:** http://github.com/macournoyer/thin
22
+ **IRC:** #thin on freenode
37
23
 
38
- ```ruby
39
- Rails.application.config.action_cable.use_faye = true
40
- Faye::WebSocket.load_adapter 'thin'
41
- ```
24
+ ## Features
42
25
 
43
- ### CLI
26
+ * Prefork model with an EventMachine loop running in each worker.
27
+ * Optional single process mode for non-UNIX systems and simpler deployments.
28
+ * Optional threaded mode using a pool of threads.
29
+ * Easy asynchronous streaming response support with chunked encoding.
30
+ * Fast file serving with automatic streaming for large files.
31
+ * Keep-alive support.
32
+ * SSL support (upcoming).
44
33
 
45
- Use a rackup (config.ru) file and bind to localhost port 8080:
34
+ ## Installation
35
+ For this pre-release of version 2.0:
46
36
 
47
- ```
48
- thin -R config.ru -a 127.0.0.1 -p 8080 start
49
- ```
37
+ $ gem install thin --pre
50
38
 
51
- Store the server process ID, log to a file and daemonize:
39
+ Or from source:
52
40
 
53
- ```
54
- thin -p 9292 -P tmp/pids/thin.pid -l logs/thin.log -d start
55
- ```
41
+ $ git clone git://github.com/macournoyer/thin.git
42
+ $ git checkout v2
43
+ $ cd thin
44
+ $ bundle install
45
+ $ rake install
56
46
 
57
- Thin is quite flexible in that many options can be specified at the command line (see `thin -h` for more).
47
+ ## Usage
48
+ The `thin` script offers an easy way to start your Rack based application and acts just like
49
+ the `rackup` script.:
58
50
 
59
- ### Configuration files
51
+ $ cd to/your/rack/app
52
+ $ thin
60
53
 
61
- You can create a configuration file using `thin config -C config/thin.yml`.
54
+ To use with Rails, add thin to your Gemfile and use Rails server command:
62
55
 
63
- You can then use it with all commands, such as: `thin start -C config/thin.yml`.
56
+ $ echo "gem 'thin'" >> Gemfile
57
+ $ bundle install
58
+ $ rails server thin
64
59
 
65
- Here is an example config file:
60
+ See examples/thin.conf.rb for a sample configuration file.
66
61
 
67
- ```yaml
68
- ---
69
- user: www-data
70
- group: www-data
71
- pid: tmp/pids/thin.pid
72
- timeout: 30
73
- wait: 30
74
- log: log/thin.log
75
- max_conns: 1024
76
- require: []
77
- environment: production
78
- max_persistent_conns: 512
79
- servers: 1
80
- threaded: true
81
- no-epoll: true
82
- daemonize: true
83
- socket: tmp/sockets/thin.sock
84
- chdir: /path/to/your/apps/root
85
- tag: a-name-to-show-up-in-ps aux
86
- ```
62
+ Run `thin -h` to list available options.
87
63
 
88
64
  ## License
89
-
90
65
  Ruby License, http://www.ruby-lang.org/en/LICENSE.txt.
91
66
 
92
67
  ## Credits
93
-
94
- The parser was originally from Mongrel http://mongrel.rubyforge.org by Zed Shaw.
95
- Mongrel is copyright 2007 Zed A. Shaw and contributors. It is licensed under
96
- the Ruby license and the GPL2.
97
-
98
68
  Thin is copyright Marc-Andre Cournoyer <macournoyer@gmail.com>
99
-
100
- Get help at http://groups.google.com/group/thin-ruby/
101
- Report bugs at https://github.com/macournoyer/thin/issues
102
- and major security issues directly to me at macournoyer@gmail.com.
data/Rakefile CHANGED
@@ -1,25 +1,35 @@
1
- require 'rake'
2
- require 'rake/clean'
3
- load 'thin.gemspec'
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
4
3
 
5
- # Load tasks in tasks/
6
- Dir['tasks/**/*.rake'].each { |rake| load rake }
4
+ require 'rake/testtask'
5
+ require "thin/version"
7
6
 
8
- task :default => :spec
9
-
10
- desc "Build gem packages"
11
- task :build do
12
- sh "gem build thin.gemspec"
7
+ namespace :test do
8
+ Rake::TestTask.new(:unit) do |t|
9
+ t.libs << 'lib'
10
+ t.libs << 'test'
11
+ t.pattern = 'test/unit/**/*_test.rb'
12
+ end
13
+
14
+ Rake::TestTask.new(:integration) do |t|
15
+ t.libs << 'lib'
16
+ t.libs << 'test'
17
+ t.pattern = 'test/integration/**/*_test.rb'
18
+ end
19
+
13
20
  end
21
+ desc "Run all tests"
22
+ task :test => ["test:unit", "test:integration"]
14
23
 
15
- desc "Push gem packages"
16
- task :push => :build do
17
- sh "gem push thin-*.gem"
18
- end
24
+ task :default => :test
19
25
 
20
- task :install => :build do
21
- sh "gem install thin-*.gem"
26
+ task :man do
27
+ ENV['RONN_MANUAL'] = "Thin Manual"
28
+ ENV['RONN_ORGANIZATION'] = "Thin #{Thin::VERSION::STRING}"
29
+ sh "ronn -w -s toc -5 man/*.ronn"
30
+ mv FileList["man/*.html"], "site/public/man"
22
31
  end
23
32
 
24
- desc "Release version #{Thin::VERSION::STRING}"
25
- task :release => [:tag, :push]
33
+ task :rm_space do
34
+ sh %{find . -name "*.rb" -print0 | xargs -0 sed -i '' -E "s/[[:space:]]*$//"}
35
+ end