Rack::Server patch

0 views
Skip to first unread message

Yehuda Katz

unread,
Nov 20, 2009, 7:42:43 PM11/20/09
to rack-devel
Hey guys,

Carl and I spent a couple of day refactoring the code in bin/rackup into Rack::Server. The main motivation for this was to enable Rails to ditch our code in script/server and simply inherit from the requisite Rack code. I think the code improvement speaks for itself. In the process of this work, we also moved a few things out of Rackup into more usable locations, like Rack::Handler.default (to get the handler that Rack will use if none is specified) and Rack::Builder.parse_file (which we currently duplicate in ActionDispatch).

You can check out the changes at github.com/carllerche/rack, and I have also attached a patch. In addition to converting the rackup binary to a class, we also wrote tests for each function of rackup, to be sure we wouldn't break anything in the refactor. As a result, this patch now has tests for rackup!

Yehuda Katz
Developer | Engine Yard
(ph) 718.877.1325

Yehuda Katz

unread,
Nov 20, 2009, 7:46:11 PM11/20/09
to rack-devel
Patches attached.

[1] tests_patch.diff -- Adds tests for the functionality of rackup
[2] rack_server_patch.diff -- Moves Rack::Server into a separate object

Yehuda Katz
Developer | Engine Yard
(ph) 718.877.1325


2009/11/20 Yehuda Katz <wyc...@gmail.com>
tests_patch.diff
rack_server_patch.diff

Yehuda Katz

unread,
Nov 20, 2009, 7:52:39 PM11/20/09
to rack-devel
Patches attached.

[1] tests_patch.diff -- Adds tests for the functionality of rackup
[2] rack_server_patch.diff -- Moves Rack::Server into a separate object
Yehuda Katz
Developer | Engine Yard
(ph) 718.877.1325


2009/11/20 Yehuda Katz <wyc...@gmail.com>
tests_patch.diff
rack_server_patch.diff

Joshua Peek

unread,
Nov 20, 2009, 9:10:05 PM11/20/09
to rack-...@googlegroups.com
+1 Looks good.

My only suggestion would be to keep the old pid/daemonize behavior. So
don't set a default pid file and only set one if its provided.
--
Joshua Peek

Christian Neukirchen

unread,
Nov 21, 2009, 5:17:48 AM11/21/09
to rack-...@googlegroups.com
Joshua Peek <jo...@joshpeek.com> writes:

> So
> don't set a default pid file and only set one if its provided.

+1

--
Christian Neukirchen <chneuk...@gmail.com> http://chneukirchen.org

Christian Neukirchen

unread,
Nov 21, 2009, 5:18:52 AM11/21/09
to rack-...@googlegroups.com
Yehuda Katz <wyc...@gmail.com> writes:

> [1] tests_patch.diff -- Adds tests for the functionality of rackup
> [2] rack_server_patch.diff -- Moves Rack::Server into a separate object

LGTM.
Reply all
Reply to author
Forward
0 new messages