doc/rdoc/classes/Mongrel/Configurator.html in mongrel-0.3.13 vs doc/rdoc/classes/Mongrel/Configurator.html in mongrel-0.3.13.1

- old
+ new

@@ -104,11 +104,11 @@ =&gt; &quot;127.0.0.1&quot; is actually not specific to the servers but just a hash of default parameters that all server or uri calls receive. </p> <p> When you are inside the block after <a -href="Configurator.html#M000105">Mongrel::Configurator.new</a> you can +href="Configurator.html#M000107">Mongrel::Configurator.new</a> you can simply call functions that are part of <a href="Configurator.html">Configurator</a> (like server, uri, daemonize, etc) without having to refer to anything else. You can also call these functions on the resulting object directly for additional configuration. </p> @@ -130,30 +130,31 @@ <div id="method-list"> <h3 class="section-bar">Methods</h3> <div class="name-list"> - <a href="#M000106">change_privilege</a>&nbsp;&nbsp; - <a href="#M000109">cloaker</a>&nbsp;&nbsp; - <a href="#M000108">cloaking_class</a>&nbsp;&nbsp; - <a href="#M000113">daemonize</a>&nbsp;&nbsp; - <a href="#M000121">debug</a>&nbsp;&nbsp; - <a href="#M000120">join</a>&nbsp;&nbsp; - <a href="#M000111">listener</a>&nbsp;&nbsp; - <a href="#M000116">load_mime_map</a>&nbsp;&nbsp; - <a href="#M000114">load_plugins</a>&nbsp;&nbsp; - <a href="#M000115">load_yaml</a>&nbsp;&nbsp; - <a href="#M000124">log</a>&nbsp;&nbsp; - <a href="#M000105">new</a>&nbsp;&nbsp; - <a href="#M000117">plugin</a>&nbsp;&nbsp; - <a href="#M000110">resolve_defaults</a>&nbsp;&nbsp; - <a href="#M000118">run</a>&nbsp;&nbsp; - <a href="#M000122">run_config</a>&nbsp;&nbsp; - <a href="#M000123">setup_signals</a>&nbsp;&nbsp; - <a href="#M000119">stop</a>&nbsp;&nbsp; - <a href="#M000112">uri</a>&nbsp;&nbsp; - <a href="#M000107">write_pid_file</a>&nbsp;&nbsp; + <a href="#M000108">change_privilege</a>&nbsp;&nbsp; + <a href="#M000111">cloaker</a>&nbsp;&nbsp; + <a href="#M000110">cloaking_class</a>&nbsp;&nbsp; + <a href="#M000115">daemonize</a>&nbsp;&nbsp; + <a href="#M000124">debug</a>&nbsp;&nbsp; + <a href="#M000123">join</a>&nbsp;&nbsp; + <a href="#M000113">listener</a>&nbsp;&nbsp; + <a href="#M000118">load_mime_map</a>&nbsp;&nbsp; + <a href="#M000116">load_plugins</a>&nbsp;&nbsp; + <a href="#M000117">load_yaml</a>&nbsp;&nbsp; + <a href="#M000127">log</a>&nbsp;&nbsp; + <a href="#M000107">new</a>&nbsp;&nbsp; + <a href="#M000119">plugin</a>&nbsp;&nbsp; + <a href="#M000120">redirect</a>&nbsp;&nbsp; + <a href="#M000112">resolve_defaults</a>&nbsp;&nbsp; + <a href="#M000121">run</a>&nbsp;&nbsp; + <a href="#M000125">run_config</a>&nbsp;&nbsp; + <a href="#M000126">setup_signals</a>&nbsp;&nbsp; + <a href="#M000122">stop</a>&nbsp;&nbsp; + <a href="#M000114">uri</a>&nbsp;&nbsp; + <a href="#M000109">write_pid_file</a>&nbsp;&nbsp; </div> </div> </div> @@ -194,16 +195,16 @@ <!-- if method_list --> <div id="methods"> <h3 class="section-bar">Public Class methods</h3> - <div id="method-M000105" class="method-detail"> - <a name="M000105"></a> + <div id="method-M000107" class="method-detail"> + <a name="M000107"></a> <div class="method-heading"> - <a href="Configurator.src/M000105.html" target="Code" class="method-signature" - onclick="popupCode('Configurator.src/M000105.html');return false;"> + <a href="Configurator.src/M000107.html" target="Code" class="method-signature" + onclick="popupCode('Configurator.src/M000107.html');return false;"> <span class="method-name">new</span><span class="method-args">(defaults={}, &amp;blk)</span> </a> </div> <div class="method-description"> @@ -213,16 +214,16 @@ </div> </div> <h3 class="section-bar">Public Instance methods</h3> - <div id="method-M000106" class="method-detail"> - <a name="M000106"></a> + <div id="method-M000108" class="method-detail"> + <a name="M000108"></a> <div class="method-heading"> - <a href="Configurator.src/M000106.html" target="Code" class="method-signature" - onclick="popupCode('Configurator.src/M000106.html');return false;"> + <a href="Configurator.src/M000108.html" target="Code" class="method-signature" + onclick="popupCode('Configurator.src/M000108.html');return false;"> <span class="method-name">change_privilege</span><span class="method-args">(user, group)</span> </a> </div> <div class="method-description"> @@ -230,16 +231,16 @@ Change privilege of the process to specified user and group. </p> </div> </div> - <div id="method-M000109" class="method-detail"> - <a name="M000109"></a> + <div id="method-M000111" class="method-detail"> + <a name="M000111"></a> <div class="method-heading"> - <a href="Configurator.src/M000109.html" target="Code" class="method-signature" - onclick="popupCode('Configurator.src/M000109.html');return false;"> + <a href="Configurator.src/M000111.html" target="Code" class="method-signature" + onclick="popupCode('Configurator.src/M000111.html');return false;"> <span class="method-name">cloaker</span><span class="method-args">(&amp;blk)</span> </a> </div> <div class="method-description"> @@ -247,16 +248,16 @@ Do not call this. You were warned. </p> </div> </div> - <div id="method-M000108" class="method-detail"> - <a name="M000108"></a> + <div id="method-M000110" class="method-detail"> + <a name="M000110"></a> <div class="method-heading"> - <a href="Configurator.src/M000108.html" target="Code" class="method-signature" - onclick="popupCode('Configurator.src/M000108.html');return false;"> + <a href="Configurator.src/M000110.html" target="Code" class="method-signature" + onclick="popupCode('Configurator.src/M000110.html');return false;"> <span class="method-name">cloaking_class</span><span class="method-args">()</span> </a> </div> <div class="method-description"> @@ -264,16 +265,16 @@ generates a class for cloaking the current self and making the DSL nicer </p> </div> </div> - <div id="method-M000113" class="method-detail"> - <a name="M000113"></a> + <div id="method-M000115" class="method-detail"> + <a name="M000115"></a> <div class="method-heading"> - <a href="Configurator.src/M000113.html" target="Code" class="method-signature" - onclick="popupCode('Configurator.src/M000113.html');return false;"> + <a href="Configurator.src/M000115.html" target="Code" class="method-signature" + onclick="popupCode('Configurator.src/M000115.html');return false;"> <span class="method-name">daemonize</span><span class="method-args">(options={})</span> </a> </div> <div class="method-description"> @@ -302,16 +303,16 @@ gem/library if NOT win32. </p> </div> </div> - <div id="method-M000121" class="method-detail"> - <a name="M000121"></a> + <div id="method-M000124" class="method-detail"> + <a name="M000124"></a> <div class="method-heading"> - <a href="Configurator.src/M000121.html" target="Code" class="method-signature" - onclick="popupCode('Configurator.src/M000121.html');return false;"> + <a href="Configurator.src/M000124.html" target="Code" class="method-signature" + onclick="popupCode('Configurator.src/M000124.html');return false;"> <span class="method-name">debug</span><span class="method-args">(location, what = [:object, :rails, :files, :threads, :params])</span> </a> </div> <div class="method-description"> @@ -321,21 +322,32 @@ request. This helps you track common problems found in <a href="Rails.html">Rails</a> applications that are either slow or become unresponsive after a little while. </p> <p> -TODO: Document the optional selections from the what parameter +You can pass an extra parameter <b>what</b> to indicate what you want to +debug. For example, if you just want to dump rails stuff then do: </p> +<pre> + debug &quot;/&quot;, what = [:rails] +</pre> +<p> +And it will only produce the log/mongrel_debug/rails.log file. Available +options are: :object, :railes, :files, :threads, :params +</p> +<p> +NOTE: Use [:files] to get acccesses dumped to stderr like with WEBrick. +</p> </div> </div> - <div id="method-M000120" class="method-detail"> - <a name="M000120"></a> + <div id="method-M000123" class="method-detail"> + <a name="M000123"></a> <div class="method-heading"> - <a href="Configurator.src/M000120.html" target="Code" class="method-signature" - onclick="popupCode('Configurator.src/M000120.html');return false;"> + <a href="Configurator.src/M000123.html" target="Code" class="method-signature" + onclick="popupCode('Configurator.src/M000123.html');return false;"> <span class="method-name">join</span><span class="method-args">()</span> </a> </div> <div class="method-description"> @@ -345,27 +357,27 @@ In otherwords do it like: config.join. </p> </div> </div> - <div id="method-M000111" class="method-detail"> - <a name="M000111"></a> + <div id="method-M000113" class="method-detail"> + <a name="M000113"></a> <div class="method-heading"> - <a href="Configurator.src/M000111.html" target="Code" class="method-signature" - onclick="popupCode('Configurator.src/M000111.html');return false;"> + <a href="Configurator.src/M000113.html" target="Code" class="method-signature" + onclick="popupCode('Configurator.src/M000113.html');return false;"> <span class="method-name">listener</span><span class="method-args">(options={},&amp;blk)</span> </a> </div> <div class="method-description"> <p> Starts a listener block. This is the only one that actually takes a block -and then you make <a href="Configurator.html#M000112">Configurator.uri</a> +and then you make <a href="Configurator.html#M000114">Configurator.uri</a> calls in order to setup your URIs and handlers. If you write your Handlers as GemPlugins then you can use <a -href="Configurator.html#M000114">load_plugins</a> and plugin to load them. +href="Configurator.html#M000116">load_plugins</a> and plugin to load them. </p> <p> It expects the following options (or defaults): </p> <ul> @@ -385,16 +397,16 @@ </li> </ul> </div> </div> - <div id="method-M000116" class="method-detail"> - <a name="M000116"></a> + <div id="method-M000118" class="method-detail"> + <a name="M000118"></a> <div class="method-heading"> - <a href="Configurator.src/M000116.html" target="Code" class="method-signature" - onclick="popupCode('Configurator.src/M000116.html');return false;"> + <a href="Configurator.src/M000118.html" target="Code" class="method-signature" + onclick="popupCode('Configurator.src/M000118.html');return false;"> <span class="method-name">load_mime_map</span><span class="method-args">(file, mime={})</span> </a> </div> <div class="method-description"> @@ -407,16 +419,16 @@ MIME types map is organized. </p> </div> </div> - <div id="method-M000114" class="method-detail"> - <a name="M000114"></a> + <div id="method-M000116" class="method-detail"> + <a name="M000116"></a> <div class="method-heading"> - <a href="Configurator.src/M000114.html" target="Code" class="method-signature" - onclick="popupCode('Configurator.src/M000114.html');return false;"> + <a href="Configurator.src/M000116.html" target="Code" class="method-signature" + onclick="popupCode('Configurator.src/M000116.html');return false;"> <span class="method-name">load_plugins</span><span class="method-args">(options={})</span> </a> </div> <div class="method-description"> @@ -427,16 +439,16 @@ determining the dependencies. </p> </div> </div> - <div id="method-M000115" class="method-detail"> - <a name="M000115"></a> + <div id="method-M000117" class="method-detail"> + <a name="M000117"></a> <div class="method-heading"> - <a href="Configurator.src/M000115.html" target="Code" class="method-signature" - onclick="popupCode('Configurator.src/M000115.html');return false;"> + <a href="Configurator.src/M000117.html" target="Code" class="method-signature" + onclick="popupCode('Configurator.src/M000117.html');return false;"> <span class="method-name">load_yaml</span><span class="method-args">(file, default={})</span> </a> </div> <div class="method-description"> @@ -444,16 +456,16 @@ Easy way to load a YAML file and apply default settings. </p> </div> </div> - <div id="method-M000124" class="method-detail"> - <a name="M000124"></a> + <div id="method-M000127" class="method-detail"> + <a name="M000127"></a> <div class="method-heading"> - <a href="Configurator.src/M000124.html" target="Code" class="method-signature" - onclick="popupCode('Configurator.src/M000124.html');return false;"> + <a href="Configurator.src/M000127.html" target="Code" class="method-signature" + onclick="popupCode('Configurator.src/M000127.html');return false;"> <span class="method-name">log</span><span class="method-args">(msg)</span> </a> </div> <div class="method-description"> @@ -461,16 +473,16 @@ Logs a simple message to STDERR (or the mongrel log if in daemon mode). </p> </div> </div> - <div id="method-M000117" class="method-detail"> - <a name="M000117"></a> + <div id="method-M000119" class="method-detail"> + <a name="M000119"></a> <div class="method-heading"> - <a href="Configurator.src/M000117.html" target="Code" class="method-signature" - onclick="popupCode('Configurator.src/M000117.html');return false;"> + <a href="Configurator.src/M000119.html" target="Code" class="method-signature" + onclick="popupCode('Configurator.src/M000119.html');return false;"> <span class="method-name">plugin</span><span class="method-args">(name, options={})</span> </a> </div> <div class="method-description"> @@ -480,16 +492,40 @@ to passing them in. </p> </div> </div> - <div id="method-M000110" class="method-detail"> - <a name="M000110"></a> + <div id="method-M000120" class="method-detail"> + <a name="M000120"></a> <div class="method-heading"> - <a href="Configurator.src/M000110.html" target="Code" class="method-signature" - onclick="popupCode('Configurator.src/M000110.html');return false;"> + <a href="Configurator.src/M000120.html" target="Code" class="method-signature" + onclick="popupCode('Configurator.src/M000120.html');return false;"> + <span class="method-name">redirect</span><span class="method-args">(from, pattern, replacement = nil, &amp;block)</span> + </a> + </div> + + <div class="method-description"> + <p> +Let&#8217;s you do redirects easily as described in <a +href="RedirectHandler.html">Mongrel::RedirectHandler</a>. You use it inside +the configurator like this: +</p> +<pre> + redirect(&quot;/test&quot;, &quot;/to/there&quot;) # simple + redirect(&quot;/to&quot;, /t/, 'w') # regexp + redirect(&quot;/hey&quot;, /(w+)/) {|match| ...} # block +</pre> + </div> + </div> + + <div id="method-M000112" class="method-detail"> + <a name="M000112"></a> + + <div class="method-heading"> + <a href="Configurator.src/M000112.html" target="Code" class="method-signature" + onclick="popupCode('Configurator.src/M000112.html');return false;"> <span class="method-name">resolve_defaults</span><span class="method-args">(options)</span> </a> </div> <div class="method-description"> @@ -498,36 +534,36 @@ used internally. </p> </div> </div> - <div id="method-M000118" class="method-detail"> - <a name="M000118"></a> + <div id="method-M000121" class="method-detail"> + <a name="M000121"></a> <div class="method-heading"> - <a href="Configurator.src/M000118.html" target="Code" class="method-signature" - onclick="popupCode('Configurator.src/M000118.html');return false;"> + <a href="Configurator.src/M000121.html" target="Code" class="method-signature" + onclick="popupCode('Configurator.src/M000121.html');return false;"> <span class="method-name">run</span><span class="method-args">()</span> </a> </div> <div class="method-description"> <p> Works like a meta run method which goes through all the configured listeners. Use the <a -href="Configurator.html#M000120">Configurator.join</a> method to prevent +href="Configurator.html#M000123">Configurator.join</a> method to prevent Ruby from exiting until each one is done. </p> </div> </div> - <div id="method-M000122" class="method-detail"> - <a name="M000122"></a> + <div id="method-M000125" class="method-detail"> + <a name="M000125"></a> <div class="method-heading"> - <a href="Configurator.src/M000122.html" target="Code" class="method-signature" - onclick="popupCode('Configurator.src/M000122.html');return false;"> + <a href="Configurator.src/M000125.html" target="Code" class="method-signature" + onclick="popupCode('Configurator.src/M000125.html');return false;"> <span class="method-name">run_config</span><span class="method-args">(script)</span> </a> </div> <div class="method-description"> @@ -539,16 +575,16 @@ href="Configurator.html">Configurator</a> statements. </p> </div> </div> - <div id="method-M000123" class="method-detail"> - <a name="M000123"></a> + <div id="method-M000126" class="method-detail"> + <a name="M000126"></a> <div class="method-heading"> - <a href="Configurator.src/M000123.html" target="Code" class="method-signature" - onclick="popupCode('Configurator.src/M000123.html');return false;"> + <a href="Configurator.src/M000126.html" target="Code" class="method-signature" + onclick="popupCode('Configurator.src/M000126.html');return false;"> <span class="method-name">setup_signals</span><span class="method-args">(options={})</span> </a> </div> <div class="method-description"> @@ -557,27 +593,27 @@ configures if the platform is not win32 and doesn&#8217;t do a HUP signal since this is typically framework specific. </p> <p> Requires a :pid_file option given to <a -href="Configurator.html#M000105">Configurator.new</a> to indicate a file to +href="Configurator.html#M000107">Configurator.new</a> to indicate a file to delete. It sets the MongrelConfig.needs_restart attribute if the start command should reload. It&#8217;s up to you to detect this and do whatever is needed for a &quot;restart&quot;. </p> <p> This command is safely ignored if the platform is win32 (with a warning) </p> </div> </div> - <div id="method-M000119" class="method-detail"> - <a name="M000119"></a> + <div id="method-M000122" class="method-detail"> + <a name="M000122"></a> <div class="method-heading"> - <a href="Configurator.src/M000119.html" target="Code" class="method-signature" - onclick="popupCode('Configurator.src/M000119.html');return false;"> + <a href="Configurator.src/M000122.html" target="Code" class="method-signature" + onclick="popupCode('Configurator.src/M000122.html');return false;"> <span class="method-name">stop</span><span class="method-args">(needs_restart=false, unlink_pid_file=true)</span> </a> </div> <div class="method-description"> @@ -587,24 +623,24 @@ restart and that the pid file should be unlinked on exit. </p> </div> </div> - <div id="method-M000112" class="method-detail"> - <a name="M000112"></a> + <div id="method-M000114" class="method-detail"> + <a name="M000114"></a> <div class="method-heading"> - <a href="Configurator.src/M000112.html" target="Code" class="method-signature" - onclick="popupCode('Configurator.src/M000112.html');return false;"> + <a href="Configurator.src/M000114.html" target="Code" class="method-signature" + onclick="popupCode('Configurator.src/M000114.html');return false;"> <span class="method-name">uri</span><span class="method-args">(location, options={})</span> </a> </div> <div class="method-description"> <p> Called inside a <a -href="Configurator.html#M000111">Configurator.listener</a> block in order +href="Configurator.html#M000113">Configurator.listener</a> block in order to add URI-&gt;handler mappings for that listener. Use this as many times as you like. It expects the following options or defaults: </p> <ul> <li>:handler =&gt; <a href="HttpHandler.html">HttpHandler</a> &#8212; Handler @@ -617,15 +653,15 @@ </li> </ul> </div> </div> - <div id="method-M000107" class="method-detail"> - <a name="M000107"></a> + <div id="method-M000109" class="method-detail"> + <a name="M000109"></a> <div class="method-heading"> - <a href="Configurator.src/M000107.html" target="Code" class="method-signature" - onclick="popupCode('Configurator.src/M000107.html');return false;"> + <a href="Configurator.src/M000109.html" target="Code" class="method-signature" + onclick="popupCode('Configurator.src/M000109.html');return false;"> <span class="method-name">write_pid_file</span><span class="method-args">()</span> </a> </div> <div class="method-description"> \ No newline at end of file