Skip to content

Commit

Permalink
Update website for 3.82.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyevans committed Jul 12, 2024
1 parent 93f6038 commit 80dcde9
Show file tree
Hide file tree
Showing 21 changed files with 419 additions and 274 deletions.
4 changes: 2 additions & 2 deletions documentation.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</nav>

<div class="content"><div class="contain">
<h1>Documentation for Roda (v3.81.0)</h1>
<h1>Documentation for Roda (v3.82.0)</h1>

<h2><a href="rdoc/files/README_rdoc.html">README</a> <small>(Introduction to Roda, start here if new)</small></h2>

Expand Down Expand Up @@ -252,7 +252,7 @@ <h2 id="release-notes">Release Notes</h2>


<li>
<a href='rdoc/files/doc/release_notes/3_81_0_txt.html'>3.81</a> | <a href='rdoc/files/doc/release_notes/3_80_0_txt.html'>3.80</a>
<a href='rdoc/files/doc/release_notes/3_82_0_txt.html'>3.82</a> | <a href='rdoc/files/doc/release_notes/3_81_0_txt.html'>3.81</a> | <a href='rdoc/files/doc/release_notes/3_80_0_txt.html'>3.80</a>
</li>

<li>
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ <h1 class="red center">A Modular, Scalable Ruby Framework</h1>
<li>
<svg class="feature" viewBox="0 0 41 41"><circle cx="20.5" cy="20.5" r="19.5"/><polyline points="10.88 22.78 15.31 27.21 28.93 13.59"/></svg>
<strong>Simple, Reliable API</strong>
<p class="graylight">Currently at version 3.81.0</p>
<p class="graylight">Currently at version 3.82.0</p>
</li>

<li>
Expand Down
2 changes: 1 addition & 1 deletion rdoc/classes/Roda.html
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ <h2>Constants</h2>
<tr class='top-aligned-row context-row'>
<td class='context-item-name'>RodaMinorVersion</td>
<td>=</td>
<td class='context-item-value'>81</td>
<td class='context-item-value'>82</td>
<td>&nbsp;</td>
<td class='context-item-desc'>
<p>The minor version of <a href="Roda.html"><code>Roda</code></a>, updated for new feature releases of <a href="Roda.html"><code>Roda</code></a>.</p>
Expand Down
8 changes: 5 additions & 3 deletions rdoc/classes/Roda/RodaPlugins/CaptureERB.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ <h1 class='name'><span class='type'>module</span>
&lt;% end %&gt;</pre>

<p><code>capture_erb</code> can be used inside other methods that are called inside templates. It can be combined with the inject_erb plugin to wrap template blocks with arbitrary output and then inject the wrapped output into the template.</p>

<p>If the output buffer object responds to <code>capture</code> (e.g. when <code>erubi/capture_block</code> is being used as the template engine), this will call <code>capture</code> on the output buffer object, instead of setting the output buffer object temporarily to a new object.</p>
</div>
<div id='method-list'>
<h2>Methods</h2>
Expand Down Expand Up @@ -76,9 +78,9 @@ <h2>Public Class methods</h2>
[show source]
</a>
<pre id='method-c-load_dependencies-source'> <span class="ruby-comment"># File lib/roda/plugins/capture_erb.rb</span>
<span class="line-num">19</span> <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">load_dependencies</span>(<span class="ruby-identifier">app</span>)
<span class="line-num">20</span> <span class="ruby-identifier">app</span>.<span class="ruby-identifier">plugin</span> <span class="ruby-value">:render</span>
<span class="line-num">21</span> <span class="ruby-keyword">end</span></pre>
<span class="line-num">24</span> <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">load_dependencies</span>(<span class="ruby-identifier">app</span>)
<span class="line-num">25</span> <span class="ruby-identifier">app</span>.<span class="ruby-identifier">plugin</span> <span class="ruby-value">:render</span>
<span class="line-num">26</span> <span class="ruby-keyword">end</span></pre>
</div>
</div>
</div>
Expand Down
25 changes: 16 additions & 9 deletions rdoc/classes/Roda/RodaPlugins/CaptureERB/InstanceMethods.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ <h2>Public Instance methods</h2>
<div class='method public-instance' id='method-method-i-capture_erb'>
<a name='method-i-capture_erb'></a>
<div class='synopsis'>
<span class='name'>capture_erb</span><span class='arguments'>()</span>
<span class='name'>capture_erb</span><span class='arguments'>(&block)</span>

