puma 2.2.0 → 8.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. checksums.yaml +7 -0
  2. data/History.md +3334 -0
  3. data/LICENSE +23 -20
  4. data/README.md +387 -100
  5. data/bin/puma-wild +25 -0
  6. data/bin/pumactl +1 -1
  7. data/docs/5.0-Upgrade.md +98 -0
  8. data/docs/6.0-Upgrade.md +56 -0
  9. data/docs/7.0-Upgrade.md +52 -0
  10. data/docs/8.0-Upgrade.md +100 -0
  11. data/docs/architecture.md +74 -0
  12. data/docs/compile_options.md +55 -0
  13. data/docs/deployment.md +137 -0
  14. data/docs/fork_worker.md +41 -0
  15. data/docs/grpc.md +62 -0
  16. data/docs/images/favicon.svg +1 -0
  17. data/docs/images/puma-connection-flow-no-reactor.png +0 -0
  18. data/docs/images/puma-connection-flow.png +0 -0
  19. data/docs/images/puma-general-arch.png +0 -0
  20. data/docs/images/running-puma.svg +1 -0
  21. data/docs/images/standard-logo.svg +1 -0
  22. data/docs/java_options.md +54 -0
  23. data/docs/jungle/README.md +9 -0
  24. data/docs/jungle/rc.d/README.md +74 -0
  25. data/docs/jungle/rc.d/puma +61 -0
  26. data/docs/jungle/rc.d/puma.conf +10 -0
  27. data/docs/kubernetes.md +73 -0
  28. data/docs/nginx.md +5 -5
  29. data/docs/plugins.md +42 -0
  30. data/docs/rails_dev_mode.md +28 -0
  31. data/docs/restart.md +65 -0
  32. data/docs/signals.md +98 -0
  33. data/docs/stats.md +148 -0
  34. data/docs/systemd.md +253 -0
  35. data/docs/testing_benchmarks_local_files.md +150 -0
  36. data/docs/testing_test_rackup_ci_files.md +36 -0
  37. data/ext/puma_http11/PumaHttp11Service.java +2 -2
  38. data/ext/puma_http11/extconf.rb +59 -2
  39. data/ext/puma_http11/http11_parser.c +319 -487
  40. data/ext/puma_http11/http11_parser.h +15 -13
  41. data/ext/puma_http11/http11_parser.java.rl +64 -94
  42. data/ext/puma_http11/http11_parser.rl +27 -24
  43. data/ext/puma_http11/http11_parser_common.rl +8 -8
  44. data/ext/puma_http11/mini_ssl.c +696 -38
  45. data/ext/puma_http11/no_ssl/PumaHttp11Service.java +15 -0
  46. data/ext/puma_http11/org/jruby/puma/EnvKey.java +241 -0
  47. data/ext/puma_http11/org/jruby/puma/Http11.java +241 -145
  48. data/ext/puma_http11/org/jruby/puma/Http11Parser.java +174 -221
  49. data/ext/puma_http11/org/jruby/puma/MiniSSL.java +413 -193
  50. data/ext/puma_http11/puma_http11.c +183 -175
  51. data/lib/puma/app/status.rb +77 -29
  52. data/lib/puma/binder.rb +349 -119
  53. data/lib/puma/cli.rb +163 -801
  54. data/lib/puma/client.rb +627 -144
  55. data/lib/puma/client_env.rb +171 -0
  56. data/lib/puma/cluster/worker.rb +183 -0
  57. data/lib/puma/cluster/worker_handle.rb +127 -0
  58. data/lib/puma/cluster.rb +634 -0
  59. data/lib/puma/cluster_accept_loop_delay.rb +91 -0
  60. data/lib/puma/commonlogger.rb +115 -0
  61. data/lib/puma/configuration.rb +420 -198
  62. data/lib/puma/const.rb +266 -115
  63. data/lib/puma/control_cli.rb +219 -120
  64. data/lib/puma/detect.rb +56 -2
  65. data/lib/puma/dsl.rb +1562 -0
  66. data/lib/puma/error_logger.rb +115 -0
  67. data/lib/puma/events.rb +44 -60
  68. data/lib/puma/io_buffer.rb +48 -5
  69. data/lib/puma/jruby_restart.rb +2 -51
  70. data/lib/puma/json_serialization.rb +96 -0
  71. data/lib/puma/launcher/bundle_pruner.rb +102 -0
  72. data/lib/puma/launcher.rb +501 -0
  73. data/lib/puma/log_writer.rb +153 -0
  74. data/lib/puma/minissl/context_builder.rb +96 -0
  75. data/lib/puma/minissl.rb +355 -37
  76. data/lib/puma/null_io.rb +79 -12
  77. data/lib/puma/plugin/systemd.rb +90 -0
  78. data/lib/puma/plugin/tmp_restart.rb +36 -0
  79. data/lib/puma/plugin.rb +111 -0
  80. data/lib/puma/rack/builder.rb +297 -0
  81. data/lib/puma/rack/urlmap.rb +93 -0
  82. data/lib/puma/rack_default.rb +21 -4
  83. data/lib/puma/reactor.rb +102 -133
  84. data/lib/puma/response.rb +532 -0
  85. data/lib/puma/runner.rb +211 -0
  86. data/lib/puma/sd_notify.rb +146 -0
  87. data/lib/puma/server.rb +582 -445
  88. data/lib/puma/server_plugin_control.rb +32 -0
  89. data/lib/puma/single.rb +72 -0
  90. data/lib/puma/state_file.rb +69 -0
  91. data/lib/puma/thread_pool.rb +389 -57
  92. data/lib/puma/util.rb +125 -0
  93. data/lib/puma.rb +80 -6
  94. data/lib/rack/handler/puma.rb +125 -47
  95. data/tools/Dockerfile +26 -0
  96. data/tools/trickletest.rb +44 -0
  97. metadata +88 -148
  98. data/COPYING +0 -55
  99. data/Gemfile +0 -10
  100. data/History.txt +0 -302
  101. data/Manifest.txt +0 -60
  102. data/Rakefile +0 -165
  103. data/TODO +0 -5
  104. data/docs/config.md +0 -0
  105. data/ext/puma_http11/ext_help.h +0 -15
  106. data/ext/puma_http11/io_buffer.c +0 -154
  107. data/lib/puma/accept_nonblock.rb +0 -23
  108. data/lib/puma/capistrano.rb +0 -34
  109. data/lib/puma/compat.rb +0 -11
  110. data/lib/puma/daemon_ext.rb +0 -20
  111. data/lib/puma/delegation.rb +0 -11
  112. data/lib/puma/java_io_buffer.rb +0 -45
  113. data/lib/puma/rack_patch.rb +0 -25
  114. data/puma.gemspec +0 -45
  115. data/test/test_app_status.rb +0 -88
  116. data/test/test_cli.rb +0 -171
  117. data/test/test_config.rb +0 -16
  118. data/test/test_http10.rb +0 -27
  119. data/test/test_http11.rb +0 -126
  120. data/test/test_integration.rb +0 -154
  121. data/test/test_iobuffer.rb +0 -38
  122. data/test/test_minissl.rb +0 -25
  123. data/test/test_null_io.rb +0 -31
  124. data/test/test_persistent.rb +0 -238
  125. data/test/test_puma_server.rb +0 -224
  126. data/test/test_rack_handler.rb +0 -10
  127. data/test/test_rack_server.rb +0 -141
  128. data/test/test_thread_pool.rb +0 -146
  129. data/test/test_unix_socket.rb +0 -39
  130. data/test/test_ws.rb +0 -89
  131. data/tools/jungle/init.d/README.md +0 -54
  132. data/tools/jungle/init.d/puma +0 -332
  133. data/tools/jungle/init.d/run-puma +0 -3
  134. data/tools/jungle/upstart/README.md +0 -61
  135. data/tools/jungle/upstart/puma-manager.conf +0 -31
  136. data/tools/jungle/upstart/puma.conf +0 -52
