doc/rdoc/classes/Mongrel/DirHandler.html in mongrel-0.3.13.4 vs doc/rdoc/classes/Mongrel/DirHandler.html in mongrel-1.0
- old
+ new
@@ -86,13 +86,13 @@
the files are located, and it tries to find the files based on the
PATH_INFO inside the directory. If the requested path is a directory then
it returns a simple directory listing.
</p>
<p>
-It does a simple protection against going outside it’s root path by
+It does a simple protection against going outside it‘s root path by
converting all paths to an absolute expanded path, and then making sure
-that the final expanded path includes the root path. If it doesn’t
+that the final expanded path includes the root path. If it doesn‘t
than it simply gives a 404.
</p>
<p>
The default content type is "text/plain; charset=ISO-8859-1" but
you can change it anything you want using the
@@ -106,16 +106,16 @@
<div id="method-list">
<h3 class="section-bar">Methods</h3>
<div class="name-list">
- <a href="#M000054">add_mime_type</a>
- <a href="#M000050">can_serve</a>
- <a href="#M000049">new</a>
- <a href="#M000053">process</a>
- <a href="#M000051">send_dir_listing</a>
- <a href="#M000052">send_file</a>
+ <a href="#M000056">add_mime_type</a>
+ <a href="#M000052">can_serve</a>
+ <a href="#M000051">new</a>
+ <a href="#M000055">process</a>
+ <a href="#M000053">send_dir_listing</a>
+ <a href="#M000054">send_file</a>
</div>
</div>
</div>
@@ -129,13 +129,18 @@
<h3 class="section-bar">Constants</h3>
<div class="name-list">
<table summary="Constants">
<tr class="top-aligned-row context-row">
+ <td class="context-item-name">MIME_TYPES_FILE</td>
+ <td>=</td>
+ <td class="context-item-value">"mime_types.yml"</td>
+ </tr>
+ <tr class="top-aligned-row context-row">
<td class="context-item-name">MIME_TYPES</td>
<td>=</td>
- <td class="context-item-value">{ ".css" => "text/css", ".gif" => "image/gif", ".htm" => "text/html", ".html" => "text/html", ".jpeg" => "image/jpeg", ".jpg" => "image/jpeg", ".js" => "text/javascript", ".png" => "image/png", ".swf" => "application/x-shockwave-flash", ".txt" => "text/plain"</td>
+ <td class="context-item-value">YAML.load_file(File.join(File.dirname(__FILE__), MIME_TYPES_FILE))</td>
</tr>
<tr class="top-aligned-row context-row">
<td class="context-item-name">ONLY_HEAD_GET</td>
<td>=</td>
<td class="context-item-value">"Only HEAD and GET allowed.".freeze</td>
@@ -151,19 +156,14 @@
<div class="name-list">
<table>
<tr class="top-aligned-row context-row">
<td class="context-item-name">default_content_type</td>
- <td class="context-item-value"> [R] </td>
+ <td class="context-item-value"> [RW] </td>
<td class="context-item-desc"></td>
</tr>
<tr class="top-aligned-row context-row">
- <td class="context-item-name">default_content_type</td>
- <td class="context-item-value"> [W] </td>
- <td class="context-item-desc"></td>
- </tr>
- <tr class="top-aligned-row context-row">
<td class="context-item-name">path</td>
<td class="context-item-value"> [R] </td>
<td class="context-item-desc"></td>
</tr>
</table>
@@ -174,34 +174,34 @@
<!-- if method_list -->
<div id="methods">
<h3 class="section-bar">Public Class methods</h3>
- <div id="method-M000054" class="method-detail">
- <a name="M000054"></a>
+ <div id="method-M000056" class="method-detail">
+ <a name="M000056"></a>
<div class="method-heading">
- <a href="DirHandler.src/M000054.html" target="Code" class="method-signature"
- onclick="popupCode('DirHandler.src/M000054.html');return false;">
+ <a href="DirHandler.src/M000056.html" target="Code" class="method-signature"
+ onclick="popupCode('DirHandler.src/M000056.html');return false;">
<span class="method-name">add_mime_type</span><span class="method-args">(extension, type)</span>
</a>
</div>
<div class="method-description">
<p>
There is a small number of default mime types for extensions, but this lets
-you add any others you’ll need when serving content.
+you add any others you‘ll need when serving content.
</p>
</div>
</div>
- <div id="method-M000049" class="method-detail">
- <a name="M000049"></a>
+ <div id="method-M000051" class="method-detail">
+ <a name="M000051"></a>
<div class="method-heading">
- <a href="DirHandler.src/M000049.html" target="Code" class="method-signature"
- onclick="popupCode('DirHandler.src/M000049.html');return false;">
+ <a href="DirHandler.src/M000051.html" target="Code" class="method-signature"
+ onclick="popupCode('DirHandler.src/M000051.html');return false;">
<span class="method-name">new</span><span class="method-args">(path, listing_allowed=true, index_html="index.html")</span>
</a>
</div>
<div class="method-description">
@@ -211,16 +211,16 @@
</div>
</div>
<h3 class="section-bar">Public Instance methods</h3>
- <div id="method-M000050" class="method-detail">
- <a name="M000050"></a>
+ <div id="method-M000052" class="method-detail">
+ <a name="M000052"></a>
<div class="method-heading">
- <a href="DirHandler.src/M000050.html" target="Code" class="method-signature"
- onclick="popupCode('DirHandler.src/M000050.html');return false;">
+ <a href="DirHandler.src/M000052.html" target="Code" class="method-signature"
+ onclick="popupCode('DirHandler.src/M000052.html');return false;">
<span class="method-name">can_serve</span><span class="method-args">(path_info)</span>
</a>
</div>
<div class="method-description">
@@ -229,16 +229,16 @@
not).
</p>
</div>
</div>
- <div id="method-M000053" class="method-detail">
- <a name="M000053"></a>
+ <div id="method-M000055" class="method-detail">
+ <a name="M000055"></a>
<div class="method-heading">
- <a href="DirHandler.src/M000053.html" target="Code" class="method-signature"
- onclick="popupCode('DirHandler.src/M000053.html');return false;">
+ <a href="DirHandler.src/M000055.html" target="Code" class="method-signature"
+ onclick="popupCode('DirHandler.src/M000055.html');return false;">
<span class="method-name">process</span><span class="method-args">(request, response)</span>
</a>
</div>
<div class="method-description">
@@ -247,44 +247,44 @@
allowed (based on the listing_allowed parameter to the constructor).
</p>
</div>
</div>
- <div id="method-M000051" class="method-detail">
- <a name="M000051"></a>
+ <div id="method-M000053" class="method-detail">
+ <a name="M000053"></a>
<div class="method-heading">
- <a href="DirHandler.src/M000051.html" target="Code" class="method-signature"
- onclick="popupCode('DirHandler.src/M000051.html');return false;">
+ <a href="DirHandler.src/M000053.html" target="Code" class="method-signature"
+ onclick="popupCode('DirHandler.src/M000053.html');return false;">
<span class="method-name">send_dir_listing</span><span class="method-args">(base, dir, response)</span>
</a>
</div>
<div class="method-description">
<p>
-Returns a simplistic directory listing if they’re enabled, otherwise
+Returns a simplistic directory listing if they‘re enabled, otherwise
a 403. Base is the base URI from the REQUEST_URI, dir is the directory to
serve on the file system (comes from <a
-href="DirHandler.html#M000050">can_serve</a>()), and response is the <a
+href="DirHandler.html#M000052">can_serve</a>()), and response is the <a
href="HttpResponse.html">HttpResponse</a> object to send the results on.
</p>
</div>
</div>
- <div id="method-M000052" class="method-detail">
- <a name="M000052"></a>
+ <div id="method-M000054" class="method-detail">
+ <a name="M000054"></a>
<div class="method-heading">
- <a href="DirHandler.src/M000052.html" target="Code" class="method-signature"
- onclick="popupCode('DirHandler.src/M000052.html');return false;">
+ <a href="DirHandler.src/M000054.html" target="Code" class="method-signature"
+ onclick="popupCode('DirHandler.src/M000054.html');return false;">
<span class="method-name">send_file</span><span class="method-args">(req_path, request, response, header_only=false)</span>
</a>
</div>
<div class="method-description">
<p>
Sends the contents of a file back to the user. Not terribly efficient since
-it’s opening and closing the file for each read.
+it‘s opening and closing the file for each read.
</p>
</div>
</div>
\ No newline at end of file