public
Description: OUTDATED mirror of Rack's darcs repository, use github.com/chneukirchen/rack
Homepage: http://rack.rubyforge.org/
Clone URL: git://github.com/chneukirchen/rack-mirror.git
Allow handlers to register themselves with Rack::Handler.

darcs-hash:20080524155410-4fc50-e851f342c8bd7461dfb40c30575fec73d0fe380e.g
z
chneukirchen (author)
Sat May 24 08:54:00 -0700 2008
commit  ed86dfd676dcb46e276b6906f017df514e5632f9
tree    0942c84f57f557d899fa767e06ca37a196563185
parent  aa2d5501e5f65820c5480552289d8d52ab0ba31e
...
103
104
105
106
107
 
108
109
110
...
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
...
103
104
105
 
 
106
107
108
109
...
120
121
122
 
 
 
 
 
 
 
 
 
 
 
 
123
124
125
0
@@ -103,8 +103,7 @@ else
0
   inner_app = Object.const_get(File.basename(config, '.rb').capitalize)
0
 end
0
 
0
-case server
0
-when nil
0
+unless server = Rack::Handler.get(server)
0
   # Guess.
0
   if ENV.include?("PHP_FCGI_CHILDREN")
0
     server = Rack::Handler::FastCGI
0
@@ -121,18 +120,6 @@ when nil
0
       server = Rack::Handler::WEBrick
0
     end
0
   end
0
-when "mongrel"
0
- server = Rack::Handler::Mongrel
0
-when "evented_mongrel"
0
- server = Rack::Handler::EventedMongrel
0
-when "webrick"
0
- server = Rack::Handler::WEBrick
0
-when "cgi"
0
- server = Rack::Handler::CGI
0
-when "fastcgi"
0
- server = Rack::Handler::FastCGI
0
-else
0
- server = Rack::Handler.const_get(server.capitalize)
0
 end
0
 
0
 p server if $DEBUG
...
26
27
28
 
29
30
31
...
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
...
26
27
28
29
30
31
32
...
71
72
73
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74
0
@@ -26,6 +26,7 @@ module Rack
0
   autoload :CommonLogger, "rack/commonlogger"
0
   autoload :File, "rack/file"
0
   autoload :ForwardRequest, "rack/recursive"
0
+ autoload :Handler, "rack/handler"
0
   autoload :Lint, "rack/lint"
0
   autoload :Recursive, "rack/recursive"
0
   autoload :Reloader, "rack/reloader"
0
@@ -70,23 +71,4 @@ module Rack
0
   module Adapter
0
     autoload :Camping, "rack/adapter/camping"
0
   end
0
-
0
- # *Handlers* connect web servers with Rack.
0
- #
0
- # Rack includes Handlers for Mongrel, WEBrick, FastCGI, CGI, SCGI
0
- # and LiteSpeed.
0
- #
0
- # Handlers usually are activated by calling <tt>MyHandler.run(myapp)</tt>.
0
- # A second optional hash can be passed to include server-specific
0
- # configuration.
0
-
0
- module Handler
0
- autoload :CGI, "rack/handler/cgi"
0
- autoload :FastCGI, "rack/handler/fastcgi"
0
- autoload :Mongrel, "rack/handler/mongrel"
0
- autoload :EventedMongrel, "rack/handler/evented_mongrel"
0
- autoload :WEBrick, "rack/handler/webrick"
0
- autoload :LSWS, "rack/handler/lsws"
0
- autoload :SCGI, "rack/handler/scgi"
0
- end
0
 end

Comments

    No one has commented yet.