data/COPYING DELETED
@@ -1,55 +0,0 @@
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/Gemfile DELETED
@@ -1,10 +0,0 @@
1
- source "http://rubygems.org"
2
-
3
- gem "hoe"
4
- gem "rdoc"
5
- gem "rake-compiler"
6
- gem "rack"
7
-
8
- gem 'minitest', '~> 4.0'
9
-
10
- gem "jruby-openssl", :platform => "jruby"
data/History.txt DELETED
@@ -1,302 +0,0 @@
1
- === 2.2.0 / 2013-07-01
2
-
3
- * 1 major feature:
4
-
5
- * Add ability to preload rack app
6
-
7
- * 2 minor bugfixes:
8
-
9
- * Don't leak info when not in development. Fixes #256
10
- * Load the app, then bind the ports
11
-
12
- === 2.1.1 / 2013-06-20
13
-
14
- * 2 minor bug fixes:
15
-
16
- * Fix daemonization on jruby
17
- * Load the application before daemonizing. Fixes #285
18
-
19
- === 2.1.0 / 2013-06-18
20
-
21
- * 3 minor features:
22
- * Allow listening socket to be configured via Capistrano variable
23
- * Output results from 'stat's command when using pumactl
24
- * Support systemd socket activation
25
-
26
- * 15 bug fixes:
27
- * Deal with pipes closing while stopping. Fixes #270
28
- * Error out early if there is no app configured
29
- * Handle ConnectionError rather than the lowlevel exceptions
30
- * tune with `-C` config file and `on_worker_boot`
31
- * use `-w`
32
- * Fixed some typos in upstart scripts
33
- * Make sure to use bytesize instead of size (MiniSSL write)
34
- * Fix an error in puma-manager.conf
35
- * fix: stop leaking sockets on restart (affects ruby 1.9.3 or before)
36
- * Ignore errors on the cross-thread pipe. Fixes #246
37
- * Ignore errors while uncorking the socket (it might already be closed)
38
- * Ignore the body on a HEAD request. Fixes #278
39
- * Handle all engine data when possible. Fixes #251.
40
- * Handle all read exceptions properly. Fixes #252
41
- * Handle errors from the server better
42
-
43
- * 3 doc changes:
44
- * Add note about on_worker_boot hook
45
- * Add some documentation for Clustered mode
46
- * Added quotes to /etc/puma.conf
47
-
48
- === 2.0.1 / 2013-04-30
49
-
50
- * 1 bug fix:
51
-
52
- * Fix not starting on JRuby properly
53
-
54
- === 2.0.0 / 2013-04-29
55
-
56
- RailsConf 2013 edition!
57
-
58
- * 2 doc changes:
59
- * Start with rackup -s Puma, NOT rackup -s puma.
60
- * Minor doc fixes in the README.md, Capistrano section
61
-
62
- * 2 bug fixes:
63
- * Fix reading RACK_ENV properly. Fixes #234
64
- * Make cap recipe handle tmp/sockets; fixes #228
65
-
66
- * 3 minor changes:
67
- * Fix capistrano recipe
68
- * Fix stdout/stderr logs to sync outputs
69
- * allow binding to IPv6 addresses
70
-
71
- === 2.0.0.b7 / 2013-03-18
72
-
73
- * 5 minor enhancements:
74
-
75
- * Add -q option for :start
76
- * Add -V, --version
77
- * Add default Rack handler helper
78
- * Upstart support
79
- * Set worker directory from configuration file
80
-
81
- * 12 bug fixes:
82
-
83
- * Close the binder in the right place. Fixes #192
84
- * Handle early term in workers. Fixes #206
85
- * Make sure that the default port is 80 when the request doesn't include HTTP_X_FORWARDED_PROTO.
86
- * Prevent Errno::EBADF errors on restart when running ruby 2.0
87
- * Record the proper @master_pid
88
- * Respect the header HTTP_X_FORWARDED_PROTO when the host doesn't include a port number.
89
- * Retry EAGAIN/EWOULDBLOCK during syswrite
90
- * Run exec properly to restart. Fixes #154
91
- * Set Rack run_once to false
92
- * Syncronize all access to @timeouts. Fixes #208
93
- * Write out the state post-daemonize. Fixes #189
94
- * Prevent crash when all workers are gone
95
-
96
- === 2.0.0.b6 / 2013-02-06
97
-
98
- * 2 minor enhancements:
99
-
100
- * Add hook for running when a worker boots
101
- * Advertise the Configuration object for apps to use.
102
-
103
- * 1 bug fix:
104
-
105
- * Change directory in working during upgrade. Fixes #185
106
-
107
- === 2.0.0.b5 / 2013-02-05
108
-
109
- * 2 major features:
110
- * Add phased worker upgrade
111
- * Add support for the rack hijack protocol
112
-
113
- * 2 minor features:
114
- * Add -R to specify the restart command
115
- * Add config file option to specify the restart command
116
-
117
- * 5 bug fixes:
118
- * Cleanup pipes properly. Fixes #182
119
- * Daemonize earlier so that we don't lose app threads. Fixes #183
120
- * Drain the notification pipe. Fixes #176, thanks @cryo28
121
- * Move write_pid to after we daemonize. Fixes #180
122
- * Redirect IO properly and emit message for checkpointing
123
-
124
- === 2.0.0.b4 / 2012-12-12
125
-
126
- * 4 bug fixes:
127
- * Properly check #syswrite's value for variable sized buffers. Fixes #170
128
- * Shutdown status server properly
129
- * Handle char vs byte and mixing syswrite with write properly
130
- * made MiniSSL validate key/cert file existence
131
-
132
- === 2.0.0.b3 / 2012-11-22
133
-
134
- * 1 bug fix:
135
- * Package right files in gem
136
-
137
- === 2.0.0.b2 / 2012-11-18
138
- * 5 minor feature:
139
- * Now Puma is bundled with an capistrano recipe. Just require
140
- 'puma/capistrano' in you deploy.rb
141
- * Only inject CommonLogger in development mode
142
- * Add -p option to pumactl
143
- * Add ability to use pumactl to start a server
144
- * Add options to daemonize puma
145
-
146
- * 7 bug fixes:
147
- * Reset the IOBuffer properly. Fixes #148
148
- * Shutdown gracefully on JRuby with Ctrl-C
149
- * Various methods to get newrelic to start. Fixes #128
150
- * fixing syntax error at capistrano recipe
151
- * Force ECONNRESET when read returns nil
152
- * Be sure to empty the drain the todo before shutting down. Fixes #155
153
- * allow for alternate locations for status app
154
-
155
- === 2.0.0.b1 / 2012-09-11
156
-
157
- * 1 major feature:
158
- * Optional worker process mode (-w) to allow for process scaling in
159
- addition to thread scaling
160
-
161
- * 1 bug fix:
162
- * Introduce Puma::MiniSSL to be able to properly control doing
163
- nonblocking SSL
164
-
165
- NOTE: SSL support in JRuby is not supported at present. Support will
166
- be added back in a future date when a java Puma::MiniSSL is added.
167
-
168
- === 1.6.3 / 2012-09-04
169
-
170
- * 1 bug fix:
171
- * Close sockets waiting in the reactor when a hot restart is performed
172
- so that browsers reconnect on the next request
173
-
174
- === 1.6.2 / 2012-08-27
175
-
176
- * 1 bug fix:
177
- * Rescue StandardError instead of IOError to handle SystemCallErrors
178
- as well as other application exceptions inside the reactor.
179
-
180
- === 1.6.1 / 2012-07-23
181
-
182
- * 1 packaging bug fixed:
183
- * Include missing files
184
-
185
- === 1.6.0 / 2012-07-23
186
-
187
- * 1 major bug fix:
188
- * Prevent slow clients from starving the server by introducing a
189
- dedicated IO reactor thread. Credit for reporting goes to @meh.
190
-
191
- === 1.5.0 / 2012-07-19
192
-
193
- * 7 contributers to this release:
194
- * Christian Mayer
195
- * Darío Javier Cravero
196
- * Dirkjan Bussink
197
- * Gianluca Padovani
198
- * Santiago Pastorino
199
- * Thibault Jouan
200
- * tomykaira
201
-
202
- * 6 bug fixes:
203
- * Define RSTRING_NOT_MODIFIED for Rubinius
204
- * Convert status to integer. Fixes #123
205
- * Delete pidfile when stopping the server
206
- * Allow compilation with -Werror=format-security option
207
- * Fix wrong HTTP version for a HTTP/1.0 request
208
- * Use String#bytesize instead of String#length
209
-
210
- * 3 minor features:
211
- * Added support for setting RACK_ENV via the CLI, config file, and rack app
212
- * Allow Server#run to run sync. Fixes #111
213
- * Puma can now run on windows
214
-
215
- === 1.4.0 / 2012-06-04
216
-
217
- * 1 bug fix:
218
- * SCRIPT_NAME should be passed from env to allow mounting apps
219
-
220
- * 1 experimental feature:
221
- * Add puma.socket key for direct socket access
222
-
223
- === 1.3.1 / 2012-05-15
224
-
225
- * 2 bug fixes:
226
- * use #bytesize instead of #length for Content-Length header
227
- * Use StringIO properly. Fixes #98
228
-
229
- === 1.3.0 / 2012-05-08
230
-
231
- * 2 minor features:
232
- * Return valid Rack responses (passes Lint) from status server
233
- * Add -I option to specify $LOAD_PATH directories
234
-
235
- * 4 bug fixes:
236
- * Don't join the server thread inside the signal handle. Fixes #94
237
- * Make NullIO#read mimic IO#read
238
- * Only stop the status server if it's started. Fixes #84
239
- * Set RACK_ENV early in cli also. Fixes #78
240
-
241
- * 1 new contributer:
242
- * Jesse Cooke
243
-
244
- === 1.2.2 / 2012-04-28
245
-
246
- * 4 bug fixes:
247
-
248
- * Report a lowlevel error to stderr
249
- * Set a fallback SERVER_NAME and SERVER_PORT
250
- * Keep the encoding of the body correct. Fixes #79
251
- * show error.to_s along with backtrace for low-level error
252
-
253
- === 1.2.1 / 2012-04-11
254
-
255
- 1 bug fix:
256
-
257
- * Fix rack.url_scheme for SSL servers. Fixes #65
258
-
259
- === 1.2.0 / 2012-04-11
260
-
261
- 1 major feature:
262
-
263
- * When possible, the internal restart does a "hot restart" meaning
264
- the server sockets remains open, so no connections are lost.
265
-
266
- 1 minor feature:
267
-
268
- * More helpful fallback error message
269
-
270
- 6 bug fixes:
271
-
272
- * Pass the proper args to unknown_error. Fixes #54, #58
273
- * Stop the control server before restarting. Fixes #61
274
- * Fix reporting https only on a true SSL connection
275
- * Set the default content type to 'text/plain'. Fixes #63
276
- * Use REUSEADDR. Fixes #60
277
- * Shutdown gracefull on SIGTERM. Fixes #53
278
-
279
- 2 new contributers:
280
-
281
- * Seamus Abshere
282
- * Steve Richert
283
-
284
- === 1.1.1 / 2012-03-30
285
-
286
- 1 bugfix:
287
-
288
- * Include puma/compat.rb in the gem (oops!)
289
-
290
- === 1.1.0 / 2012-03-30
291
-
292
- 1 bugfix:
293
-
294
- * Make sure that the unix socket has the perms 0777 by default
295
-
296
- 1 minor feature:
297
-
298
- * Add umask param to the unix:// bind to set the umask
299
-
300
- === 1.0.0 / 2012-03-29
301
-
302
- * Released!
data/Manifest.txt DELETED
@@ -1,60 +0,0 @@
1
- COPYING
2
- Gemfile
3
- History.txt
4
- LICENSE
5
- Manifest.txt
6
- README.md
7
- Rakefile
8
- TODO
9
- bin/puma
10
- bin/pumactl
11
- docs/config.md
12
- docs/nginx.md
13
- ext/puma_http11/PumaHttp11Service.java
14
- ext/puma_http11/ext_help.h
15
- ext/puma_http11/extconf.rb
16
- ext/puma_http11/http11_parser.c
17
- ext/puma_http11/http11_parser.h
18
- ext/puma_http11/http11_parser.java.rl
19
- ext/puma_http11/http11_parser.rl
20
- ext/puma_http11/http11_parser_common.rl
21
- ext/puma_http11/io_buffer.c
22
- ext/puma_http11/mini_ssl.c
23
- ext/puma_http11/org/jruby/puma/Http11.java
24
- ext/puma_http11/org/jruby/puma/Http11Parser.java
25
- ext/puma_http11/org/jruby/puma/MiniSSL.java
26
- ext/puma_http11/puma_http11.c
27
- lib/puma.rb
28
- lib/puma/accept_nonblock.rb
29
- lib/puma/app/status.rb
30
- lib/puma/binder.rb
31
- lib/puma/capistrano.rb
32
- lib/puma/cli.rb
33
- lib/puma/client.rb
34
- lib/puma/compat.rb
35
- lib/puma/configuration.rb
36
- lib/puma/const.rb
37
- lib/puma/control_cli.rb
38
- lib/puma/daemon_ext.rb
39
- lib/puma/delegation.rb
40
- lib/puma/detect.rb
41
- lib/puma/events.rb
42
- lib/puma/io_buffer.rb
43
- lib/puma/java_io_buffer.rb
44
- lib/puma/jruby_restart.rb
45
- lib/puma/minissl.rb
46
- lib/puma/null_io.rb
47
- lib/puma/rack_default.rb
48
- lib/puma/rack_patch.rb
49
- lib/puma/reactor.rb
50
- lib/puma/server.rb
51
- lib/puma/thread_pool.rb
52
- lib/puma/util.rb
53
- lib/rack/handler/puma.rb
54
- puma.gemspec
55
- tools/jungle/init.d/README.md
56
- tools/jungle/init.d/puma
57
- tools/jungle/init.d/run-puma
58
- tools/jungle/upstart/README.md
59
- tools/jungle/upstart/puma-manager.conf
60
- tools/jungle/upstart/puma.conf
data/Rakefile DELETED
@@ -1,165 +0,0 @@
1
- require "hoe"
2
- require "rake/extensiontask"
3
- require "rake/javaextensiontask"
4
-
5
- IS_JRUBY = defined?(RUBY_ENGINE) ? RUBY_ENGINE == "jruby" : false
6
-
7
- Hoe.plugin :git
8
-
9
- HOE = Hoe.spec "puma" do
10
- self.rubyforge_name = 'puma'
11
- self.readme_file = "README.md"
12
- self.urls = %w!http://puma.io https://github.com/puma/puma!
13
-
14
- developer 'Evan Phoenix', 'evan@phx.io'
15
-
16
- spec_extras[:extensions] = ["ext/puma_http11/extconf.rb"]
17
- spec_extras[:executables] = ['puma', 'pumactl']
18
- spec_extras[:homepage] = self.urls.first
19
-
20
- require_ruby_version ">= 1.8.7"
21
-
22
- dependency "rack", [">= 1.1", "< 2.0"]
23
-
24
- extra_dev_deps << ["rake-compiler", "~> 0.8.0"]
25
- end
26
-
27
- # hoe/test and rake-compiler don't seem to play well together, so disable
28
- # hoe/test's .gemtest touch file thingy for now
29
- HOE.spec.files -= [".gemtest"]
30
-
31
- include Hoe::Git
32
-
33
- desc "Print the current changelog."
34
- task "changelog" do
35
- tag = ENV["FROM"] || git_tags.last
36
- range = [tag, "HEAD"].compact.join ".."
37
- cmd = "git log #{range} '--format=tformat:%B|||%aN|||%aE|||'"
38
- now = Time.new.strftime "%Y-%m-%d"
39
-
40
- changes = `#{cmd}`.split(/\|\|\|/).each_slice(3).map { |msg, author, email|
41
- msg.split(/\n/).reject { |s| s.empty? }.first
42
- }.flatten.compact
43
-
44
- $changes = Hash.new { |h,k| h[k] = [] }
45
-
46
- codes = {
47
- "!" => :major,
48
- "+" => :minor,
49
- "*" => :minor,
50
- "-" => :bug,
51
- "?" => :unknown,
52
- }
53
-
54
- codes_re = Regexp.escape codes.keys.join
55
-
56
- changes.each do |change|
57
- if change =~ /^\s*([#{codes_re}])\s*(.*)/ then
58
- code, line = codes[$1], $2
59
- else
60
- code, line = codes["?"], change.chomp
61
- end
62
-
63
- $changes[code] << line
64
- end
65
-
66
- puts "=== #{ENV['VERSION'] || 'NEXT'} / #{now}"
67
- puts
68
- changelog_section :major
69
- changelog_section :minor
70
- changelog_section :bug
71
- changelog_section :unknown
72
- puts
73
- end
74
-
75
- # puma.gemspec
76
-
77
- file "#{HOE.spec.name}.gemspec" => ['Rakefile', "lib/puma/const.rb"] do |t|
78
- puts "Generating #{t.name}"
79
- File.open(t.name, 'wb') { |f| f.write HOE.spec.to_ruby }
80
- end
81
-
82
- desc "Generate or update the standalone gemspec file for the project"
83
- task :gemspec => ["#{HOE.spec.name}.gemspec"]
84
-
85
- # generate extension code using Ragel (C and Java)
86
- desc "Generate extension code (C and Java) using Ragel"
87
- task :ragel
88
-
89
- file 'ext/puma_http11/http11_parser.c' => ['ext/puma_http11/http11_parser.rl'] do |t|
90
- begin
91
- sh "ragel #{t.prerequisites.last} -C -G2 -I ext/puma_http11 -o #{t.name}"
92
- rescue
93
- fail "Could not build wrapper using Ragel (it failed or not installed?)"
94
- end
95
- end
96
- task :ragel => ['ext/puma_http11/http11_parser.c']
97
-
98
- file 'ext/puma_http11/org/jruby/puma/Http11Parser.java' => ['ext/puma_http11/http11_parser.java.rl'] do |t|
99
- begin
100
- sh "ragel #{t.prerequisites.last} -J -G2 -I ext/puma_http11 -o #{t.name}"
101
- rescue
102
- fail "Could not build wrapper using Ragel (it failed or not installed?)"
103
- end
104
- end
105
- task :ragel => ['ext/puma_http11/org/jruby/puma/Http11Parser.java']
106
-
107
- if !IS_JRUBY
108
-
109
- # compile extensions using rake-compiler
110
- # C (MRI, Rubinius)
111
- Rake::ExtensionTask.new("puma_http11", HOE.spec) do |ext|
112
- # place extension inside namespace
113
- ext.lib_dir = "lib/puma"
114
-
115
- ext.cross_compile = true
116
- ext.cross_platform = ['i386-mswin32-60', 'i386-mingw32']
117
- ext.cross_compiling do |spec|
118
- # add fat-binary stub only when cross compiling
119
- spec.files << "lib/puma/puma_http11.rb"
120
- end
121
-
122
- CLEAN.include "lib/puma/{1.8,1.9}"
123
- CLEAN.include "lib/puma/puma_http11.rb"
124
- end
125
-
126
- else
127
-
128
- # Java (JRuby)
129
- Rake::JavaExtensionTask.new("puma_http11", HOE.spec) do |ext|
130
- ext.lib_dir = "lib/puma"
131
- end
132
-
133
- end
134
-
135
- # the following is a fat-binary stub that will be used when
136
- # require 'puma/puma_http11' and will use either 1.8 or 1.9 version depending
137
- # on RUBY_VERSION
138
- file "lib/puma/puma_http11.rb" do |t|
139
- File.open(t.name, "w") do |f|
140
- f.puts "RUBY_VERSION =~ /(\d+.\d+)/"
141
- f.puts 'require "puma/#{$1}/puma_http11"'
142
- end
143
- end
144
-
145
- # tests require extension be compiled, but depend on the platform
146
- if IS_JRUBY
147
- task :test => [:java]
148
- else
149
- task :test => [:compile]
150
- end
151
-
152
- namespace :test do
153
- desc "Run the integration tests"
154
- task :integration do
155
- sh "cd test/shell; sh run.sh"
156
- end
157
-
158
- desc "Run all tests"
159
- if defined?(JRUBY_VERSION) and ENV['TRAVIS']
160
- task :all => :test
161
- else
162
- task :all => [:test, "test:integration"]
163
- end
164
- end
165
-
data/TODO DELETED
@@ -1,5 +0,0 @@
1
-
2
- v1.2. Rewrite and merge mongrel cluster and mongrel_rails into something small and maintainable. Remove gem_plugin entirely.
3
-
4
- v1.1.1. See if Java is setting the server version string in the request properly.
5
-
data/docs/config.md DELETED
File without changes
@@ -1,15 +0,0 @@
1
- #ifndef ext_help_h
2
- #define ext_help_h
3
-
4
- #define RAISE_NOT_NULL(T) if(T == NULL) rb_raise(rb_eArgError, "%s", "NULL found for " # T " when shouldn't be.");
5
- #define DATA_GET(from,type,name) Data_Get_Struct(from,type,name); RAISE_NOT_NULL(name);
6
- #define REQUIRE_TYPE(V, T) if(TYPE(V) != T) rb_raise(rb_eTypeError, "%s", "Wrong argument type for " # V " required " # T);
7
- #define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
8
-
9
- #ifdef DEBUG
10
- #define TRACE() fprintf(stderr, "> %s:%d:%s\n", __FILE__, __LINE__, __FUNCTION__)
11
- #else
12
- #define TRACE()
13
- #endif
14
-
15
- #endif