colouringcode-passenger 0.1 → 0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/NEWS +129 -0
- data/Rakefile +2 -2
- data/bin/passenger-install-apache2-module +1 -0
- data/bin/passenger-install-nginx-module +4 -2
- data/ext/apache2/Hooks.cpp +4 -2
- data/ext/common/ApplicationPoolServer.h +1 -1
- data/ext/common/ApplicationPoolServerExecutable.cpp +1 -1
- data/ext/common/MessageChannel.h +48 -4
- data/ext/common/StandardApplicationPool.h +4 -2
- data/ext/common/Version.h +1 -1
- data/ext/nginx/Configuration.c +1 -1
- data/ext/nginx/HttpStatusExtractor.h +1 -0
- data/ext/nginx/ScgiRequestParser.h +1 -0
- data/ext/oxt/system_calls.cpp +11 -0
- data/ext/oxt/system_calls.hpp +2 -1
- data/ext/oxt/thread.hpp +97 -1
- data/ext/phusion_passenger/native_support.c +30 -1
- data/lib/phusion_passenger/constants.rb +1 -1
- data/lib/phusion_passenger/dependencies.rb +32 -0
- data/lib/phusion_passenger/message_channel.rb +45 -3
- data/lib/phusion_passenger/platform_info.rb +1 -1
- data/lib/phusion_passenger/rack/application_spawner.rb +10 -4
- data/lib/phusion_passenger/rack/request_handler.rb +2 -5
- data/lib/phusion_passenger/railz/application_spawner.rb +59 -7
- data/lib/phusion_passenger/utils.rb +70 -16
- data/{vendor/rack-1.0.0-git/lib/rack → lib/phusion_passenger/utils}/rewindable_input.rb +34 -9
- data/test/ApplicationPoolTest.cpp +1 -1
- data/test/MessageChannelTest.cpp +9 -1
- data/test/stub/message_channel.rb +1 -1
- data/test/stub/message_channel_2.rb +1 -1
- data/test/stub/message_channel_3.rb +2 -2
- metadata +43 -155
- data/doc/Architectural overview.html +0 -1
- data/doc/rdoc/classes/ConditionVariable.html +0 -194
- data/doc/rdoc/classes/Exception.html +0 -120
- data/doc/rdoc/classes/GC.html +0 -113
- data/doc/rdoc/classes/IO.html +0 -169
- data/doc/rdoc/classes/PhusionPassenger.html +0 -238
- data/doc/rdoc/classes/PhusionPassenger/AbstractInstaller.html +0 -153
- data/doc/rdoc/classes/PhusionPassenger/AbstractRequestHandler.html +0 -517
- data/doc/rdoc/classes/PhusionPassenger/AbstractServer.html +0 -719
- data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerAlreadyStarted.html +0 -97
- data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerError.html +0 -96
- data/doc/rdoc/classes/PhusionPassenger/AbstractServer/ServerNotStarted.html +0 -97
- data/doc/rdoc/classes/PhusionPassenger/AbstractServer/UnknownMessage.html +0 -96
- data/doc/rdoc/classes/PhusionPassenger/AbstractServerCollection.html +0 -598
- data/doc/rdoc/classes/PhusionPassenger/AdminTools.html +0 -140
- data/doc/rdoc/classes/PhusionPassenger/AdminTools/ControlProcess.html +0 -317
- data/doc/rdoc/classes/PhusionPassenger/AdminTools/ControlProcess/Instance.html +0 -138
- data/doc/rdoc/classes/PhusionPassenger/AppInitError.html +0 -154
- data/doc/rdoc/classes/PhusionPassenger/Application.html +0 -283
- data/doc/rdoc/classes/PhusionPassenger/ConsoleTextTemplate.html +0 -172
- data/doc/rdoc/classes/PhusionPassenger/FrameworkInitError.html +0 -145
- data/doc/rdoc/classes/PhusionPassenger/HTMLTemplate.html +0 -181
- data/doc/rdoc/classes/PhusionPassenger/InitializationError.html +0 -141
- data/doc/rdoc/classes/PhusionPassenger/InvalidPath.html +0 -92
- data/doc/rdoc/classes/PhusionPassenger/MessageChannel.html +0 -489
- data/doc/rdoc/classes/PhusionPassenger/NativeSupport.html +0 -350
- data/doc/rdoc/classes/PhusionPassenger/Rack.html +0 -91
- data/doc/rdoc/classes/PhusionPassenger/Rack/ApplicationSpawner.html +0 -188
- data/doc/rdoc/classes/PhusionPassenger/Rack/RequestHandler.html +0 -199
- data/doc/rdoc/classes/PhusionPassenger/Railz.html +0 -95
- data/doc/rdoc/classes/PhusionPassenger/Railz/ApplicationSpawner.html +0 -438
- data/doc/rdoc/classes/PhusionPassenger/Railz/ApplicationSpawner/Error.html +0 -98
- data/doc/rdoc/classes/PhusionPassenger/Railz/CGIFixed.html +0 -200
- data/doc/rdoc/classes/PhusionPassenger/Railz/FrameworkSpawner.html +0 -436
- data/doc/rdoc/classes/PhusionPassenger/Railz/FrameworkSpawner/Error.html +0 -98
- data/doc/rdoc/classes/PhusionPassenger/Railz/RequestHandler.html +0 -155
- data/doc/rdoc/classes/PhusionPassenger/SpawnManager.html +0 -402
- data/doc/rdoc/classes/PhusionPassenger/UnknownError.html +0 -125
- data/doc/rdoc/classes/PhusionPassenger/Utils.html +0 -803
- data/doc/rdoc/classes/PhusionPassenger/Utils/PseudoIO.html +0 -169
- data/doc/rdoc/classes/PhusionPassenger/VersionNotFound.html +0 -140
- data/doc/rdoc/classes/PhusionPassenger/WSGI.html +0 -89
- data/doc/rdoc/classes/PhusionPassenger/WSGI/ApplicationSpawner.html +0 -188
- data/doc/rdoc/classes/PlatformInfo.html +0 -866
- data/doc/rdoc/classes/RakeExtensions.html +0 -197
- data/doc/rdoc/classes/Signal.html +0 -131
- data/doc/rdoc/created.rid +0 -1
- data/doc/rdoc/files/DEVELOPERS_TXT.html +0 -255
- data/doc/rdoc/files/README.html +0 -175
- data/doc/rdoc/files/ext/phusion_passenger/native_support_c.html +0 -92
- data/doc/rdoc/files/lib/phusion_passenger/abstract_installer_rb.html +0 -129
- data/doc/rdoc/files/lib/phusion_passenger/abstract_request_handler_rb.html +0 -129
- data/doc/rdoc/files/lib/phusion_passenger/abstract_server_collection_rb.html +0 -126
- data/doc/rdoc/files/lib/phusion_passenger/abstract_server_rb.html +0 -128
- data/doc/rdoc/files/lib/phusion_passenger/admin_tools/control_process_rb.html +0 -130
- data/doc/rdoc/files/lib/phusion_passenger/admin_tools_rb.html +0 -122
- data/doc/rdoc/files/lib/phusion_passenger/application_rb.html +0 -127
- data/doc/rdoc/files/lib/phusion_passenger/console_text_template_rb.html +0 -126
- data/doc/rdoc/files/lib/phusion_passenger/constants_rb.html +0 -122
- data/doc/rdoc/files/lib/phusion_passenger/dependencies_rb.html +0 -134
- data/doc/rdoc/files/lib/phusion_passenger/events_rb.html +0 -122
- data/doc/rdoc/files/lib/phusion_passenger/exceptions_rb.html +0 -122
- data/doc/rdoc/files/lib/phusion_passenger/html_template_rb.html +0 -126
- data/doc/rdoc/files/lib/phusion_passenger/message_channel_rb.html +0 -120
- data/doc/rdoc/files/lib/phusion_passenger/packaging_rb.html +0 -122
- data/doc/rdoc/files/lib/phusion_passenger/platform_info_rb.html +0 -127
- data/doc/rdoc/files/lib/phusion_passenger/rack/application_spawner_rb.html +0 -133
- data/doc/rdoc/files/lib/phusion_passenger/rack/request_handler_rb.html +0 -125
- data/doc/rdoc/files/lib/phusion_passenger/railz/application_spawner_rb.html +0 -140
- data/doc/rdoc/files/lib/phusion_passenger/railz/cgi_fixed_rb.html +0 -126
- data/doc/rdoc/files/lib/phusion_passenger/railz/framework_spawner_rb.html +0 -145
- data/doc/rdoc/files/lib/phusion_passenger/railz/request_handler_rb.html +0 -125
- data/doc/rdoc/files/lib/phusion_passenger/simple_benchmarking_rb.html +0 -122
- data/doc/rdoc/files/lib/phusion_passenger/spawn_manager_rb.html +0 -159
- data/doc/rdoc/files/lib/phusion_passenger/utils_rb.html +0 -174
- data/doc/rdoc/files/lib/phusion_passenger/wsgi/application_spawner_rb.html +0 -129
- data/doc/rdoc/files/misc/rake/extensions_rb.html +0 -130
- data/doc/rdoc/fr_class_index.html +0 -91
- data/doc/rdoc/fr_file_index.html +0 -76
- data/doc/rdoc/fr_method_index.html +0 -205
- data/doc/rdoc/index.html +0 -26
- data/doc/rdoc/rdoc-style.css +0 -187
- data/vendor/README +0 -13
- data/vendor/README_FOR_PACKAGERS +0 -1
- data/vendor/rack-1.0.0-git/COPYING +0 -18
- data/vendor/rack-1.0.0-git/KNOWN-ISSUES +0 -18
- data/vendor/rack-1.0.0-git/README +0 -353
- data/vendor/rack-1.0.0-git/Rakefile +0 -164
- data/vendor/rack-1.0.0-git/lib/rack.rb +0 -90
- data/vendor/rack-1.0.0-git/lib/rack/adapter/camping.rb +0 -22
- data/vendor/rack-1.0.0-git/lib/rack/auth/abstract/handler.rb +0 -37
- data/vendor/rack-1.0.0-git/lib/rack/auth/abstract/request.rb +0 -37
- data/vendor/rack-1.0.0-git/lib/rack/auth/basic.rb +0 -58
- data/vendor/rack-1.0.0-git/lib/rack/auth/digest/md5.rb +0 -124
- data/vendor/rack-1.0.0-git/lib/rack/auth/digest/nonce.rb +0 -51
- data/vendor/rack-1.0.0-git/lib/rack/auth/digest/params.rb +0 -55
- data/vendor/rack-1.0.0-git/lib/rack/auth/digest/request.rb +0 -40
- data/vendor/rack-1.0.0-git/lib/rack/auth/openid.rb +0 -487
- data/vendor/rack-1.0.0-git/lib/rack/builder.rb +0 -63
- data/vendor/rack-1.0.0-git/lib/rack/cascade.rb +0 -41
- data/vendor/rack-1.0.0-git/lib/rack/chunked.rb +0 -49
- data/vendor/rack-1.0.0-git/lib/rack/commonlogger.rb +0 -52
- data/vendor/rack-1.0.0-git/lib/rack/conditionalget.rb +0 -47
- data/vendor/rack-1.0.0-git/lib/rack/content_length.rb +0 -29
- data/vendor/rack-1.0.0-git/lib/rack/content_type.rb +0 -23
- data/vendor/rack-1.0.0-git/lib/rack/deflater.rb +0 -96
- data/vendor/rack-1.0.0-git/lib/rack/directory.rb +0 -153
- data/vendor/rack-1.0.0-git/lib/rack/file.rb +0 -88
- data/vendor/rack-1.0.0-git/lib/rack/handler.rb +0 -69
- data/vendor/rack-1.0.0-git/lib/rack/handler/cgi.rb +0 -61
- data/vendor/rack-1.0.0-git/lib/rack/handler/evented_mongrel.rb +0 -8
- data/vendor/rack-1.0.0-git/lib/rack/handler/fastcgi.rb +0 -88
- data/vendor/rack-1.0.0-git/lib/rack/handler/lsws.rb +0 -55
- data/vendor/rack-1.0.0-git/lib/rack/handler/mongrel.rb +0 -84
- data/vendor/rack-1.0.0-git/lib/rack/handler/scgi.rb +0 -59
- data/vendor/rack-1.0.0-git/lib/rack/handler/swiftiplied_mongrel.rb +0 -8
- data/vendor/rack-1.0.0-git/lib/rack/handler/thin.rb +0 -18
- data/vendor/rack-1.0.0-git/lib/rack/handler/webrick.rb +0 -67
- data/vendor/rack-1.0.0-git/lib/rack/head.rb +0 -19
- data/vendor/rack-1.0.0-git/lib/rack/lint.rb +0 -537
- data/vendor/rack-1.0.0-git/lib/rack/lobster.rb +0 -65
- data/vendor/rack-1.0.0-git/lib/rack/lock.rb +0 -16
- data/vendor/rack-1.0.0-git/lib/rack/methodoverride.rb +0 -27
- data/vendor/rack-1.0.0-git/lib/rack/mime.rb +0 -204
- data/vendor/rack-1.0.0-git/lib/rack/mock.rb +0 -184
- data/vendor/rack-1.0.0-git/lib/rack/recursive.rb +0 -57
- data/vendor/rack-1.0.0-git/lib/rack/reloader.rb +0 -106
- data/vendor/rack-1.0.0-git/lib/rack/request.rb +0 -248
- data/vendor/rack-1.0.0-git/lib/rack/response.rb +0 -183
- data/vendor/rack-1.0.0-git/lib/rack/session/abstract/id.rb +0 -142
- data/vendor/rack-1.0.0-git/lib/rack/session/cookie.rb +0 -91
- data/vendor/rack-1.0.0-git/lib/rack/session/memcache.rb +0 -109
- data/vendor/rack-1.0.0-git/lib/rack/session/pool.rb +0 -100
- data/vendor/rack-1.0.0-git/lib/rack/showexceptions.rb +0 -349
- data/vendor/rack-1.0.0-git/lib/rack/showstatus.rb +0 -106
- data/vendor/rack-1.0.0-git/lib/rack/static.rb +0 -38
- data/vendor/rack-1.0.0-git/lib/rack/urlmap.rb +0 -55
- data/vendor/rack-1.0.0-git/lib/rack/utils.rb +0 -522
@@ -1,98 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
-
<!DOCTYPE html
|
3
|
-
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
-
<html>
|
6
|
-
<head>
|
7
|
-
<title>Class: PhusionPassenger::Railz::ApplicationSpawner::Error</title>
|
8
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
9
|
-
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
10
|
-
|
11
|
-
<script language="JavaScript" type="text/javascript">
|
12
|
-
// <![CDATA[
|
13
|
-
|
14
|
-
function toggleSource( id )
|
15
|
-
{
|
16
|
-
var elem
|
17
|
-
var link
|
18
|
-
|
19
|
-
if( document.getElementById )
|
20
|
-
{
|
21
|
-
elem = document.getElementById( id )
|
22
|
-
link = document.getElementById( "l_" + id )
|
23
|
-
}
|
24
|
-
else if ( document.all )
|
25
|
-
{
|
26
|
-
elem = eval( "document.all." + id )
|
27
|
-
link = eval( "document.all.l_" + id )
|
28
|
-
}
|
29
|
-
else
|
30
|
-
return false;
|
31
|
-
|
32
|
-
if( elem.style.display == "block" )
|
33
|
-
{
|
34
|
-
elem.style.display = "none"
|
35
|
-
link.innerHTML = "show source"
|
36
|
-
}
|
37
|
-
else
|
38
|
-
{
|
39
|
-
elem.style.display = "block"
|
40
|
-
link.innerHTML = "hide source"
|
41
|
-
}
|
42
|
-
}
|
43
|
-
|
44
|
-
function openCode( url )
|
45
|
-
{
|
46
|
-
window.open( url, "SOURCE_CODE", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=480,width=750" ).focus();
|
47
|
-
}
|
48
|
-
// ]]>
|
49
|
-
</script>
|
50
|
-
</head>
|
51
|
-
|
52
|
-
<body>
|
53
|
-
<table width="100%" border='0' cellpadding='0' cellspacing='0' class='banner'><tr>
|
54
|
-
<td class="file-title"><span class="file-title-prefix">Class</span><br />PhusionPassenger::Railz::ApplicationSpawner::Error</td>
|
55
|
-
<td align="right">
|
56
|
-
<table cellspacing="0" cellpadding="2">
|
57
|
-
<tr valign="top">
|
58
|
-
<td>In:</td>
|
59
|
-
<td>
|
60
|
-
<a href="../../../../files/lib/phusion_passenger/railz/application_spawner_rb.html">lib/phusion_passenger/railz/application_spawner.rb</a>
|
61
|
-
</td>
|
62
|
-
</tr>
|
63
|
-
<tr>
|
64
|
-
<td>Parent:</td>
|
65
|
-
<td>
|
66
|
-
AbstractServer::ServerError
|
67
|
-
</td>
|
68
|
-
</tr>
|
69
|
-
</table>
|
70
|
-
</td>
|
71
|
-
</tr>
|
72
|
-
</table>
|
73
|
-
<!-- banner header -->
|
74
|
-
|
75
|
-
<div id="bodyContent">
|
76
|
-
<div id="content">
|
77
|
-
|
78
|
-
<div class="description"><p>
|
79
|
-
This exception means that the <a
|
80
|
-
href="../ApplicationSpawner.html">ApplicationSpawner</a> server process
|
81
|
-
exited unexpectedly.
|
82
|
-
</p>
|
83
|
-
</div>
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
</div>
|
94
|
-
|
95
|
-
</div>
|
96
|
-
|
97
|
-
</body>
|
98
|
-
</html>
|
@@ -1,200 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
-
<!DOCTYPE html
|
3
|
-
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
-
<html>
|
6
|
-
<head>
|
7
|
-
<title>Class: PhusionPassenger::Railz::CGIFixed</title>
|
8
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
9
|
-
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
10
|
-
|
11
|
-
<script language="JavaScript" type="text/javascript">
|
12
|
-
// <![CDATA[
|
13
|
-
|
14
|
-
function toggleSource( id )
|
15
|
-
{
|
16
|
-
var elem
|
17
|
-
var link
|
18
|
-
|
19
|
-
if( document.getElementById )
|
20
|
-
{
|
21
|
-
elem = document.getElementById( id )
|
22
|
-
link = document.getElementById( "l_" + id )
|
23
|
-
}
|
24
|
-
else if ( document.all )
|
25
|
-
{
|
26
|
-
elem = eval( "document.all." + id )
|
27
|
-
link = eval( "document.all.l_" + id )
|
28
|
-
}
|
29
|
-
else
|
30
|
-
return false;
|
31
|
-
|
32
|
-
if( elem.style.display == "block" )
|
33
|
-
{
|
34
|
-
elem.style.display = "none"
|
35
|
-
link.innerHTML = "show source"
|
36
|
-
}
|
37
|
-
else
|
38
|
-
{
|
39
|
-
elem.style.display = "block"
|
40
|
-
link.innerHTML = "hide source"
|
41
|
-
}
|
42
|
-
}
|
43
|
-
|
44
|
-
function openCode( url )
|
45
|
-
{
|
46
|
-
window.open( url, "SOURCE_CODE", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=480,width=750" ).focus();
|
47
|
-
}
|
48
|
-
// ]]>
|
49
|
-
</script>
|
50
|
-
</head>
|
51
|
-
|
52
|
-
<body>
|
53
|
-
<table width="100%" border='0' cellpadding='0' cellspacing='0' class='banner'><tr>
|
54
|
-
<td class="file-title"><span class="file-title-prefix">Class</span><br />PhusionPassenger::Railz::CGIFixed</td>
|
55
|
-
<td align="right">
|
56
|
-
<table cellspacing="0" cellpadding="2">
|
57
|
-
<tr valign="top">
|
58
|
-
<td>In:</td>
|
59
|
-
<td>
|
60
|
-
<a href="../../../files/lib/phusion_passenger/railz/cgi_fixed_rb.html">lib/phusion_passenger/railz/cgi_fixed.rb</a>
|
61
|
-
</td>
|
62
|
-
</tr>
|
63
|
-
<tr>
|
64
|
-
<td>Parent:</td>
|
65
|
-
<td>
|
66
|
-
::CGI
|
67
|
-
</td>
|
68
|
-
</tr>
|
69
|
-
</table>
|
70
|
-
</td>
|
71
|
-
</tr>
|
72
|
-
</table>
|
73
|
-
<!-- banner header -->
|
74
|
-
|
75
|
-
<div id="bodyContent">
|
76
|
-
<div id="content">
|
77
|
-
|
78
|
-
<div class="description"><p>
|
79
|
-
Modifies CGI so that we can use it. Main thing it does is expose the <a
|
80
|
-
href="CGIFixed.html#M000067">stdinput</a> and <a
|
81
|
-
href="CGIFixed.html#M000068">stdoutput</a> so <a
|
82
|
-
href="RequestHandler.html">RequestHandler</a> can connect them to the right
|
83
|
-
sources. It also exposes the <a href="CGIFixed.html#M000066">env_table</a>
|
84
|
-
so that <a href="RequestHandler.html">RequestHandler</a> can hook the
|
85
|
-
request parameters into the environment table.
|
86
|
-
</p>
|
87
|
-
<p>
|
88
|
-
This is partially based on the FastCGI code, but much of the Ruby 1.6
|
89
|
-
backwards compatibility is removed.
|
90
|
-
</p>
|
91
|
-
</div>
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
<div class="sectiontitle">Methods</div>
|
96
|
-
<ul>
|
97
|
-
<li><a href="#M000065">args</a></li>
|
98
|
-
<li><a href="#M000066">env_table</a></li>
|
99
|
-
<li><a href="#M000064">new</a></li>
|
100
|
-
<li><a href="#M000067">stdinput</a></li>
|
101
|
-
<li><a href="#M000068">stdoutput</a></li>
|
102
|
-
</ul>
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
<div class="sectiontitle">Public Class methods</div>
|
110
|
-
<div class="method">
|
111
|
-
<div class="title">
|
112
|
-
<a name="M000064"></a><b>new</b>(params, input, output, *args)
|
113
|
-
</div>
|
114
|
-
<div class="sourcecode">
|
115
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000064_source')" id="l_M000064_source">show source</a> ]</p>
|
116
|
-
<div id="M000064_source" class="dyn-source">
|
117
|
-
<pre>
|
118
|
-
<span class="ruby-comment cmt"># File lib/phusion_passenger/railz/cgi_fixed.rb, line 42</span>
|
119
|
-
42: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">params</span>, <span class="ruby-identifier">input</span>, <span class="ruby-identifier">output</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
|
120
|
-
43: <span class="ruby-ivar">@env_table</span> = <span class="ruby-identifier">params</span>
|
121
|
-
44: <span class="ruby-ivar">@args</span> = <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>
|
122
|
-
45: <span class="ruby-ivar">@input</span> = <span class="ruby-identifier">input</span>
|
123
|
-
46: <span class="ruby-ivar">@out</span> = <span class="ruby-identifier">output</span>
|
124
|
-
47: <span class="ruby-keyword kw">super</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
|
125
|
-
48: <span class="ruby-keyword kw">end</span>
|
126
|
-
</pre>
|
127
|
-
</div>
|
128
|
-
</div>
|
129
|
-
</div>
|
130
|
-
<div class="sectiontitle">Public Instance methods</div>
|
131
|
-
<div class="method">
|
132
|
-
<div class="title">
|
133
|
-
<a name="M000065"></a><b>args</b>()
|
134
|
-
</div>
|
135
|
-
<div class="sourcecode">
|
136
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000065_source')" id="l_M000065_source">show source</a> ]</p>
|
137
|
-
<div id="M000065_source" class="dyn-source">
|
138
|
-
<pre>
|
139
|
-
<span class="ruby-comment cmt"># File lib/phusion_passenger/railz/cgi_fixed.rb, line 50</span>
|
140
|
-
50: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">args</span>
|
141
|
-
51: <span class="ruby-ivar">@args</span>
|
142
|
-
52: <span class="ruby-keyword kw">end</span>
|
143
|
-
</pre>
|
144
|
-
</div>
|
145
|
-
</div>
|
146
|
-
</div>
|
147
|
-
<div class="method">
|
148
|
-
<div class="title">
|
149
|
-
<a name="M000066"></a><b>env_table</b>()
|
150
|
-
</div>
|
151
|
-
<div class="sourcecode">
|
152
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000066_source')" id="l_M000066_source">show source</a> ]</p>
|
153
|
-
<div id="M000066_source" class="dyn-source">
|
154
|
-
<pre>
|
155
|
-
<span class="ruby-comment cmt"># File lib/phusion_passenger/railz/cgi_fixed.rb, line 54</span>
|
156
|
-
54: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">env_table</span>
|
157
|
-
55: <span class="ruby-ivar">@env_table</span>
|
158
|
-
56: <span class="ruby-keyword kw">end</span>
|
159
|
-
</pre>
|
160
|
-
</div>
|
161
|
-
</div>
|
162
|
-
</div>
|
163
|
-
<div class="method">
|
164
|
-
<div class="title">
|
165
|
-
<a name="M000067"></a><b>stdinput</b>()
|
166
|
-
</div>
|
167
|
-
<div class="sourcecode">
|
168
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000067_source')" id="l_M000067_source">show source</a> ]</p>
|
169
|
-
<div id="M000067_source" class="dyn-source">
|
170
|
-
<pre>
|
171
|
-
<span class="ruby-comment cmt"># File lib/phusion_passenger/railz/cgi_fixed.rb, line 58</span>
|
172
|
-
58: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">stdinput</span>
|
173
|
-
59: <span class="ruby-ivar">@input</span>
|
174
|
-
60: <span class="ruby-keyword kw">end</span>
|
175
|
-
</pre>
|
176
|
-
</div>
|
177
|
-
</div>
|
178
|
-
</div>
|
179
|
-
<div class="method">
|
180
|
-
<div class="title">
|
181
|
-
<a name="M000068"></a><b>stdoutput</b>()
|
182
|
-
</div>
|
183
|
-
<div class="sourcecode">
|
184
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000068_source')" id="l_M000068_source">show source</a> ]</p>
|
185
|
-
<div id="M000068_source" class="dyn-source">
|
186
|
-
<pre>
|
187
|
-
<span class="ruby-comment cmt"># File lib/phusion_passenger/railz/cgi_fixed.rb, line 62</span>
|
188
|
-
62: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">stdoutput</span>
|
189
|
-
63: <span class="ruby-ivar">@out</span>
|
190
|
-
64: <span class="ruby-keyword kw">end</span>
|
191
|
-
</pre>
|
192
|
-
</div>
|
193
|
-
</div>
|
194
|
-
</div>
|
195
|
-
</div>
|
196
|
-
|
197
|
-
</div>
|
198
|
-
|
199
|
-
</body>
|
200
|
-
</html>
|
@@ -1,436 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
-
<!DOCTYPE html
|
3
|
-
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
-
<html>
|
6
|
-
<head>
|
7
|
-
<title>Class: PhusionPassenger::Railz::FrameworkSpawner</title>
|
8
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
9
|
-
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
10
|
-
|
11
|
-
<script language="JavaScript" type="text/javascript">
|
12
|
-
// <![CDATA[
|
13
|
-
|
14
|
-
function toggleSource( id )
|
15
|
-
{
|
16
|
-
var elem
|
17
|
-
var link
|
18
|
-
|
19
|
-
if( document.getElementById )
|
20
|
-
{
|
21
|
-
elem = document.getElementById( id )
|
22
|
-
link = document.getElementById( "l_" + id )
|
23
|
-
}
|
24
|
-
else if ( document.all )
|
25
|
-
{
|
26
|
-
elem = eval( "document.all." + id )
|
27
|
-
link = eval( "document.all.l_" + id )
|
28
|
-
}
|
29
|
-
else
|
30
|
-
return false;
|
31
|
-
|
32
|
-
if( elem.style.display == "block" )
|
33
|
-
{
|
34
|
-
elem.style.display = "none"
|
35
|
-
link.innerHTML = "show source"
|
36
|
-
}
|
37
|
-
else
|
38
|
-
{
|
39
|
-
elem.style.display = "block"
|
40
|
-
link.innerHTML = "hide source"
|
41
|
-
}
|
42
|
-
}
|
43
|
-
|
44
|
-
function openCode( url )
|
45
|
-
{
|
46
|
-
window.open( url, "SOURCE_CODE", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=480,width=750" ).focus();
|
47
|
-
}
|
48
|
-
// ]]>
|
49
|
-
</script>
|
50
|
-
</head>
|
51
|
-
|
52
|
-
<body>
|
53
|
-
<table width="100%" border='0' cellpadding='0' cellspacing='0' class='banner'><tr>
|
54
|
-
<td class="file-title"><span class="file-title-prefix">Class</span><br />PhusionPassenger::Railz::FrameworkSpawner</td>
|
55
|
-
<td align="right">
|
56
|
-
<table cellspacing="0" cellpadding="2">
|
57
|
-
<tr valign="top">
|
58
|
-
<td>In:</td>
|
59
|
-
<td>
|
60
|
-
<a href="../../../files/lib/phusion_passenger/railz/framework_spawner_rb.html">lib/phusion_passenger/railz/framework_spawner.rb</a>
|
61
|
-
</td>
|
62
|
-
</tr>
|
63
|
-
<tr>
|
64
|
-
<td>Parent:</td>
|
65
|
-
<td>
|
66
|
-
AbstractServer
|
67
|
-
</td>
|
68
|
-
</tr>
|
69
|
-
</table>
|
70
|
-
</td>
|
71
|
-
</tr>
|
72
|
-
</table>
|
73
|
-
<!-- banner header -->
|
74
|
-
|
75
|
-
<div id="bodyContent">
|
76
|
-
<div id="content">
|
77
|
-
|
78
|
-
<div class="description"><p>
|
79
|
-
This class is capable of spawning Ruby on Rails application instances
|
80
|
-
quickly. This is done by preloading the Ruby on Rails framework into
|
81
|
-
memory, before spawning the application instances.
|
82
|
-
</p>
|
83
|
-
<p>
|
84
|
-
A single <a href="FrameworkSpawner.html">FrameworkSpawner</a> instance can
|
85
|
-
only hold a single Ruby on Rails framework version. So be careful when
|
86
|
-
using <a href="FrameworkSpawner.html">FrameworkSpawner</a>: the
|
87
|
-
applications that you spawn through it must require the same RoR version.
|
88
|
-
To handle multiple RoR versions, use multiple <a
|
89
|
-
href="FrameworkSpawner.html">FrameworkSpawner</a> instances.
|
90
|
-
</p>
|
91
|
-
<p>
|
92
|
-
<a href="FrameworkSpawner.html">FrameworkSpawner</a> uses <a
|
93
|
-
href="ApplicationSpawner.html">ApplicationSpawner</a> internally.
|
94
|
-
</p>
|
95
|
-
<p>
|
96
|
-
<b>Note</b>: <a href="FrameworkSpawner.html">FrameworkSpawner</a> may only
|
97
|
-
be started asynchronously with <a
|
98
|
-
href="../AbstractServer.html#M000120">AbstractServer#start</a>. Starting it
|
99
|
-
synchronously with <a
|
100
|
-
href="../AbstractServer.html#M000121">AbstractServer#start_synchronously</a>
|
101
|
-
has not been tested.
|
102
|
-
</p>
|
103
|
-
</div>
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
<div class="sectiontitle">Methods</div>
|
108
|
-
<ul>
|
109
|
-
<li><a href="#M000060">new</a></li>
|
110
|
-
<li><a href="#M000063">reload</a></li>
|
111
|
-
<li><a href="#M000062">spawn_application</a></li>
|
112
|
-
<li><a href="#M000061">start</a></li>
|
113
|
-
</ul>
|
114
|
-
|
115
|
-
<div class="sectiontitle">Included Modules</div>
|
116
|
-
<ul>
|
117
|
-
<li><a href="../Utils.html">Utils</a></li>
|
118
|
-
</ul>
|
119
|
-
|
120
|
-
|
121
|
-
<div class="sectiontitle">Classes and Modules</div>
|
122
|
-
Class <a href="FrameworkSpawner/Error.html" class="link">PhusionPassenger::Railz::FrameworkSpawner::Error</a><br />
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
<div class="sectiontitle">Public Class methods</div>
|
128
|
-
<div class="method">
|
129
|
-
<div class="title">
|
130
|
-
<a name="M000060"></a><b>new</b>(options = {})
|
131
|
-
</div>
|
132
|
-
<div class="description">
|
133
|
-
<p>
|
134
|
-
Creates a <a href="FrameworkSpawner.html#M000060">new</a> instance of <a
|
135
|
-
href="FrameworkSpawner.html">FrameworkSpawner</a>.
|
136
|
-
</p>
|
137
|
-
<p>
|
138
|
-
Valid options are:
|
139
|
-
</p>
|
140
|
-
<ul>
|
141
|
-
<li><tt>:version</tt>: The Ruby on Rails version to use. It is not checked
|
142
|
-
whether this version is actually installed.
|
143
|
-
|
144
|
-
</li>
|
145
|
-
<li><tt>:vendor</tt>: The directory to the vendor Rails framework to use. This
|
146
|
-
is usually something like "/webapps/foo/vendor/rails".
|
147
|
-
|
148
|
-
</li>
|
149
|
-
<li><tt>:print_framework_loading_exceptions</tt>: Whether exceptions that have
|
150
|
-
occurred while loading the Ruby on Rails framework should be printed to
|
151
|
-
STDERR. The default is true.
|
152
|
-
|
153
|
-
</li>
|
154
|
-
</ul>
|
155
|
-
<p>
|
156
|
-
It is not allowed to specify both <tt>version</tt> and <tt>vendor</tt>.
|
157
|
-
</p>
|
158
|
-
<p>
|
159
|
-
All other options will be passed on to <a
|
160
|
-
href="ApplicationSpawner.html">ApplicationSpawner</a> and <a
|
161
|
-
href="RequestHandler.html">RequestHandler</a>.
|
162
|
-
</p>
|
163
|
-
<p>
|
164
|
-
Note that the specified Rails framework will be loaded during the entire
|
165
|
-
life time of the <a href="FrameworkSpawner.html">FrameworkSpawner</a>
|
166
|
-
server. If you wish to <a href="FrameworkSpawner.html#M000063">reload</a>
|
167
|
-
the Rails framework‘s code, then restart the server by calling <a
|
168
|
-
href="../AbstractServer.html#M000122">AbstractServer#stop</a> and <a
|
169
|
-
href="../AbstractServer.html#M000120">AbstractServer#start</a>.
|
170
|
-
</p>
|
171
|
-
</div>
|
172
|
-
<div class="sourcecode">
|
173
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000060_source')" id="l_M000060_source">show source</a> ]</p>
|
174
|
-
<div id="M000060_source" class="dyn-source">
|
175
|
-
<pre>
|
176
|
-
<span class="ruby-comment cmt"># File lib/phusion_passenger/railz/framework_spawner.rb, line 72</span>
|
177
|
-
72: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">options</span> = {})
|
178
|
-
73: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">options</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value str">'[]'</span><span class="ruby-value str">'[]'</span>)
|
179
|
-
74: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">"The 'options' argument not seem to be an options hash"</span>
|
180
|
-
75: <span class="ruby-keyword kw">end</span>
|
181
|
-
76: <span class="ruby-ivar">@version</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:version</span>]
|
182
|
-
77: <span class="ruby-ivar">@vendor</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:vendor</span>]
|
183
|
-
78: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">has_key?</span>(<span class="ruby-identifier">:print_framework_loading_exceptions</span>)
|
184
|
-
79: <span class="ruby-ivar">@print_framework_loading_exceptions</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:print_framework_loading_exceptions</span>]
|
185
|
-
80: <span class="ruby-keyword kw">else</span>
|
186
|
-
81: <span class="ruby-ivar">@print_framework_loading_exceptions</span> = <span class="ruby-keyword kw">true</span>
|
187
|
-
82: <span class="ruby-keyword kw">end</span>
|
188
|
-
83: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@version</span> <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@vendor</span>
|
189
|
-
84: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">"Either the 'version' or the 'vendor' option must specified"</span>
|
190
|
-
85: <span class="ruby-keyword kw">elsif</span> <span class="ruby-ivar">@version</span> <span class="ruby-operator">&&</span> <span class="ruby-ivar">@vendor</span>
|
191
|
-
86: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">"It is not allowed to specify both the 'version' and the 'vendor' options"</span>
|
192
|
-
87: <span class="ruby-keyword kw">end</span>
|
193
|
-
88:
|
194
|
-
89: <span class="ruby-keyword kw">super</span>()
|
195
|
-
90: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">max_idle_time</span> = <span class="ruby-constant">DEFAULT_FRAMEWORK_SPAWNER_MAX_IDLE_TIME</span>
|
196
|
-
91: <span class="ruby-identifier">define_message_handler</span>(<span class="ruby-identifier">:spawn_application</span>, <span class="ruby-identifier">:handle_spawn_application</span>)
|
197
|
-
92: <span class="ruby-identifier">define_message_handler</span>(<span class="ruby-identifier">:reload</span>, <span class="ruby-identifier">:handle_reload</span>)
|
198
|
-
93: <span class="ruby-keyword kw">end</span>
|
199
|
-
</pre>
|
200
|
-
</div>
|
201
|
-
</div>
|
202
|
-
</div>
|
203
|
-
<div class="sectiontitle">Public Instance methods</div>
|
204
|
-
<div class="method">
|
205
|
-
<div class="title">
|
206
|
-
<a name="M000063"></a><b>reload</b>(app_root = nil)
|
207
|
-
</div>
|
208
|
-
<div class="description">
|
209
|
-
<p>
|
210
|
-
Remove the cached application instances at the given application root. If
|
211
|
-
nil is specified as application root, then all cached application instances
|
212
|
-
will be removed, no matter the application root.
|
213
|
-
</p>
|
214
|
-
<p>
|
215
|
-
<b>Long description:</b> <a href="../Application.html">Application</a> code
|
216
|
-
might be cached in memory by a <a
|
217
|
-
href="FrameworkSpawner.html">FrameworkSpawner</a>. But once it a while, it
|
218
|
-
will be necessary to <a href="FrameworkSpawner.html#M000063">reload</a> the
|
219
|
-
code for an application, such as after deploying a <a
|
220
|
-
href="FrameworkSpawner.html#M000060">new</a> version of the application.
|
221
|
-
This method makes sure that any cached application code is removed, so that
|
222
|
-
the next time an application instance is spawned, the application code will
|
223
|
-
be freshly loaded into memory.
|
224
|
-
</p>
|
225
|
-
<p>
|
226
|
-
Raises:
|
227
|
-
</p>
|
228
|
-
<ul>
|
229
|
-
<li>ArgumentError: <tt>app_root</tt> doesn‘t appear to be a valid Ruby on
|
230
|
-
Rails application root.
|
231
|
-
|
232
|
-
</li>
|
233
|
-
<li><a href="FrameworkSpawner/Error.html">FrameworkSpawner::Error</a>: The <a
|
234
|
-
href="FrameworkSpawner.html">FrameworkSpawner</a> server exited
|
235
|
-
unexpectedly.
|
236
|
-
|
237
|
-
</li>
|
238
|
-
</ul>
|
239
|
-
</div>
|
240
|
-
<div class="sourcecode">
|
241
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000063_source')" id="l_M000063_source">show source</a> ]</p>
|
242
|
-
<div id="M000063_source" class="dyn-source">
|
243
|
-
<pre>
|
244
|
-
<span class="ruby-comment cmt"># File lib/phusion_passenger/railz/framework_spawner.rb, line 204</span>
|
245
|
-
204: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reload</span>(<span class="ruby-identifier">app_root</span> = <span class="ruby-keyword kw">nil</span>)
|
246
|
-
205: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">app_root</span>.<span class="ruby-identifier">nil?</span>
|
247
|
-
206: <span class="ruby-identifier">server</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">"reload"</span>)
|
248
|
-
207: <span class="ruby-keyword kw">else</span>
|
249
|
-
208: <span class="ruby-identifier">server</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">"reload"</span>, <span class="ruby-identifier">app_root</span>)
|
250
|
-
209: <span class="ruby-keyword kw">end</span>
|
251
|
-
210: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">SystemCallError</span>, <span class="ruby-constant">IOError</span>, <span class="ruby-constant">SocketError</span>
|
252
|
-
211: <span class="ruby-identifier">raise</span> <span class="ruby-constant">Error</span>, <span class="ruby-value str">"The framework spawner server exited unexpectedly"</span>
|
253
|
-
212: <span class="ruby-keyword kw">end</span>
|
254
|
-
</pre>
|
255
|
-
</div>
|
256
|
-
</div>
|
257
|
-
</div>
|
258
|
-
<div class="method">
|
259
|
-
<div class="title">
|
260
|
-
<a name="M000062"></a><b>spawn_application</b>(app_root, options = {})
|
261
|
-
</div>
|
262
|
-
<div class="description">
|
263
|
-
<p>
|
264
|
-
Spawn a RoR application using the Ruby on Rails framework version
|
265
|
-
associated with this <a href="FrameworkSpawner.html">FrameworkSpawner</a>.
|
266
|
-
When successful, an <a href="../Application.html">Application</a> object
|
267
|
-
will be returned, which represents the spawned RoR application.
|
268
|
-
</p>
|
269
|
-
<p>
|
270
|
-
All options accepted by <a
|
271
|
-
href="ApplicationSpawner.html#M000069">ApplicationSpawner.new</a> and <a
|
272
|
-
href="RequestHandler.html#M000073">RequestHandler.new</a> are accepted.
|
273
|
-
</p>
|
274
|
-
<p>
|
275
|
-
<a href="FrameworkSpawner.html">FrameworkSpawner</a> will internally cache
|
276
|
-
the code of applications, in order to speed up future spawning attempts.
|
277
|
-
This implies that, if you‘ve changed the application‘s code,
|
278
|
-
you must do one of these things:
|
279
|
-
</p>
|
280
|
-
<ul>
|
281
|
-
<li>Restart this <a href="FrameworkSpawner.html">FrameworkSpawner</a> by
|
282
|
-
calling <a href="../AbstractServer.html#M000122">AbstractServer#stop</a>,
|
283
|
-
then <a href="../AbstractServer.html#M000120">AbstractServer#start</a>.
|
284
|
-
|
285
|
-
</li>
|
286
|
-
<li>Reload the application by calling <a
|
287
|
-
href="FrameworkSpawner.html#M000063">reload</a> with the correct app_root
|
288
|
-
argument.
|
289
|
-
|
290
|
-
</li>
|
291
|
-
</ul>
|
292
|
-
<p>
|
293
|
-
Raises:
|
294
|
-
</p>
|
295
|
-
<ul>
|
296
|
-
<li><a
|
297
|
-
href="../AbstractServer/ServerNotStarted.html">AbstractServer::ServerNotStarted</a>:
|
298
|
-
The <a href="FrameworkSpawner.html">FrameworkSpawner</a> server
|
299
|
-
hasn‘t already been started.
|
300
|
-
|
301
|
-
</li>
|
302
|
-
<li><a href="../InvalidPath.html">InvalidPath</a>: <tt>app_root</tt>
|
303
|
-
doesn‘t appear to be a valid Ruby on Rails application root.
|
304
|
-
|
305
|
-
</li>
|
306
|
-
<li><a href="../AppInitError.html">AppInitError</a>: The application raised an
|
307
|
-
exception or called exit() during startup.
|
308
|
-
|
309
|
-
</li>
|
310
|
-
<li><a href="ApplicationSpawner/Error.html">ApplicationSpawner::Error</a>: The
|
311
|
-
<a href="ApplicationSpawner.html">ApplicationSpawner</a> server exited
|
312
|
-
unexpectedly.
|
313
|
-
|
314
|
-
</li>
|
315
|
-
<li><a href="FrameworkSpawner/Error.html">FrameworkSpawner::Error</a>: The <a
|
316
|
-
href="FrameworkSpawner.html">FrameworkSpawner</a> server exited
|
317
|
-
unexpectedly.
|
318
|
-
|
319
|
-
</li>
|
320
|
-
</ul>
|
321
|
-
</div>
|
322
|
-
<div class="sourcecode">
|
323
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000062_source')" id="l_M000062_source">show source</a> ]</p>
|
324
|
-
<div id="M000062_source" class="dyn-source">
|
325
|
-
<pre>
|
326
|
-
<span class="ruby-comment cmt"># File lib/phusion_passenger/railz/framework_spawner.rb, line 150</span>
|
327
|
-
150: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">spawn_application</span>(<span class="ruby-identifier">app_root</span>, <span class="ruby-identifier">options</span> = {})
|
328
|
-
151: <span class="ruby-identifier">assert_valid_app_root</span>(<span class="ruby-identifier">app_root</span>)
|
329
|
-
152: <span class="ruby-identifier">options</span> = <span class="ruby-identifier">sanitize_spawn_options</span>(<span class="ruby-identifier">options</span>)
|
330
|
-
153: <span class="ruby-identifier">options</span>[<span class="ruby-value str">"app_root"</span>] = <span class="ruby-identifier">app_root</span>
|
331
|
-
154: <span class="ruby-comment cmt"># No need for the ApplicationSpawner to print exceptions. All</span>
|
332
|
-
155: <span class="ruby-comment cmt"># exceptions raised by the ApplicationSpawner are sent back here,</span>
|
333
|
-
156: <span class="ruby-comment cmt"># so we just need to decide here whether we want to print it.</span>
|
334
|
-
157: <span class="ruby-identifier">print_exceptions</span> = <span class="ruby-identifier">options</span>[<span class="ruby-value str">"print_exceptions"</span>]
|
335
|
-
158: <span class="ruby-identifier">options</span>[<span class="ruby-value str">"print_exceptions"</span>] = <span class="ruby-keyword kw">false</span>
|
336
|
-
159:
|
337
|
-
160: <span class="ruby-keyword kw">begin</span>
|
338
|
-
161: <span class="ruby-identifier">server</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">"spawn_application"</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">options</span>.<span class="ruby-identifier">to_a</span>.<span class="ruby-identifier">flatten</span>)
|
339
|
-
162: <span class="ruby-identifier">result</span> = <span class="ruby-identifier">server</span>.<span class="ruby-identifier">read</span>
|
340
|
-
163: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">nil?</span>
|
341
|
-
164: <span class="ruby-identifier">raise</span> <span class="ruby-constant">IOError</span>, <span class="ruby-value str">"Connection closed"</span>
|
342
|
-
165: <span class="ruby-keyword kw">end</span>
|
343
|
-
166: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">result</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">'exception'</span>
|
344
|
-
167: <span class="ruby-identifier">e</span> = <span class="ruby-identifier">unmarshal_exception</span>(<span class="ruby-identifier">server</span>.<span class="ruby-identifier">read_scalar</span>)
|
345
|
-
168: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">print_exceptions</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:child_exception</span>) <span class="ruby-operator">&&</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">child_exception</span>
|
346
|
-
169: <span class="ruby-identifier">print_exception</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">child_exception</span>)
|
347
|
-
170: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">print_exceptions</span>
|
348
|
-
171: <span class="ruby-identifier">print_exception</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">e</span>)
|
349
|
-
172: <span class="ruby-keyword kw">end</span>
|
350
|
-
173: <span class="ruby-identifier">raise</span> <span class="ruby-identifier">e</span>
|
351
|
-
174: <span class="ruby-keyword kw">else</span>
|
352
|
-
175: <span class="ruby-identifier">pid</span>, <span class="ruby-identifier">listen_socket_name</span>, <span class="ruby-identifier">socket_type</span> = <span class="ruby-identifier">server</span>.<span class="ruby-identifier">read</span>
|
353
|
-
176: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">pid</span>.<span class="ruby-identifier">nil?</span>
|
354
|
-
177: <span class="ruby-identifier">raise</span> <span class="ruby-constant">IOError</span>, <span class="ruby-value str">"Connection closed"</span>
|
355
|
-
178: <span class="ruby-keyword kw">end</span>
|
356
|
-
179: <span class="ruby-identifier">owner_pipe</span> = <span class="ruby-identifier">server</span>.<span class="ruby-identifier">recv_io</span>
|
357
|
-
180: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">Application</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">app_root</span>, <span class="ruby-identifier">pid</span>, <span class="ruby-identifier">listen_socket_name</span>,
|
358
|
-
181: <span class="ruby-identifier">socket_type</span>, <span class="ruby-identifier">owner_pipe</span>)
|
359
|
-
182: <span class="ruby-keyword kw">end</span>
|
360
|
-
183: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">SystemCallError</span>, <span class="ruby-constant">IOError</span>, <span class="ruby-constant">SocketError</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span>
|
361
|
-
184: <span class="ruby-identifier">raise</span> <span class="ruby-constant">Error</span>, <span class="ruby-value str">"The framework spawner server exited unexpectedly"</span>
|
362
|
-
185: <span class="ruby-keyword kw">end</span>
|
363
|
-
186: <span class="ruby-keyword kw">end</span>
|
364
|
-
</pre>
|
365
|
-
</div>
|
366
|
-
</div>
|
367
|
-
</div>
|
368
|
-
<div class="method">
|
369
|
-
<div class="title">
|
370
|
-
<a name="M000061"></a><b>start</b>()
|
371
|
-
</div>
|
372
|
-
<div class="description">
|
373
|
-
<p>
|
374
|
-
Overrided from <a
|
375
|
-
href="../AbstractServer.html#M000120">AbstractServer#start</a>.
|
376
|
-
</p>
|
377
|
-
<p>
|
378
|
-
May raise these additional exceptions:
|
379
|
-
</p>
|
380
|
-
<ul>
|
381
|
-
<li><a href="../FrameworkInitError.html">FrameworkInitError</a>: An error
|
382
|
-
occurred while loading the specified Ruby on Rails framework.
|
383
|
-
|
384
|
-
</li>
|
385
|
-
<li><a href="FrameworkSpawner/Error.html">FrameworkSpawner::Error</a>: The <a
|
386
|
-
href="FrameworkSpawner.html">FrameworkSpawner</a> server exited
|
387
|
-
unexpectedly.
|
388
|
-
|
389
|
-
</li>
|
390
|
-
</ul>
|
391
|
-
</div>
|
392
|
-
<div class="sourcecode">
|
393
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000061_source')" id="l_M000061_source">show source</a> ]</p>
|
394
|
-
<div id="M000061_source" class="dyn-source">
|
395
|
-
<pre>
|
396
|
-
<span class="ruby-comment cmt"># File lib/phusion_passenger/railz/framework_spawner.rb, line 100</span>
|
397
|
-
100: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">start</span>
|
398
|
-
101: <span class="ruby-keyword kw">super</span>
|
399
|
-
102: <span class="ruby-keyword kw">begin</span>
|
400
|
-
103: <span class="ruby-identifier">result</span> = <span class="ruby-identifier">server</span>.<span class="ruby-identifier">read</span>
|
401
|
-
104: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">nil?</span>
|
402
|
-
105: <span class="ruby-identifier">raise</span> <span class="ruby-constant">Error</span>, <span class="ruby-value str">"The framework spawner server exited unexpectedly."</span>
|
403
|
-
106: <span class="ruby-keyword kw">else</span>
|
404
|
-
107: <span class="ruby-identifier">status</span> = <span class="ruby-identifier">result</span>[<span class="ruby-value">0</span>]
|
405
|
-
108: <span class="ruby-keyword kw">end</span>
|
406
|
-
109: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">status</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'exception'</span>
|
407
|
-
110: <span class="ruby-identifier">child_exception</span> = <span class="ruby-identifier">unmarshal_exception</span>(<span class="ruby-identifier">server</span>.<span class="ruby-identifier">read_scalar</span>)
|
408
|
-
111: <span class="ruby-identifier">stop</span>
|
409
|
-
112: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@version</span>
|
410
|
-
113: <span class="ruby-identifier">message</span> = <span class="ruby-node">"Could not load Ruby on Rails framework version #{@version}: "</span> <span class="ruby-operator"><<</span>
|
411
|
-
114: <span class="ruby-node">"#{child_exception.class} (#{child_exception.message})"</span>
|
412
|
-
115: <span class="ruby-keyword kw">else</span>
|
413
|
-
116: <span class="ruby-identifier">message</span> = <span class="ruby-node">"Could not load Ruby on Rails framework at '#{@vendor}': "</span> <span class="ruby-operator"><<</span>
|
414
|
-
117: <span class="ruby-node">"#{child_exception.class} (#{child_exception.message})"</span>
|
415
|
-
118: <span class="ruby-keyword kw">end</span>
|
416
|
-
119: <span class="ruby-identifier">options</span> = { <span class="ruby-identifier">:vendor</span> =<span class="ruby-operator">></span> <span class="ruby-ivar">@vendor</span>, <span class="ruby-identifier">:version</span> =<span class="ruby-operator">></span> <span class="ruby-ivar">@version</span> }
|
417
|
-
120: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@print_framework_loading_exceptions</span>
|
418
|
-
121: <span class="ruby-identifier">print_exception</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">child_exception</span>)
|
419
|
-
122: <span class="ruby-keyword kw">end</span>
|
420
|
-
123: <span class="ruby-identifier">raise</span> <span class="ruby-constant">FrameworkInitError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">message</span>, <span class="ruby-identifier">child_exception</span>, <span class="ruby-identifier">options</span>)
|
421
|
-
124: <span class="ruby-keyword kw">end</span>
|
422
|
-
125: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">IOError</span>, <span class="ruby-constant">SystemCallError</span>, <span class="ruby-constant">SocketError</span>
|
423
|
-
126: <span class="ruby-identifier">stop</span>
|
424
|
-
127: <span class="ruby-identifier">raise</span> <span class="ruby-constant">Error</span>, <span class="ruby-value str">"The framework spawner server exited unexpectedly"</span>
|
425
|
-
128: <span class="ruby-keyword kw">end</span>
|
426
|
-
129: <span class="ruby-keyword kw">end</span>
|
427
|
-
</pre>
|
428
|
-
</div>
|
429
|
-
</div>
|
430
|
-
</div>
|
431
|
-
</div>
|
432
|
-
|
433
|
-
</div>
|
434
|
-
|
435
|
-
</body>
|
436
|
-
</html>
|