doc/rdoc/lore/classes/URI.html in facets-2.4.3 vs doc/rdoc/lore/classes/URI.html in facets-2.4.4

- old
+ new

@@ -72,22 +72,22 @@ <div class="sectiontitle">Methods</div> <ul> - <li><a href="#M000064">cgi_escape</a></li> - <li><a href="#M000066">cgi_parse</a></li> - <li><a href="#M000065">cgi_unescape</a></li> - <li><a href="#M000068">chomp_query_string</a></li> - <li><a href="#M000059">decode</a></li> - <li><a href="#M000067">get_query_string</a></li> - <li><a href="#M000062">hash_to_query</a></li> - <li><a href="#M000063">hash_to_query_string</a></li> - <li><a href="#M000061">query_string_to_hash</a></li> - <li><a href="#M000060">query_to_hash</a></li> - <li><a href="#M000069">update_query_string</a></li> - <li><a href="#M000070">update_request_uri</a></li> + <li><a href="#M000105">cgi_escape</a></li> + <li><a href="#M000107">cgi_parse</a></li> + <li><a href="#M000106">cgi_unescape</a></li> + <li><a href="#M000109">chomp_query_string</a></li> + <li><a href="#M000100">decode</a></li> + <li><a href="#M000108">get_query_string</a></li> + <li><a href="#M000103">hash_to_query</a></li> + <li><a href="#M000104">hash_to_query_string</a></li> + <li><a href="#M000102">query_string_to_hash</a></li> + <li><a href="#M000101">query_to_hash</a></li> + <li><a href="#M000110">update_query_string</a></li> + <li><a href="#M000111">update_request_uri</a></li> </ul> <div class="sectiontitle">Classes and Modules</div> @@ -98,20 +98,20 @@ <div class="sectiontitle">Public Instance methods</div> <div class="method"> <div class="title"> - <a name="M000064"></a><b>cgi_escape</b>(string) + <a name="M000105"></a><b>cgi_escape</b>(string) </div> <div class="description"> <p> TODO: How does this compare to URI.escape? </p> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000064_source')" id="l_M000064_source">show source</a> ]</p> - <div id="M000064_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000105_source')" id="l_M000105_source">show source</a> ]</p> + <div id="M000105_source" class="dyn-source"> <pre> <span class="ruby-comment cmt"># File lib/lore/facets/uri.rb, line 109</span> <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cgi_escape</span>(<span class="ruby-identifier">string</span>) <span class="ruby-identifier">string</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/([^ a-zA-Z0-9_.-]+)/n</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-value str">'%'</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">$1</span>.<span class="ruby-identifier">unpack</span>(<span class="ruby-value str">'H2'</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">$1</span>.<span class="ruby-identifier">size</span>).<span class="ruby-identifier">join</span>(<span class="ruby-value str">'%'</span>).<span class="ruby-identifier">upcase</span> @@ -121,15 +121,15 @@ </div> </div> </div> <div class="method"> <div class="title"> - <a name="M000066"></a><b>cgi_parse</b>(query) + <a name="M000107"></a><b>cgi_parse</b>(query) </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000066_source')" id="l_M000066_source">show source</a> ]</p> - <div id="M000066_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000107_source')" id="l_M000107_source">show source</a> ]</p> + <div id="M000107_source" class="dyn-source"> <pre> <span class="ruby-comment cmt"># File lib/lore/facets/uri.rb, line 125</span> <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cgi_parse</span>(<span class="ruby-identifier">query</span>) <span class="ruby-identifier">params</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>([].<span class="ruby-identifier">freeze</span>) @@ -148,15 +148,15 @@ </div> </div> </div> <div class="method"> <div class="title"> - <a name="M000065"></a><b>cgi_unescape</b>(string) + <a name="M000106"></a><b>cgi_unescape</b>(string) </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000065_source')" id="l_M000065_source">show source</a> ]</p> - <div id="M000065_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000106_source')" id="l_M000106_source">show source</a> ]</p> + <div id="M000106_source" class="dyn-source"> <pre> <span class="ruby-comment cmt"># File lib/lore/facets/uri.rb, line 117</span> <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cgi_unescape</span>(<span class="ruby-identifier">string</span>) <span class="ruby-identifier">string</span>.<span class="ruby-identifier">tr</span>(<span class="ruby-value str">'+'</span>, <span class="ruby-value str">' '</span>).<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/((?:%[0-9a-fA-F]{2})+)/n</span>) <span class="ruby-keyword kw">do</span> [<span class="ruby-identifier">$1</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value str">'%'</span>)].<span class="ruby-identifier">pack</span>(<span class="ruby-value str">'H*'</span>) @@ -166,11 +166,11 @@ </div> </div> </div> <div class="method"> <div class="title"> - <a name="M000068"></a><b>chomp_query_string</b>(uri) + <a name="M000109"></a><b>chomp_query_string</b>(uri) </div> <div class="description"> <p> Removes the query string from a uri </p> @@ -180,12 +180,12 @@ <p> Output: the chomped uri. </p> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000068_source')" id="l_M000068_source">show source</a> ]</p> - <div id="M000068_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000109_source')" id="l_M000109_source">show source</a> ]</p> + <div id="M000109_source" class="dyn-source"> <pre> <span class="ruby-comment cmt"># File lib/lore/facets/uri.rb, line 169</span> <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">chomp_query_string</span>(<span class="ruby-identifier">uri</span>) <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">uri</span> <span class="ruby-identifier">query_string</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">get_query_string</span>(<span class="ruby-identifier">uri</span>) @@ -195,20 +195,20 @@ </div> </div> </div> <div class="method"> <div class="title"> - <a name="M000059"></a><b>decode</b>(uri) + <a name="M000100"></a><b>decode</b>(uri) </div> <div class="description"> <p> Decode the uri components. </p> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000059_source')" id="l_M000059_source">show source</a> ]</p> - <div id="M000059_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000100_source')" id="l_M000100_source">show source</a> ]</p> + <div id="M000100_source" class="dyn-source"> <pre> <span class="ruby-comment cmt"># File lib/lore/facets/uri.rb, line 33</span> <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">decode</span>(<span class="ruby-identifier">uri</span>) <span class="ruby-comment cmt"># gmosx: hmm is this needed?</span> <span class="ruby-comment cmt"># guard against invalid filenames for example pictures with</span> @@ -237,11 +237,11 @@ </div> </div> </div> <div class="method"> <div class="title"> - <a name="M000067"></a><b>get_query_string</b>(uri) + <a name="M000108"></a><b>get_query_string</b>(uri) </div> <div class="description"> <p> This method returns the query string of a uri </p> @@ -251,12 +251,12 @@ <p> Output: the query string. returns nil if no query string </p> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000067_source')" id="l_M000067_source">show source</a> ]</p> - <div id="M000067_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000108_source')" id="l_M000108_source">show source</a> ]</p> + <div id="M000108_source" class="dyn-source"> <pre> <span class="ruby-comment cmt"># File lib/lore/facets/uri.rb, line 149</span> <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_query_string</span>(<span class="ruby-identifier">uri</span>) <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">uri</span> <span class="ruby-comment cmt"># gmosx: INVESTIGATE ruby's URI seems to differently handle</span> @@ -272,11 +272,11 @@ </div> </div> </div> <div class="method"> <div class="title"> - <a name="M000062"></a><b>hash_to_query</b>(parameters) + <a name="M000103"></a><b>hash_to_query</b>(parameters) </div> <div class="description"> <p> Given a hash with parameter/value pairs construct a standard query string. </p> @@ -285,15 +285,15 @@ =&gt; &quot;a=1&amp;b=2&quot; </pre> </div> <div class="aka"> This method is also aliased as - <a href="URI.html#M000063">hash_to_query_string</a> + <a href="URI.html#M000104">hash_to_query_string</a> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000062_source')" id="l_M000062_source">show source</a> ]</p> - <div id="M000062_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000103_source')" id="l_M000103_source">show source</a> ]</p> + <div id="M000103_source" class="dyn-source"> <pre> <span class="ruby-comment cmt"># File lib/lore/facets/uri.rb, line 94</span> <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">hash_to_query</span>(<span class="ruby-identifier">parameters</span>) <span class="ruby-keyword kw">return</span> <span class="ruby-value str">''</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">parameters</span> <span class="ruby-identifier">pairs</span> = [] @@ -307,31 +307,31 @@ </div> </div> </div> <div class="method"> <div class="title"> - <a name="M000063"></a><b>hash_to_query_string</b>(parameters) + <a name="M000104"></a><b>hash_to_query_string</b>(parameters) </div> <div class="description"> <p> -Alias for <a href="URI.html#M000062">hash_to_query</a> +Alias for <a href="URI.html#M000103">hash_to_query</a> </p> </div> </div> <div class="method"> <div class="title"> - <a name="M000061"></a><b>query_string_to_hash</b>(query_string) + <a name="M000102"></a><b>query_string_to_hash</b>(query_string) </div> <div class="description"> <p> -Alias for <a href="URI.html#M000060">query_to_hash</a> +Alias for <a href="URI.html#M000101">query_to_hash</a> </p> </div> </div> <div class="method"> <div class="title"> - <a name="M000060"></a><b>query_to_hash</b>(query_string) + <a name="M000101"></a><b>query_to_hash</b>(query_string) </div> <div class="description"> <p> Extend the basic query string parser provided by the cgi module. converts single valued params (the most common case) to objects instead of arrays @@ -345,15 +345,15 @@ &quot;&quot;) returns an empty hash. </p> </div> <div class="aka"> This method is also aliased as - <a href="URI.html#M000061">query_string_to_hash</a> + <a href="URI.html#M000102">query_string_to_hash</a> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000060_source')" id="l_M000060_source">show source</a> ]</p> - <div id="M000060_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000101_source')" id="l_M000101_source">show source</a> ]</p> + <div id="M000101_source" class="dyn-source"> <pre> <span class="ruby-comment cmt"># File lib/lore/facets/uri.rb, line 70</span> <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">query_to_hash</span>(<span class="ruby-identifier">query_string</span>) <span class="ruby-keyword kw">return</span> {} <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">query_string</span> @@ -373,11 +373,11 @@ </div> </div> </div> <div class="method"> <div class="title"> - <a name="M000069"></a><b>update_query_string</b>(uri, parameters) + <a name="M000110"></a><b>update_query_string</b>(uri, parameters) </div> <div class="description"> <p> Get a uri and a hash of parameters. Inject the hash values as parameters in the query sting path. Returns the full uri. @@ -392,12 +392,12 @@ <p> TODO: optimize </p> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000069_source')" id="l_M000069_source">show source</a> ]</p> - <div id="M000069_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000110_source')" id="l_M000110_source">show source</a> ]</p> + <div id="M000110_source" class="dyn-source"> <pre> <span class="ruby-comment cmt"># File lib/lore/facets/uri.rb, line 188</span> <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">update_query_string</span>(<span class="ruby-identifier">uri</span>, <span class="ruby-identifier">parameters</span>) <span class="ruby-identifier">query_string</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">get_query_string</span>(<span class="ruby-identifier">uri</span>) <span class="ruby-identifier">rest</span> = <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">dup</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-node">/\?#{query_string}/</span>, <span class="ruby-value str">&quot;&quot;</span>) @@ -416,21 +416,21 @@ </div> </div> </div> <div class="method"> <div class="title"> - <a name="M000070"></a><b>update_request_uri</b>(request, parameters) + <a name="M000111"></a><b>update_request_uri</b>(request, parameters) </div> <div class="description"> <p> TODO: find a better name. Gets the request uri, injects extra parameters in the query string and returns a new uri. The request object is not modified. There is always a qs string so an extra test is skipped. </p> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000070_source')" id="l_M000070_source">show source</a> ]</p> - <div id="M000070_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000111_source')" id="l_M000111_source">show source</a> ]</p> + <div id="M000111_source" class="dyn-source"> <pre> <span class="ruby-comment cmt"># File lib/lore/facets/uri.rb, line 208</span> <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">update_request_uri</span>(<span class="ruby-identifier">request</span>, <span class="ruby-identifier">parameters</span>) <span class="ruby-identifier">hash</span> = <span class="ruby-identifier">request</span>.<span class="ruby-identifier">parameters</span>.<span class="ruby-identifier">dup</span>() <span class="ruby-identifier">hash</span>.<span class="ruby-identifier">update</span>(<span class="ruby-identifier">parameters</span>) \ No newline at end of file