</div>
<div class='description'>
Expand All @@ -64,14 +64,21 @@ <h2>Public Instance methods</h2>
[show source]
</a>
<pre id='method-i-capture_erb-source'> <span class="ruby-comment"># File lib/roda/plugins/capture_erb.rb</span>
<span class="line-num">28</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">capture_erb</span>
<span class="line-num">29</span> <span class="ruby-identifier">outvar</span> = <span class="ruby-identifier">render_opts</span>[<span class="ruby-value">:template_opts</span>][<span class="ruby-value">:outvar</span>]
<span class="line-num">30</span> <span class="ruby-identifier">buf_was</span> = <span class="ruby-identifier">instance_variable_get</span>(<span class="ruby-identifier">outvar</span>)
<span class="line-num">31</span> <span class="ruby-identifier">instance_variable_set</span>(<span class="ruby-identifier">outvar</span>, <span class="ruby-constant">String</span>.<span class="ruby-identifier">new</span>)
<span class="line-num">32</span> <span class="ruby-keyword">yield</span>.<span class="ruby-identifier">to_s</span>
<span class="line-num">33</span> <span class="ruby-keyword">ensure</span>
<span class="line-num">34</span> <span class="ruby-identifier">instance_variable_set</span>(<span class="ruby-identifier">outvar</span>, <span class="ruby-identifier">buf_was</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">outvar</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">buf_was</span>
<span class="line-num">35</span> <span class="ruby-keyword">end</span></pre>
<span class="line-num">33</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">capture_erb</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
<span class="line-num">34</span> <span class="ruby-identifier">outvar</span> = <span class="ruby-identifier">render_opts</span>[<span class="ruby-value">:template_opts</span>][<span class="ruby-value">:outvar</span>]
<span class="line-num">35</span> <span class="ruby-identifier">buf_was</span> = <span class="ruby-identifier">instance_variable_get</span>(<span class="ruby-identifier">outvar</span>)
<span class="line-num">36</span>
<span class="line-num">37</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">buf_was</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value">:capture</span>)
<span class="line-num">38</span> <span class="ruby-identifier">buf_was</span>.<span class="ruby-identifier">capture</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
<span class="line-num">39</span> <span class="ruby-keyword">else</span>
<span class="line-num">40</span> <span class="ruby-keyword">begin</span>
<span class="line-num">41</span> <span class="ruby-identifier">instance_variable_set</span>(<span class="ruby-identifier">outvar</span>, <span class="ruby-constant">String</span>.<span class="ruby-identifier">new</span>)
<span class="line-num">42</span> <span class="ruby-keyword">yield</span>.<span class="ruby-identifier">to_s</span>
<span class="line-num">43</span> <span class="ruby-keyword">ensure</span>
<span class="line-num">44</span> <span class="ruby-identifier">instance_variable_set</span>(<span class="ruby-identifier">outvar</span>, <span class="ruby-identifier">buf_was</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">outvar</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">buf_was</span>
<span class="line-num">45</span> <span class="ruby-keyword">end</span>
<span class="line-num">46</span> <span class="ruby-keyword">end</span>
<span class="line-num">47</span> <span class="ruby-keyword">end</span></pre>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ <h1 class='name'><span class='type'>module</span>
<div id='content'>
<div id='text'>
<div id='description'>
<p>The response_headers_plain_hash plugin will change <a href="../../Roda.html"><code>Roda</code></a> to use a plain hash for response headers. This is Roda’s default behavior on Rack 2, but on Rack 3+, <a href="../../Roda.html"><code>Roda</code></a> defaults to using Rack::Headers for response headers for backwards compatibility (Rack::Headers automatically lower cases header keys).</p>
<p>The plain_hash_response_headers plugin will change <a href="../../Roda.html"><code>Roda</code></a> to use a plain hash for response headers. This is Roda’s default behavior on Rack 2, but on Rack 3+, <a href="../../Roda.html"><code>Roda</code></a> defaults to using Rack::Headers for response headers for backwards compatibility (Rack::Headers automatically lower cases header keys).</p>

<p>On Rack 3+, you should use this plugin for better performance if you are sure all headers in your application and middleware are already lower case (lower case response header keys are required by the Rack 3 spec).</p>
</div>
Expand Down
65 changes: 51 additions & 14 deletions rdoc/classes/Roda/RodaPlugins/Public.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,29 @@ <h2>Constants</h2>
<div class='name-list'>
<table summary='Constants'>
<tr class='top-aligned-row context-row'>
<td class='context-item-name'>ENCODING_EXTENSIONS</td>
<td>=</td>
<td class='context-item-value'>{'br'=>'.br', 'gzip'=>'.gz', 'zstd'=>'.zst'}.freeze</td>
<td>&nbsp;</td>
<td class='context-item-desc'></td>
</tr>
<tr class='top-aligned-row context-row'>
<td class='context-item-name'>ENCODING_MAP</td>
<td>=</td>
<td class='context-item-value'>{:zstd=>'zstd', :brotli=>'br', :gzip=>'gzip'}.freeze</td>
<td>&nbsp;</td>
<td class='context-item-desc'></td>
</tr>
<tr class='top-aligned-row context-row'>
<td class='context-item-name'>MATCH_METHOD</td>
<td>=</td>
<td class='context-item-value'>RUBY_VERSION >= '2.4' ? :match? : :match</td>
<td>&nbsp;</td>
<td class='context-item-desc'>
<p>:nocov:</p>
</td>
</tr>
<tr class='top-aligned-row context-row'>
<td class='context-item-name'>PARSER</td>
<td>=</td>
<td class='context-item-value'>URI::DEFAULT_PARSER</td>
Expand Down Expand Up @@ -116,16 +139,20 @@ <h2>Public Class methods</h2>
<div class='description'>

<p>Use options given to setup a Rack::File instance for serving files. Options:</p>
<table class="rdoc-list note-list"><tbody><tr><td class='label'>:default_mime </td><td>
<table class="rdoc-list note-list"><tbody><tr><td class='label'>:brotli </td><td>
<p>Whether to serve already brotli-compressed files with a .br extension for clients supporting “br” transfer encoding.</p>
</td></tr><tr><td class='label'>:default_mime </td><td>
<p>The default mime type to use if the mime type is not recognized.</p>
</td></tr><tr><td class='label'>:encodings </td><td>
<p>An enumerable of pairs to handle accepted encodings. The first element of the pair is the accepted encoding name (e.g. ‘gzip’), and the second element of the pair is the file extension (e.g. ‘.gz’). This allows configuration of the order in which encodings are tried, to prefer brotli to zstd for example, or to support encodings other than zstd, brotli, and gzip. This takes precedence over the :brotli, :gzip, and :zstd options if given.</p>
</td></tr><tr><td class='label'>:gzip </td><td>
<p>Whether to serve already gzipped files with a .gz extension for clients supporting gzipped transfer encoding.</p>
</td></tr><tr><td class='label'>:brotli </td><td>
<p>Whether to serve already brotli-compressed files with a .br extension for clients supporting brotli transfer encoding.</p>
<p>Whether to serve already gzipped files with a .gz extension for clients supporting “gzip” transfer encoding.</p>
</td></tr><tr><td class='label'>:headers </td><td>
<p>A hash of headers to use for statically served files</p>
</td></tr><tr><td class='label'>:root </td><td>
<p>Use this option for the root of the public directory (default: “public”)</p>
</td></tr><tr><td class='label'>:zstd </td><td>
<p>Whether to serve already zstd-compressed files with a .zst extension for clients supporting “zstd” transfer encoding.</p>
</td></tr></tbody></table>

</div>
Expand All @@ -134,16 +161,26 @@ <h2>Public Class methods</h2>
[show source]
</a>
<pre id='method-c-configure-source'> <span class="ruby-comment"># File lib/roda/plugins/public.rb</span>
<span class="line-num">56</span> <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">configure</span>(<span class="ruby-identifier">app</span>, <span class="ruby-identifier">opts</span>={})
<span class="line-num">57</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">opts</span>[<span class="ruby-value">:root</span>]
<span class="line-num">58</span> <span class="ruby-identifier">app</span>.<span class="ruby-identifier">opts</span>[<span class="ruby-value">:public_root</span>] = <span class="ruby-identifier">app</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">opts</span>[<span class="ruby-value">:root</span>])
<span class="line-num">59</span> <span class="ruby-keyword">elsif</span> <span class="ruby-operator">!</span><span class="ruby-identifier">app</span>.<span class="ruby-identifier">opts</span>[<span class="ruby-value">:public_root</span>]
<span class="line-num">60</span> <span class="ruby-identifier">app</span>.<span class="ruby-identifier">opts</span>[<span class="ruby-value">:public_root</span>] = <span class="ruby-identifier">app</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-string">&quot;public&quot;</span>)
<span class="line-num">61</span> <span class="ruby-keyword">end</span>
<span class="line-num">62</span> <span class="ruby-identifier">app</span>.<span class="ruby-identifier">opts</span>[<span class="ruby-value">:public_server</span>] = <span class="ruby-constant">RACK_FILES</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">app</span>.<span class="ruby-identifier">opts</span>[<span class="ruby-value">:public_root</span>], <span class="ruby-identifier">opts</span>[<span class="ruby-value">:headers</span>]<span class="ruby-operator">||</span>{}, <span class="ruby-identifier">opts</span>[<span class="ruby-value">:default_mime</span>] <span class="ruby-operator">||</span> <span class="ruby-string">&#39;text/plain&#39;</span>)
<span class="line-num">63</span> <span class="ruby-identifier">app</span>.<span class="ruby-identifier">opts</span>[<span class="ruby-value">:public_gzip</span>] = <span class="ruby-identifier">opts</span>[<span class="ruby-value">:gzip</span>]
<span class="line-num">64</span> <span class="ruby-identifier">app</span>.<span class="ruby-identifier">opts</span>[<span class="ruby-value">:public_brotli</span>] = <span class="ruby-identifier">opts</span>[<span class="ruby-value">:brotli</span>]
<span class="line-num">65</span> <span class="ruby-keyword">end</span></pre>
<span class="line-num">71</span> <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">configure</span>(<span class="ruby-identifier">app</span>, <span class="ruby-identifier">opts</span>={})
<span class="line-num">72</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">opts</span>[<span class="ruby-value">:root</span>]
<span class="line-num">73</span> <span class="ruby-identifier">app</span>.<span class="ruby-identifier">opts</span>[<span class="ruby-value">:public_root</span>] = <span class="ruby-identifier">app</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">opts</span>[<span class="ruby-value">:root</span>])
<span class="line-num">74</span> <span class="ruby-keyword">elsif</span> <span class="ruby-operator">!</span><span class="ruby-identifier">app</span>.<span class="ruby-identifier">opts</span>[<span class="ruby-value">:public_root</span>]
<span class="line-num">75</span> <span class="ruby-identifier">app</span>.<span class="ruby-identifier">opts</span>[<span class="ruby-value">:public_root</span>] = <span class="ruby-identifier">app</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-string">&quot;public&quot;</span>)
<span class="line-num">76</span> <span class="ruby-keyword">end</span>
<span class="line-num">77</span> <span class="ruby-identifier">app</span>.<span class="ruby-identifier">opts</span>[<span class="ruby-value">:public_server</span>] = <span class="ruby-constant">RACK_FILES</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">app</span>.<span class="ruby-identifier">opts</span>[<span class="ruby-value">:public_root</span>], <span class="ruby-identifier">opts</span>[<span class="ruby-value">:headers</span>]<span class="ruby-operator">||</span>{}, <span class="ruby-identifier">opts</span>[<span class="ruby-value">:default_mime</span>] <span class="ruby-operator">||</span> <span class="ruby-string">&#39;text/plain&#39;</span>)
<span class="line-num">78</span>
<span class="line-num">79</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">encodings</span> = <span class="ruby-identifier">opts</span>[<span class="ruby-value">:encodings</span>]
<span class="line-num">80</span> <span class="ruby-keyword">if</span> <span class="ruby-constant">ENCODING_MAP</span>.<span class="ruby-identifier">any?</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-operator">|</span> <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">has_key?</span>(<span class="ruby-identifier">k</span>)}
<span class="line-num">81</span> <span class="ruby-identifier">encodings</span> = <span class="ruby-constant">ENCODING_MAP</span>.<span class="ruby-identifier">map</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">k</span>, <span class="ruby-identifier">v</span><span class="ruby-operator">|</span> [<span class="ruby-identifier">v</span>, <span class="ruby-constant">ENCODING_EXTENSIONS</span>[<span class="ruby-identifier">v</span>]] <span class="ruby-keyword">if</span> <span class="ruby-identifier">opts</span>[<span class="ruby-identifier">k</span>]}.<span class="ruby-identifier">compact</span>
<span class="line-num">82</span> <span class="ruby-keyword">end</span>
<span class="line-num">83</span> <span class="ruby-keyword">end</span>
<span class="line-num">84</span> <span class="ruby-identifier">encodings</span> = (<span class="ruby-identifier">encodings</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">app</span>.<span class="ruby-identifier">opts</span>[<span class="ruby-value">:public_encodings</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">EMPTY_ARRAY</span>).<span class="ruby-identifier">map</span>(<span class="ruby-operator">&amp;</span><span class="ruby-value">:dup</span>).<span class="ruby-identifier">freeze</span>
<span class="line-num">85</span> <span class="ruby-identifier">encodings</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">a</span><span class="ruby-operator">|</span>
<span class="line-num">86</span> <span class="ruby-identifier">a</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-regexp">/\b#{a[0]}\b/</span>
<span class="line-num">87</span> <span class="ruby-keyword">end</span>
<span class="line-num">88</span> <span class="ruby-identifier">encodings</span>.<span class="ruby-identifier">each</span>(<span class="ruby-operator">&amp;</span><span class="ruby-value">:freeze</span>)
<span class="line-num">89</span> <span class="ruby-identifier">app</span>.<span class="ruby-identifier">opts</span>[<span class="ruby-value">:public_encodings</span>] = <span class="ruby-identifier">encodings</span>
<span class="line-num">90</span> <span class="ruby-keyword">end</span></pre>
</div>
</div>
</div>
Expand Down
Loading

0 comments on commit 80dcde9

Please sign in to comment.