diff options
| author | Gibheer <gibheer@gmail.com> | 2012-11-27 06:40:49 +0100 | 
|---|---|---|
| committer | Gibheer <gibheer@gmail.com> | 2012-11-27 06:40:49 +0100 | 
| commit | 46739a8a2494f7b3e8ae83ce3caeee078378a473 (patch) | |
| tree | dc0f4b416cbd7b99e725c2b91d85ab566bdca2a8 | |
| parent | 1ba18b4d9c32f25d88d5fb79edd877052ccf8080 (diff) | |
Revert "refreshed documentation"
This reverts commit be1afcd114d148dbfedb7a3fc068af64a83b5991.
| -rw-r--r-- | doc/Zero.html | 4 | ||||
| -rw-r--r-- | doc/Zero/Controller.html | 2 | ||||
| -rw-r--r-- | doc/Zero/Renderer.html | 463 | ||||
| -rw-r--r-- | doc/Zero/Request.html | 2 | ||||
| -rw-r--r-- | doc/Zero/Request/Accept.html | 2 | ||||
| -rw-r--r-- | doc/Zero/Request/AcceptType.html | 2 | ||||
| -rw-r--r-- | doc/Zero/Request/Client.html | 2 | ||||
| -rw-r--r-- | doc/Zero/Request/Parameter.html | 2 | ||||
| -rw-r--r-- | doc/Zero/Request/Server.html | 2 | ||||
| -rw-r--r-- | doc/Zero/Response.html | 2 | ||||
| -rw-r--r-- | doc/Zero/Router.html | 2 | ||||
| -rw-r--r-- | doc/_index.html | 17 | ||||
| -rw-r--r-- | doc/class_list.html | 2 | ||||
| -rw-r--r-- | doc/file.README.html | 2 | ||||
| -rw-r--r-- | doc/index.html | 2 | ||||
| -rw-r--r-- | doc/method_list.html | 44 | ||||
| -rw-r--r-- | doc/top-level-namespace.html | 2 | 
17 files changed, 187 insertions, 367 deletions
| diff --git a/doc/Zero.html b/doc/Zero.html index eeaf9fd..b7de645 100644 --- a/doc/Zero.html +++ b/doc/Zero.html @@ -92,7 +92,7 @@ -      <strong class="classes">Classes:</strong> <span class='object_link'><a href="Zero/Controller.html" title="Zero::Controller (class)">Controller</a></span>, <span class='object_link'><a href="Zero/Renderer.html" title="Zero::Renderer (class)">Renderer</a></span>, <span class='object_link'><a href="Zero/Request.html" title="Zero::Request (class)">Request</a></span>, <span class='object_link'><a href="Zero/Response.html" title="Zero::Response (class)">Response</a></span>, <span class='object_link'><a href="Zero/Router.html" title="Zero::Router (class)">Router</a></span> +      <strong class="classes">Classes:</strong> <span class='object_link'><a href="Zero/Controller.html" title="Zero::Controller (class)">Controller</a></span>, <span class='object_link'><a href="Zero/FileNotFoundError.html" title="Zero::FileNotFoundError (class)">FileNotFoundError</a></span>, <span class='object_link'><a href="Zero/Renderer.html" title="Zero::Renderer (class)">Renderer</a></span>, <span class='object_link'><a href="Zero/Request.html" title="Zero::Request (class)">Request</a></span>, <span class='object_link'><a href="Zero/Response.html" title="Zero::Response (class)">Response</a></span>, <span class='object_link'><a href="Zero/Router.html" title="Zero::Router (class)">Router</a></span>  </p> @@ -121,7 +121,7 @@  </div>      <div id="footer"> -  Generated on Mon Nov 26 21:45:19 2012 by +  Generated on Mon Nov 26 21:40:00 2012 by    <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>    0.8.3 (ruby-1.9.3).  </div> diff --git a/doc/Zero/Controller.html b/doc/Zero/Controller.html index 85b2540..a4e6a0c 100644 --- a/doc/Zero/Controller.html +++ b/doc/Zero/Controller.html @@ -607,7 +607,7 @@ the request before rendering stuff.</p>  </div>      <div id="footer"> -  Generated on Mon Nov 26 21:45:20 2012 by +  Generated on Mon Nov 26 21:40:01 2012 by    <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>    0.8.3 (ruby-1.9.3).  </div> diff --git a/doc/Zero/Renderer.html b/doc/Zero/Renderer.html index 0ff7fb7..4ce1cee 100644 --- a/doc/Zero/Renderer.html +++ b/doc/Zero/Renderer.html @@ -102,22 +102,22 @@  <h2>Overview</h2><div class="docstring">    <div class="discussion"> -<p>the base renderer for getting render containers</p> +<p>This class helps with rendering of content.</p> -<p>This class handles templates and render coontainers, which can be used for -the actual rendering.</p> +<p>The purpose of this class is to render templates. All variables pushed into +the renderer should be already processed, so that the raw data can be used.</p> -<p>To use this renderer you have to give it a template path and optionally a -map of shorthand type descriptions to fully types. This will then be used -to extend the internal map of templates to possible formats in a way, that -you will be able to answer xhtml and html requests with the same template.</p> +<p>The workflow of this class is like the following.</p> +<ul><li> +<p>setup the type mapping</p> +</li><li> +<p>create a new instance of the class to prepare rendering</p> +</li><li> +<p>call #render to process the template</p> +</li></ul> -<p>When the object is initialized and you are sure, everything is loaded, call -#read_template_path! and the template tree will be built. Without this -step, you will probably don't get any output.</p> - -<p>After the setup, the renderer can be used to build render containers, which -then can be used to actually render something.</p> +<p>The call to #render will return the String representation of the template +with all data given.</p>    </div> @@ -129,13 +129,21 @@ then can be used to actually render something.</p> -  <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2> -  <ul class="summary"> -     -      <li class="public "> + + + +   +    <h2> +      Class Method Summary +      <small>(<a href="#" class="summary_toggle">collapse</a>)</small> +    </h2> + +    <ul class="summary"> +       +        <li class="public ">    <span class="summary_signature"> -      <a href="#template_path-instance_method" title="#template_path (instance method)">- (String) <strong>template_path</strong> </a> +      <a href="#template_path%3D-class_method" title="template_path= (class method)">+ (Object) <strong>template_path=</strong>(path) </a> @@ -143,11 +151,6 @@ then can be used to actually render something.</p> -     -      <span class="note title readonly">readonly</span> -     -     -   @@ -155,16 +158,16 @@ then can be used to actually render something.</p>      <span class="summary_desc"><div class='inline'> -<p>get the path to the templates.</p> +<p>set a base path for template search.</p>  </div></span>  </li> -     -      <li class="public "> +       +        <li class="public ">    <span class="summary_signature"> -      <a href="#templates-instance_method" title="#templates (instance method)">- (Hash) <strong>templates</strong> </a> +      <a href="#type_map-class_method" title="type_map (class method)">+ (Hash) <strong>type_map</strong> </a> @@ -172,28 +175,23 @@ then can be used to actually render something.</p> -     -      <span class="note title readonly">readonly</span> -     -     -  <span class="private note title">private</span>      <span class="summary_desc"><div class='inline'> -<p>get the tree of templates.</p> +<p>returns the type map.</p>  </div></span>  </li> -     -      <li class="public "> +       +        <li class="public ">    <span class="summary_signature"> -      <a href="#type_map-instance_method" title="#type_map (instance method)">- (Hash) <strong>type_map</strong> </a> +      <a href="#type_map%3D-class_method" title="type_map= (class method)">+ (Object) <strong>type_map=</strong>(map) </a> @@ -201,11 +199,6 @@ then can be used to actually render something.</p> -     -      <span class="note title readonly">readonly</span> -     -     -   @@ -213,17 +206,13 @@ then can be used to actually render something.</p>      <span class="summary_desc"><div class='inline'> -<p>returns the hash of type conversions.</p> +<p>save a mapping hash for the type.</p>  </div></span>  </li> -     -  </ul> - - - - +       +    </ul>      <h2>        Instance Method Summary @@ -235,7 +224,7 @@ then can be used to actually render something.</p>          <li class="public ">    <span class="summary_signature"> -      <a href="#initialize-instance_method" title="#initialize (instance method)">- (Renderer) <strong>initialize</strong>(template_path, type_map = {}) </a> +      <a href="#initialize-instance_method" title="#initialize (instance method)">- (Renderer) <strong>initialize</strong>(path, context, accept_types) </a> @@ -252,7 +241,7 @@ then can be used to actually render something.</p>      <span class="summary_desc"><div class='inline'> -<p>initializes a new Renderer.</p> +<p>take the path and render the template within the context.</p>  </div></span>  </li> @@ -261,7 +250,7 @@ then can be used to actually render something.</p>          <li class="public ">    <span class="summary_signature"> -      <a href="#read_template_path%21-instance_method" title="#read_template_path! (instance method)">- (Self) <strong>read_template_path!</strong> </a> +      <a href="#render-instance_method" title="#render (instance method)">- (String) <strong>render</strong> </a> @@ -276,31 +265,7 @@ then can be used to actually render something.</p>      <span class="summary_desc"><div class='inline'> -<p>load the template tree.</p> -</div></span> -   -</li> - -       -        <li class="public "> -  <span class="summary_signature"> -     -      <a href="#render-instance_method" title="#render (instance method)">- (String) <strong>render</strong>(name, type, context) </a> -     - -     -  </span> -   -   -   -   -   -   -   - -   -    <span class="summary_desc"><div class='inline'> -<p>render a template.</p> +<p>render the template within the context.</p>  </div></span>  </li> @@ -315,7 +280,7 @@ then can be used to actually render something.</p>      <div class="method_details first">    <h3 class="signature first" id="initialize-instance_method"> -    - (<tt><span class='object_link'><a href="" title="Zero::Renderer (class)">Renderer</a></span></tt>) <strong>initialize</strong>(template_path, type_map = {})  +    - (<tt><span class='object_link'><a href="" title="Zero::Renderer (class)">Renderer</a></span></tt>) <strong>initialize</strong>(path, context, accept_types)  @@ -324,46 +289,18 @@ then can be used to actually render something.</p>  </h3><div class="docstring">    <div class="discussion"> -<p>initializes a new Renderer</p> - -<p>This method takes a path to the base template directory and a type map. -This type map is used to extend the possible renderings for different -types, which the clients sends.</p> +<p>take the path and render the template within the context</p>    </div>  </div>  <div class="tags"> -   -  <div class="examples"> -    <p class="tag_title">Examples:</p> -     -       -        <p class="example_title"><div class='inline'> -<p>create a simple renderer</p> -</div></p> -       -      <pre class="example code"><span class='rubyid_Renderer constant id'>Renderer</span><span class='dot token'>.</span><span class='rubyid_new identifier id'>new</span><span class='lparen token'>(</span><span class='string val'>'app/templates'</span><span class='rparen token'>)</span> -</pre> -     -       -        <p class="example_title"><div class='inline'> -<p>create a renderer with a small map</p> -</div></p> -       -      <pre class="example code"><span class='rubyid_Renderer constant id'>Renderer</span><span class='dot token'>.</span><span class='rubyid_new identifier id'>new</span><span class='lparen token'>(</span><span class='string val'>'app'</span><span class='comma token'>,</span> <span class='lbrace token'>{</span> -  <span class='string val'>'html'</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='lbrack token'>[</span><span class='string val'>'text/html'</span><span class='comma token'>,</span> <span class='string val'>'application/html+xml'</span><span class='rbrack token'>]</span><span class='comma token'>,</span> -  <span class='string val'>'json'</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='lbrack token'>[</span><span class='string val'>'application/json'</span><span class='comma token'>,</span> <span class='string val'>'application/aweomse+json'</span><span class='rbrack token'>]</span> -<span class='rbrace token'>}</span><span class='rparen token'>)</span> -</pre> -     -  </div> -<p class="tag_title">Parameters:</p> +  <p class="tag_title">Parameters:</p>  <ul class="param">      <li> -        <span class='name'>template_path</span> +        <span class='name'>path</span>          <span class='type'>(<tt>String</tt>)</span> @@ -372,29 +309,38 @@ types, which the clients sends.</p>          —          <div class='inline'> -<p>a string to templates</p> +<p>the relative path to the template</p>  </div>      </li>      <li> -        <span class='name'>type_map</span> -       +        <span class='name'>context</span> -        <span class='type'>(<tt>Hash</tt>)</span> +        <span class='type'>(<tt>Object</tt>)</span> -        <em class="default">(defaults to: <tt>{}</tt>)</em>          —          <div class='inline'> -<p>a map of simple types to complex ones</p> +<p>the object to process on</p>  </div>      </li> +    <li> +       +        <span class='name'>accept_types</span> +       +       +        <span class='type'></span> +       +       +       +    </li> +    </ul> @@ -404,17 +350,19 @@ types, which the clients sends.</p>        <pre class="lines"> -36 -37 -38 -39</pre> +49 +50 +51 +52 +53</pre>      </td>      <td> -      <pre class="code"><span class="info file"># File 'lib/zero/renderer.rb', line 36</span> +      <pre class="code"><span class="info file"># File 'lib/zero/renderer.rb', line 49</span> -<span class='rubyid_def def kw'>def</span> <span class='rubyid_initialize identifier id'>initialize</span><span class='lparen token'>(</span><span class='rubyid_template_path identifier id'>template_path</span><span class='comma token'>,</span> <span class='rubyid_type_map identifier id'>type_map</span> <span class='assign token'>=</span> <span class='lbrace token'>{</span><span class='rbrace token'>}</span><span class='rparen token'>)</span> -  <span class='rubyid_@template_path ivar id'>@template_path</span> <span class='assign token'>=</span> <span class='rubyid_template_path identifier id'>template_path</span> <span class='plus op'>+</span> <span class='string val'>'/'</span> -  <span class='rubyid_@type_map ivar id'>@type_map</span> <span class='assign token'>=</span> <span class='rubyid_type_map identifier id'>type_map</span> +<span class='rubyid_def def kw'>def</span> <span class='rubyid_initialize identifier id'>initialize</span><span class='lparen token'>(</span><span class='rubyid_path identifier id'>path</span><span class='comma token'>,</span> <span class='rubyid_context identifier id'>context</span><span class='comma token'>,</span> <span class='rubyid_accept_types identifier id'>accept_types</span><span class='rparen token'>)</span> +  <span class='rubyid_accept_types identifier id'>accept_types</span> <span class='opasgn op'>||=</span> <span class='rubyid_Request constant id'>Request</span><span class='colon2 op'>::</span><span class='rubyid_Accept constant id'>Accept</span><span class='dot token'>.</span><span class='rubyid_new identifier id'>new</span><span class='lparen token'>(</span><span class='string val'>'text/html'</span><span class='rparen token'>)</span> +  <span class='rubyid_@path ivar id'>@path</span>    <span class='assign token'>=</span> <span class='rubyid_find_template identifier id'>find_template</span><span class='lparen token'>(</span><span class='rubyid_path identifier id'>path</span><span class='comma token'>,</span> <span class='rubyid_accept_types identifier id'>accept_types</span><span class='rparen token'>)</span> +  <span class='rubyid_@context ivar id'>@context</span> <span class='assign token'>=</span> <span class='rubyid_context identifier id'>context</span>  <span class='rubyid_end end kw'>end</span>  </pre>      </td> @@ -424,15 +372,15 @@ types, which the clients sends.</p>  </div> -  <div id="instance_attr_details" class="attr_details"> -    <h2>Instance Attribute Details</h2> + +  <div id="class_method_details" class="method_details_list"> +    <h2>Class Method Details</h2> + -       -      <span id=""></span>        <div class="method_details first"> -  <h3 class="signature first" id="template_path-instance_method"> +  <h3 class="signature first" id="template_path=-class_method"> -    - (<tt>String</tt>) <strong>template_path</strong>  <span class="extras">(readonly)</span> +    + (<tt>Object</tt>) <strong>template_path=</strong>(path)  @@ -441,18 +389,19 @@ types, which the clients sends.</p>  </h3><div class="docstring">    <div class="discussion"> -<p>get the path to the templates</p> +<p>set a base path for template search</p>    </div>  </div>  <div class="tags"> -   -<p class="tag_title">Returns:</p> -<ul class="return"> +  <p class="tag_title">Parameters:</p> +<ul class="param">      <li> +        <span class='name'>path</span> +                <span class='type'>(<tt>String</tt>)</span> @@ -460,28 +409,29 @@ types, which the clients sends.</p>          —          <div class='inline'> -<p>the base template path</p> +<p>the path to the template base dir</p>  </div>      </li>  </ul> +  </div><table class="source_code">    <tr>      <td>        <pre class="lines"> -46 -47 -48</pre> +20 +21 +22</pre>      </td>      <td> -      <pre class="code"><span class="info file"># File 'lib/zero/renderer.rb', line 46</span> +      <pre class="code"><span class="info file"># File 'lib/zero/renderer.rb', line 20</span> -<span class='rubyid_def def kw'>def</span> <span class='rubyid_template_path identifier id'>template_path</span> -  <span class='rubyid_@template_path ivar id'>@template_path</span> +<span class='rubyid_def def kw'>def</span> <span class='rubyid_template_path= identifier id'>template_path=</span><span class='lparen token'>(</span><span class='rubyid_path identifier id'>path</span><span class='rparen token'>)</span> +  <span class='rubyid_@@path ivar id'>@@path</span> <span class='assign token'>=</span> <span class='rubyid_path identifier id'>path</span> <span class='plus op'>+</span> <span class='string val'>'/'</span>  <span class='rubyid_end end kw'>end</span>  </pre>      </td> @@ -489,12 +439,10 @@ types, which the clients sends.</p>  </table>  </div> -       -      <span id=""></span>        <div class="method_details "> -  <h3 class="signature " id="templates-instance_method"> +  <h3 class="signature " id="type_map-class_method"> -    - (<tt>Hash</tt>) <strong>templates</strong>  <span class="extras">(readonly)</span> +    + (<tt>Hash</tt>) <strong>type_map</strong>  @@ -502,12 +450,8 @@ types, which the clients sends.</p>  </h3><div class="docstring">    <div class="discussion"> -    <p class="note private"> -  <strong>This method is part of a private API.</strong> -  You should avoid using this method if possible, as it may be removed or be changed in the future. -</p> - -<p>get the tree of templates</p> +     +<p>returns the type map</p>    </div> @@ -526,7 +470,7 @@ types, which the clients sends.</p>          —          <div class='inline'> -<p>the template tree</p> +<p>the mapping for types</p>  </div>      </li> @@ -539,15 +483,15 @@ types, which the clients sends.</p>        <pre class="lines"> -50 -51 -52</pre> +40 +41 +42</pre>      </td>      <td> -      <pre class="code"><span class="info file"># File 'lib/zero/renderer.rb', line 50</span> +      <pre class="code"><span class="info file"># File 'lib/zero/renderer.rb', line 40</span> -<span class='rubyid_def def kw'>def</span> <span class='rubyid_templates identifier id'>templates</span> -  <span class='rubyid_@templates ivar id'>@templates</span> +<span class='rubyid_def def kw'>def</span> <span class='rubyid_type_map identifier id'>type_map</span> +  <span class='rubyid_@@map ivar id'>@@map</span> <span class='opasgn op'>||=</span> <span class='lbrace token'>{</span><span class='rbrace token'>}</span>  <span class='rubyid_end end kw'>end</span>  </pre>      </td> @@ -555,12 +499,10 @@ types, which the clients sends.</p>  </table>  </div> -       -      <span id=""></span>        <div class="method_details "> -  <h3 class="signature " id="type_map-instance_method"> +  <h3 class="signature " id="type_map=-class_method"> -    - (<tt>Hash</tt>) <strong>type_map</strong>  <span class="extras">(readonly)</span> +    + (<tt>Object</tt>) <strong>type_map=</strong>(map)  @@ -569,18 +511,32 @@ types, which the clients sends.</p>  </h3><div class="docstring">    <div class="discussion"> -<p>returns the hash of type conversions</p> +<p>save a mapping hash for the type</p> + +<p>With that it is possible to map long and complex contant types to simpler +representations. These get then used in the finding process for the best +fitting template.</p>    </div>  </div>  <div class="tags"> -<p class="tag_title">Returns:</p> -<ul class="return"> +  <div class="examples"> +    <p class="tag_title">Examples:</p> +     +       +      <pre class="example code"><span class='rubyid_Zero constant id'>Zero</span><span class='colon2 op'>::</span><span class='rubyid_Renderer constant id'>Renderer</span><span class='dot token'>.</span><span class='rubyid_map identifier id'>map</span> <span class='assign token'>=</span> <span class='lbrace token'>{</span><span class='string val'>'text/html'</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='string val'>'html'</span><span class='rbrace token'>}</span> +</pre> +     +  </div> +<p class="tag_title">Parameters:</p> +<ul class="param">      <li> +        <span class='name'>map</span> +                <span class='type'>(<tt>Hash</tt>)</span> @@ -588,28 +544,29 @@ types, which the clients sends.</p>          —          <div class='inline'> -<p>type conversion</p> +<p>maps the content type to a simple representation</p>  </div>      </li>  </ul> +  </div><table class="source_code">    <tr>      <td>        <pre class="lines"> -43 -44 -45</pre> +34 +35 +36</pre>      </td>      <td> -      <pre class="code"><span class="info file"># File 'lib/zero/renderer.rb', line 43</span> +      <pre class="code"><span class="info file"># File 'lib/zero/renderer.rb', line 34</span> -<span class='rubyid_def def kw'>def</span> <span class='rubyid_type_map identifier id'>type_map</span> -  <span class='rubyid_@type_map ivar id'>@type_map</span> +<span class='rubyid_def def kw'>def</span> <span class='rubyid_type_map= identifier id'>type_map=</span><span class='lparen token'>(</span><span class='rubyid_map identifier id'>map</span><span class='rparen token'>)</span> +  <span class='rubyid_@@map ivar id'>@@map</span> <span class='assign token'>=</span> <span class='rubyid_map identifier id'>map</span>  <span class='rubyid_end end kw'>end</span>  </pre>      </td> @@ -619,15 +576,14 @@ types, which the clients sends.</p>    </div> -    <div id="instance_method_details" class="method_details_list">      <h2>Instance Method Details</h2>        <div class="method_details first"> -  <h3 class="signature first" id="read_template_path!-instance_method"> +  <h3 class="signature first" id="render-instance_method"> -    - (<tt>Self</tt>) <strong>read_template_path!</strong>  +    - (<tt>String</tt>) <strong>render</strong>  @@ -636,11 +592,7 @@ types, which the clients sends.</p>  </h3><div class="docstring">    <div class="discussion"> -<p>load the template tree</p> - -<p>This method gets all templates in the `template_path` and builds an -internal tree structure, where templates and types direct the request to -the wanted template.</p> +<p>render the template within the context</p>    </div> @@ -653,152 +605,13 @@ the wanted template.</p>      <li> -        <span class='type'>(<tt>Self</tt>)</span> -       -       -       -        — -        <div class='inline'> -<p>returns the object</p> -</div> -       -    </li> -   -</ul> - -</div><table class="source_code"> -  <tr> -    <td> -      <pre class="lines"> - - -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72</pre> -    </td> -    <td> -      <pre class="code"><span class="info file"># File 'lib/zero/renderer.rb', line 58</span> - -<span class='rubyid_def def kw'>def</span> <span class='rubyid_read_template_path! fid id'>read_template_path!</span> -  <span class='comment val'># TODO clean up later</span> -  <span class='rubyid_@templates ivar id'>@templates</span> <span class='assign token'>=</span> <span class='lbrace token'>{</span><span class='rbrace token'>}</span> -  <span class='rubyid_search_files identifier id'>search_files</span><span class='dot token'>.</span><span class='rubyid_each identifier id'>each</span> <span class='rubyid_do do kw'>do</span> <span class='bitor op'>|</span><span class='rubyid_file identifier id'>file</span><span class='bitor op'>|</span> -    <span class='rubyid_parts identifier id'>parts</span> <span class='assign token'>=</span> <span class='rubyid_file identifier id'>file</span><span class='dot token'>.</span><span class='rubyid_gsub identifier id'>gsub</span><span class='lparen token'>(</span><span class='dregexp node'>/#{template_path}/</span><span class='comma token'>,</span> <span class='string val'>''</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_split identifier id'>split</span><span class='lparen token'>(</span><span class='string val'>'.'</span><span class='rparen token'>)</span> -    <span class='rubyid_@templates ivar id'>@templates</span><span class='lbrack token'>[</span><span class='rubyid_parts identifier id'>parts</span><span class='lbrack token'>[</span><span class='integer val'>0</span><span class='rbrack token'>]</span><span class='rbrack token'>]</span> <span class='opasgn op'>||=</span> <span class='lbrace token'>{</span><span class='rbrace token'>}</span> -    <span class='rubyid_if if kw'>if</span> <span class='rubyid_parts identifier id'>parts</span><span class='dot token'>.</span><span class='rubyid_count identifier id'>count</span> <span class='gt op'>></span> <span class='integer val'>2</span> <span class='rubyid_then then kw'>then</span> -      <span class='rubyid_read_type identifier id'>read_type</span><span class='lparen token'>(</span><span class='rubyid_parts identifier id'>parts</span><span class='lbrack token'>[</span><span class='integer val'>1</span><span class='rbrack token'>]</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_each identifier id'>each</span> <span class='rubyid_do do kw'>do</span> <span class='bitor op'>|</span><span class='rubyid_type identifier id'>type</span><span class='bitor op'>|</span> -        <span class='rubyid_@templates ivar id'>@templates</span><span class='lbrack token'>[</span><span class='rubyid_parts identifier id'>parts</span><span class='lbrack token'>[</span><span class='integer val'>0</span><span class='rbrack token'>]</span><span class='rbrack token'>]</span><span class='lbrack token'>[</span><span class='rubyid_type identifier id'>type</span><span class='rbrack token'>]</span> <span class='assign token'>=</span> <span class='rubyid_file identifier id'>file</span> -      <span class='rubyid_end end kw'>end</span> -    <span class='rubyid_else else kw'>else</span> -      <span class='rubyid_@templates ivar id'>@templates</span><span class='lbrack token'>[</span><span class='rubyid_parts identifier id'>parts</span><span class='lbrack token'>[</span><span class='integer val'>0</span><span class='rbrack token'>]</span><span class='rbrack token'>]</span><span class='lbrack token'>[</span><span class='string val'>''</span><span class='rbrack token'>]</span> <span class='assign token'>=</span> <span class='rubyid_file identifier id'>file</span> -    <span class='rubyid_end end kw'>end</span> -  <span class='rubyid_end end kw'>end</span> -<span class='rubyid_end end kw'>end</span> -</pre> -    </td> -  </tr> -</table> -</div> -     -      <div class="method_details "> -  <h3 class="signature " id="render-instance_method"> -   -    - (<tt>String</tt>) <strong>render</strong>(name, type, context)  -   - -   - -   -</h3><div class="docstring"> -  <div class="discussion"> -     -<p>render a template</p> - -<p>This method will render the given template, based on the type in the given -context.</p> - - -  </div> -</div> -<div class="tags"> -  <p class="tag_title">Parameters:</p> -<ul class="param"> -   -    <li> -       -        <span class='name'>name</span> -       -                <span class='type'>(<tt>String</tt>)</span>          —          <div class='inline'> -<p>the name of the template</p> -</div> -       -    </li> -   -    <li> -       -        <span class='name'>type</span> -       -       -        <span class='type'>(<tt>Array</tt>)</span> -       -       -       -        — -        <div class='inline'> -<p>a list of accept types used to find the template</p> -</div> -       -    </li> -   -    <li> -       -        <span class='name'>context</span> -       -       -        <span class='type'>(<tt>Object</tt>)</span> -       -       -       -        — -        <div class='inline'> -<p>the context in which to evaluate the template</p> -</div> -       -    </li> -   -</ul> - -<p class="tag_title">Returns:</p> -<ul class="return"> -   -    <li> -       -       -        <span class='type'>(<tt>String</tt>)</span> -       -       -       -        — -        <div class='inline'> -<p>the rendered content</p> +<p>the rendered template</p>  </div>      </li> @@ -811,15 +624,15 @@ context.</p>        <pre class="lines"> -82 -83 -84</pre> +57 +58 +59</pre>      </td>      <td> -      <pre class="code"><span class="info file"># File 'lib/zero/renderer.rb', line 82</span> +      <pre class="code"><span class="info file"># File 'lib/zero/renderer.rb', line 57</span> -<span class='rubyid_def def kw'>def</span> <span class='rubyid_render identifier id'>render</span><span class='lparen token'>(</span><span class='rubyid_name identifier id'>name</span><span class='comma token'>,</span> <span class='rubyid_type identifier id'>type</span><span class='comma token'>,</span> <span class='rubyid_context identifier id'>context</span><span class='rparen token'>)</span> -  <span class='rubyid_template identifier id'>template</span><span class='lparen token'>(</span><span class='rubyid_name identifier id'>name</span><span class='comma token'>,</span> <span class='rubyid_type identifier id'>type</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_render identifier id'>render</span><span class='lparen token'>(</span><span class='rubyid_context identifier id'>context</span><span class='rparen token'>)</span> +<span class='rubyid_def def kw'>def</span> <span class='rubyid_render identifier id'>render</span> +  <span class='rubyid_Tilt constant id'>Tilt</span><span class='dot token'>.</span><span class='rubyid_new identifier id'>new</span><span class='lparen token'>(</span><span class='rubyid_@path ivar id'>@path</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='rubyid_render identifier id'>render</span><span class='lparen token'>(</span><span class='rubyid_@context ivar id'>@context</span><span class='rparen token'>)</span>  <span class='rubyid_end end kw'>end</span>  </pre>      </td> @@ -832,7 +645,7 @@ context.</p>  </div>      <div id="footer"> -  Generated on Mon Nov 26 21:45:20 2012 by +  Generated on Mon Nov 26 21:40:01 2012 by    <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>    0.8.3 (ruby-1.9.3).  </div> diff --git a/doc/Zero/Request.html b/doc/Zero/Request.html index ff9118e..03e5591 100644 --- a/doc/Zero/Request.html +++ b/doc/Zero/Request.html @@ -1467,7 +1467,7 @@  </div>      <div id="footer"> -  Generated on Mon Nov 26 21:45:19 2012 by +  Generated on Mon Nov 26 21:40:00 2012 by    <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>    0.8.3 (ruby-1.9.3).  </div> diff --git a/doc/Zero/Request/Accept.html b/doc/Zero/Request/Accept.html index 31a2474..8a45ae0 100644 --- a/doc/Zero/Request/Accept.html +++ b/doc/Zero/Request/Accept.html @@ -603,7 +603,7 @@ from sinatra</p>  </div>      <div id="footer"> -  Generated on Mon Nov 26 21:45:20 2012 by +  Generated on Mon Nov 26 21:40:01 2012 by    <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>    0.8.3 (ruby-1.9.3).  </div> diff --git a/doc/Zero/Request/AcceptType.html b/doc/Zero/Request/AcceptType.html index d5b6338..603d3d3 100644 --- a/doc/Zero/Request/AcceptType.html +++ b/doc/Zero/Request/AcceptType.html @@ -394,7 +394,7 @@  </div>      <div id="footer"> -  Generated on Mon Nov 26 21:45:21 2012 by +  Generated on Mon Nov 26 21:40:02 2012 by    <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>    0.8.3 (ruby-1.9.3).  </div> diff --git a/doc/Zero/Request/Client.html b/doc/Zero/Request/Client.html index ce5d000..f2e733d 100644 --- a/doc/Zero/Request/Client.html +++ b/doc/Zero/Request/Client.html @@ -570,7 +570,7 @@  </div>      <div id="footer"> -  Generated on Mon Nov 26 21:45:20 2012 by +  Generated on Mon Nov 26 21:40:01 2012 by    <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>    0.8.3 (ruby-1.9.3).  </div> diff --git a/doc/Zero/Request/Parameter.html b/doc/Zero/Request/Parameter.html index cc531a8..e8c170c 100644 --- a/doc/Zero/Request/Parameter.html +++ b/doc/Zero/Request/Parameter.html @@ -480,7 +480,7 @@ parameters) and payload parameters (or POST parameters).</p>  </div>      <div id="footer"> -  Generated on Mon Nov 26 21:45:21 2012 by +  Generated on Mon Nov 26 21:40:01 2012 by    <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>    0.8.3 (ruby-1.9.3).  </div> diff --git a/doc/Zero/Request/Server.html b/doc/Zero/Request/Server.html index 28a99aa..2a187d8 100644 --- a/doc/Zero/Request/Server.html +++ b/doc/Zero/Request/Server.html @@ -678,7 +678,7 @@  </div>      <div id="footer"> -  Generated on Mon Nov 26 21:45:20 2012 by +  Generated on Mon Nov 26 21:40:01 2012 by    <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>    0.8.3 (ruby-1.9.3).  </div> diff --git a/doc/Zero/Response.html b/doc/Zero/Response.html index 4114c2c..6ed9127 100644 --- a/doc/Zero/Response.html +++ b/doc/Zero/Response.html @@ -714,7 +714,7 @@ Content-Type, Content-Length and body on status code 204 and 304.</p>  </div>      <div id="footer"> -  Generated on Mon Nov 26 21:45:20 2012 by +  Generated on Mon Nov 26 21:40:01 2012 by    <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>    0.8.3 (ruby-1.9.3).  </div> diff --git a/doc/Zero/Router.html b/doc/Zero/Router.html index 18afe2a..8f95463 100644 --- a/doc/Zero/Router.html +++ b/doc/Zero/Router.html @@ -324,7 +324,7 @@  </div>      <div id="footer"> -  Generated on Mon Nov 26 21:45:19 2012 by +  Generated on Mon Nov 26 21:40:00 2012 by    <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>    0.8.3 (ruby-1.9.3).  </div> diff --git a/doc/_index.html b/doc/_index.html index 0aa5fa0..1b45dbc 100644 --- a/doc/_index.html +++ b/doc/_index.html @@ -124,6 +124,21 @@          </ul> +        <ul id="alpha_F" class="alpha"> +          <li class="letter">F</li> +          <ul> +             +              <li> +                <span class='object_link'><a href="Zero/FileNotFoundError.html" title="Zero::FileNotFoundError (class)">FileNotFoundError</a></span> +                 +                  <small>(Zero)</small> +                 +              </li> +             +          </ul> +        </ul> +       +                  <ul id="alpha_P" class="alpha">            <li class="letter">P</li>            <ul> @@ -211,7 +226,7 @@  </div>      <div id="footer"> -  Generated on Mon Nov 26 21:45:19 2012 by +  Generated on Mon Nov 26 21:40:00 2012 by    <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>    0.8.3 (ruby-1.9.3).  </div> diff --git a/doc/class_list.html b/doc/class_list.html index 80ff11d..9e726e9 100644 --- a/doc/class_list.html +++ b/doc/class_list.html @@ -45,7 +45,7 @@        <ul id="full_list" class="class">          <li><span class='object_link'><a href="top-level-namespace.html" title=" (root)">Top Level Namespace</a></span></li> -<li><a class='toggle'></a> <span class='object_link'><a href="Zero.html" title="Zero (module)">Zero</a></span><small class='search_info'>Top Level Namespace</small></li><ul><li><span class='object_link'><a href="Zero/Controller.html" title="Zero::Controller (class)">Controller</a></span> < Object<small class='search_info'>Zero</small></li><li><span class='object_link'><a href="Zero/Renderer.html" title="Zero::Renderer (class)">Renderer</a></span> < Object<small class='search_info'>Zero</small></li><li><a class='toggle'></a> <span class='object_link'><a href="Zero/Request.html" title="Zero::Request (class)">Request</a></span> < Object<small class='search_info'>Zero</small></li><ul><li><span class='object_link'><a href="Zero/Request/Accept.html" title="Zero::Request::Accept (class)">Accept</a></span> < Object<small class='search_info'>Zero::Request</small></li><li><span class='object_link'><a href="Zero/Request/AcceptType.html" title="Zero::Request::AcceptType (class)">AcceptType</a></span> < Object<small class='search_info'>Zero::Request</small></li><li><span class='object_link'><a href="Zero/Request/Client.html" title="Zero::Request::Client (class)">Client</a></span> < Object<small class='search_info'>Zero::Request</small></li><li><span class='object_link'><a href="Zero/Request/Parameter.html" title="Zero::Request::Parameter (class)">Parameter</a></span> < Object<small class='search_info'>Zero::Request</small></li><li><span class='object_link'><a href="Zero/Request/Server.html" title="Zero::Request::Server (class)">Server</a></span> < Object<small class='search_info'>Zero::Request</small></li></ul><li><span class='object_link'><a href="Zero/Response.html" title="Zero::Response (class)">Response</a></span> < Object<small class='search_info'>Zero</small></li><li><span class='object_link'><a href="Zero/Router.html" title="Zero::Router (class)">Router</a></span> < Object<small class='search_info'>Zero</small></li></ul> +<li><a class='toggle'></a> <span class='object_link'><a href="Zero.html" title="Zero (module)">Zero</a></span><small class='search_info'>Top Level Namespace</small></li><ul><li><span class='object_link'><a href="Zero/Controller.html" title="Zero::Controller (class)">Controller</a></span> < Object<small class='search_info'>Zero</small></li><li><span class='object_link'><a href="Zero/FileNotFoundError.html" title="Zero::FileNotFoundError (class)">FileNotFoundError</a></span> < IOError<small class='search_info'>Zero</small></li><li><span class='object_link'><a href="Zero/Renderer.html" title="Zero::Renderer (class)">Renderer</a></span> < Object<small class='search_info'>Zero</small></li><li><a class='toggle'></a> <span class='object_link'><a href="Zero/Request.html" title="Zero::Request (class)">Request</a></span> < Object<small class='search_info'>Zero</small></li><ul><li><span class='object_link'><a href="Zero/Request/Accept.html" title="Zero::Request::Accept (class)">Accept</a></span> < Object<small class='search_info'>Zero::Request</small></li><li><span class='object_link'><a href="Zero/Request/AcceptType.html" title="Zero::Request::AcceptType (class)">AcceptType</a></span> < Object<small class='search_info'>Zero::Request</small></li><li><span class='object_link'><a href="Zero/Request/Client.html" title="Zero::Request::Client (class)">Client</a></span> < Object<small class='search_info'>Zero::Request</small></li><li><span class='object_link'><a href="Zero/Request/Parameter.html" title="Zero::Request::Parameter (class)">Parameter</a></span> < Object<small class='search_info'>Zero::Request</small></li><li><span class='object_link'><a href="Zero/Request/Server.html" title="Zero::Request::Server (class)">Server</a></span> < Object<small class='search_info'>Zero::Request</small></li></ul><li><span class='object_link'><a href="Zero/Response.html" title="Zero::Response (class)">Response</a></span> < Object<small class='search_info'>Zero</small></li><li><span class='object_link'><a href="Zero/Router.html" title="Zero::Router (class)">Router</a></span> < Object<small class='search_info'>Zero</small></li></ul>        </ul>      </div> diff --git a/doc/file.README.html b/doc/file.README.html index f8492d1..e684d3a 100644 --- a/doc/file.README.html +++ b/doc/file.README.html @@ -67,7 +67,7 @@  web applications.</p></div></div>      <div id="footer"> -  Generated on Mon Nov 26 21:45:19 2012 by +  Generated on Mon Nov 26 21:40:00 2012 by    <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>    0.8.3 (ruby-1.9.3).  </div> diff --git a/doc/index.html b/doc/index.html index f8492d1..e684d3a 100644 --- a/doc/index.html +++ b/doc/index.html @@ -67,7 +67,7 @@  web applications.</p></div></div>      <div id="footer"> -  Generated on Mon Nov 26 21:45:19 2012 by +  Generated on Mon Nov 26 21:40:00 2012 by    <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>    0.8.3 (ruby-1.9.3).  </div> diff --git a/doc/method_list.html b/doc/method_list.html index f02085b..f610b0d 100644 --- a/doc/method_list.html +++ b/doc/method_list.html @@ -391,14 +391,6 @@    <li class="r2 "> -    <span class='object_link'><a href="Zero/Renderer.html#read_template_path%21-instance_method" title="Zero::Renderer#read_template_path! (method)">#read_template_path!</a></span> -     -      <small>Zero::Renderer</small> -     -  </li> -   - -  <li class="r1 ">      <span class='object_link'><a href="Zero/Renderer.html#render-instance_method" title="Zero::Renderer#render (method)">#render</a></span>        <small>Zero::Renderer</small> @@ -406,7 +398,7 @@    </li> -  <li class="r2 "> +  <li class="r1 ">      <span class='object_link'><a href="Zero/Controller.html#renderer-class_method" title="Zero::Controller.renderer (method)">renderer</a></span>        <small>Zero::Controller</small> @@ -414,7 +406,7 @@    </li> -  <li class="r1 "> +  <li class="r2 ">      <span class='object_link'><a href="Zero/Controller.html#renderer-instance_method" title="Zero::Controller#renderer (method)">#renderer</a></span>        <small>Zero::Controller</small> @@ -422,7 +414,7 @@    </li> -  <li class="r2 "> +  <li class="r1 ">      <span class='object_link'><a href="Zero/Controller.html#renderer%3D-class_method" title="Zero::Controller.renderer= (method)">renderer=</a></span>        <small>Zero::Controller</small> @@ -430,7 +422,7 @@    </li> -  <li class="r1 "> +  <li class="r2 ">      <span class='object_link'><a href="Zero/Controller.html#response-instance_method" title="Zero::Controller#response (method)">#response</a></span>        <small>Zero::Controller</small> @@ -438,7 +430,7 @@    </li> -  <li class="r2 "> +  <li class="r1 ">      <span class='object_link'><a href="Zero/Request.html#server-instance_method" title="Zero::Request#server (method)">#server</a></span>        <small>Zero::Request</small> @@ -446,7 +438,7 @@    </li> -  <li class="r1 "> +  <li class="r2 ">      <span class='object_link'><a href="Zero/Request/Server.html#software-instance_method" title="Zero::Request::Server#software (method)">#software</a></span>        <small>Zero::Request::Server</small> @@ -454,7 +446,7 @@    </li> -  <li class="r2 "> +  <li class="r1 ">      <span class='object_link'><a href="Zero/Response.html#status-instance_method" title="Zero::Response#status (method)">#status</a></span>        <small>Zero::Response</small> @@ -462,16 +454,8 @@    </li> -  <li class="r1 "> -    <span class='object_link'><a href="Zero/Renderer.html#template_path-instance_method" title="Zero::Renderer#template_path (method)">#template_path</a></span> -     -      <small>Zero::Renderer</small> -     -  </li> -   -    <li class="r2 "> -    <span class='object_link'><a href="Zero/Renderer.html#templates-instance_method" title="Zero::Renderer#templates (method)">#templates</a></span> +    <span class='object_link'><a href="Zero/Renderer.html#template_path%3D-class_method" title="Zero::Renderer.template_path= (method)">template_path=</a></span>        <small>Zero::Renderer</small> @@ -487,7 +471,7 @@    <li class="r2 "> -    <span class='object_link'><a href="Zero/Renderer.html#type_map-instance_method" title="Zero::Renderer#type_map (method)">#type_map</a></span> +    <span class='object_link'><a href="Zero/Renderer.html#type_map-class_method" title="Zero::Renderer.type_map (method)">type_map</a></span>        <small>Zero::Renderer</small> @@ -495,6 +479,14 @@    <li class="r1 "> +    <span class='object_link'><a href="Zero/Renderer.html#type_map%3D-class_method" title="Zero::Renderer.type_map= (method)">type_map=</a></span> +     +      <small>Zero::Renderer</small> +     +  </li> +   + +  <li class="r2 ">      <span class='object_link'><a href="Zero/Request/Accept.html#types-instance_method" title="Zero::Request::Accept#types (method)">#types</a></span>        <small>Zero::Request::Accept</small> @@ -502,7 +494,7 @@    </li> -  <li class="r2 "> +  <li class="r1 ">      <span class='object_link'><a href="Zero/Request/Client.html#user_agent-instance_method" title="Zero::Request::Client#user_agent (method)">#user_agent</a></span>        <small>Zero::Request::Client</small> diff --git a/doc/top-level-namespace.html b/doc/top-level-namespace.html index f402421..124c135 100644 --- a/doc/top-level-namespace.html +++ b/doc/top-level-namespace.html @@ -103,7 +103,7 @@  </div>      <div id="footer"> -  Generated on Mon Nov 26 21:45:19 2012 by +  Generated on Mon Nov 26 21:40:00 2012 by    <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>    0.8.3 (ruby-1.9.3).  </div> | 
