doc/rdoc/core/classes/Dir.html in facets-2.4.2 vs doc/rdoc/core/classes/Dir.html in facets-2.4.3

- old
+ new

@@ -87,35 +87,35 @@ <div class="sectiontitle">Methods</div> <ul> - <li><a href="#M000056">ascend</a></li> - <li><a href="#M000063">ascend</a></li> - <li><a href="#M000064">descend</a></li> - <li><a href="#M000057">descend</a></li> - <li><a href="#M000068">ls_r</a></li> - <li><a href="#M000061">ls_r</a></li> - <li><a href="#M000058">multiglob</a></li> - <li><a href="#M000065">multiglob</a></li> - <li><a href="#M000066">multiglob_r</a></li> - <li><a href="#M000059">multiglob_r</a></li> - <li><a href="#M000062">parent?</a></li> - <li><a href="#M000069">parent?</a></li> - <li><a href="#M000067">recurse</a></li> - <li><a href="#M000060">recurse</a></li> + <li><a href="#M000054">ascend</a></li> + <li><a href="#M000061">ascend</a></li> + <li><a href="#M000062">descend</a></li> + <li><a href="#M000055">descend</a></li> + <li><a href="#M000066">ls_r</a></li> + <li><a href="#M000059">ls_r</a></li> + <li><a href="#M000056">multiglob</a></li> + <li><a href="#M000063">multiglob</a></li> + <li><a href="#M000064">multiglob_r</a></li> + <li><a href="#M000057">multiglob_r</a></li> + <li><a href="#M000060">parent?</a></li> + <li><a href="#M000067">parent?</a></li> + <li><a href="#M000065">recurse</a></li> + <li><a href="#M000058">recurse</a></li> </ul> <div class="sectiontitle">Public Class methods</div> <div class="method"> <div class="title"> - <a name="M000056"></a><b>ascend</b>(dir, inclusive=true, &amp;blk) + <a name="M000054"></a><b>ascend</b>(dir, inclusive=true, &amp;blk) </div> <div class="description"> <p> Ascend a directory path. </p> @@ -135,12 +135,12 @@ CREDIT: Daniel Berger CREDIT: Jeffrey Schwab </pre> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000056_source')" id="l_M000056_source">show source</a> ]</p> - <div id="M000056_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000054_source')" id="l_M000054_source">show source</a> ]</p> + <div id="M000054_source" class="dyn-source"> <pre> <span class="ruby-comment cmt"># File lib/core/facets/dir/ascend.rb, line 20</span> <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">ascend</span>(<span class="ruby-identifier">dir</span>, <span class="ruby-identifier">inclusive</span>=<span class="ruby-keyword kw">true</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">blk</span>) <span class="ruby-identifier">dir</span> = <span class="ruby-identifier">dir</span>.<span class="ruby-identifier">dup</span> <span class="ruby-identifier">blk</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">dir</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">inclusive</span> @@ -158,11 +158,11 @@ </div> </div> </div> <div class="method"> <div class="title"> - <a name="M000063"></a><b>ascend</b>(dir, inclusive=true, &amp;blk) + <a name="M000061"></a><b>ascend</b>(dir, inclusive=true, &amp;blk) </div> <div class="description"> <p> Ascend a directory path. </p> @@ -182,12 +182,12 @@ CREDIT: Daniel Berger CREDIT: Jeffrey Schwab </pre> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000063_source')" id="l_M000063_source">show source</a> ]</p> - <div id="M000063_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000061_source')" id="l_M000061_source">show source</a> ]</p> + <div id="M000061_source" class="dyn-source"> <pre> <span class="ruby-comment cmt"># File lib/core/facets/dir/ascend.rb, line 20</span> <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">ascend</span>(<span class="ruby-identifier">dir</span>, <span class="ruby-identifier">inclusive</span>=<span class="ruby-keyword kw">true</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">blk</span>) <span class="ruby-identifier">dir</span> = <span class="ruby-identifier">dir</span>.<span class="ruby-identifier">dup</span> <span class="ruby-identifier">blk</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">dir</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">inclusive</span> @@ -205,11 +205,11 @@ </div> </div> </div> <div class="method"> <div class="title"> - <a name="M000064"></a><b>descend</b>(path) {|| ...} + <a name="M000062"></a><b>descend</b>(path) {|| ...} </div> <div class="description"> <p> Descend a directory path. </p> @@ -229,12 +229,12 @@ CREDIT: Daniel Berger CREDIT: Jeffrey Schwab </pre> </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('M000062_source')" id="l_M000062_source">show source</a> ]</p> + <div id="M000062_source" class="dyn-source"> <pre> <span class="ruby-comment cmt"># File lib/core/facets/dir/ascend.rb, line 49</span> <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">descend</span>(<span class="ruby-identifier">path</span>) <span class="ruby-comment cmt">#:yield:</span> <span class="ruby-identifier">paths</span> = <span class="ruby-identifier">path</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">'/'</span>) <span class="ruby-identifier">paths</span>.<span class="ruby-identifier">size</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">n</span><span class="ruby-operator">|</span> @@ -247,11 +247,11 @@ </div> </div> </div> <div class="method"> <div class="title"> - <a name="M000057"></a><b>descend</b>(path) {|| ...} + <a name="M000055"></a><b>descend</b>(path) {|| ...} </div> <div class="description"> <p> Descend a directory path. </p> @@ -271,12 +271,12 @@ CREDIT: Daniel Berger CREDIT: Jeffrey Schwab </pre> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000057_source')" id="l_M000057_source">show source</a> ]</p> - <div id="M000057_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000055_source')" id="l_M000055_source">show source</a> ]</p> + <div id="M000055_source" class="dyn-source"> <pre> <span class="ruby-comment cmt"># File lib/core/facets/dir/ascend.rb, line 49</span> <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">descend</span>(<span class="ruby-identifier">path</span>) <span class="ruby-comment cmt">#:yield:</span> <span class="ruby-identifier">paths</span> = <span class="ruby-identifier">path</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">'/'</span>) <span class="ruby-identifier">paths</span>.<span class="ruby-identifier">size</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">n</span><span class="ruby-operator">|</span> @@ -289,20 +289,20 @@ </div> </div> </div> <div class="method"> <div class="title"> - <a name="M000068"></a><b>ls_r</b>(path='.', &amp;block) + <a name="M000066"></a><b>ls_r</b>(path='.', &amp;block) </div> <div class="description"> <p> -Same as <a href="Dir.html#M000060">Dir#recurse</a>. +Same as <a href="Dir.html#M000058">Dir#recurse</a>. </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('M000066_source')" id="l_M000066_source">show source</a> ]</p> + <div id="M000066_source" class="dyn-source"> <pre> <span class="ruby-comment cmt"># File lib/core/facets/dir/recurse.rb, line 24</span> <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">ls_r</span>(<span class="ruby-identifier">path</span>=<span class="ruby-value str">'.'</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) <span class="ruby-identifier">recurse</span>(<span class="ruby-identifier">path</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) <span class="ruby-keyword kw">end</span> @@ -310,20 +310,20 @@ </div> </div> </div> <div class="method"> <div class="title"> - <a name="M000061"></a><b>ls_r</b>(path='.', &amp;block) + <a name="M000059"></a><b>ls_r</b>(path='.', &amp;block) </div> <div class="description"> <p> -Same as <a href="Dir.html#M000060">Dir#recurse</a>. +Same as <a href="Dir.html#M000058">Dir#recurse</a>. </p> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000061_source')" id="l_M000061_source">show source</a> ]</p> - <div id="M000061_source" class="dyn-source"> + <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"> <pre> <span class="ruby-comment cmt"># File lib/core/facets/dir/recurse.rb, line 24</span> <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">ls_r</span>(<span class="ruby-identifier">path</span>=<span class="ruby-value str">'.'</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) <span class="ruby-identifier">recurse</span>(<span class="ruby-identifier">path</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) <span class="ruby-keyword kw">end</span> @@ -331,32 +331,32 @@ </div> </div> </div> <div class="method"> <div class="title"> - <a name="M000058"></a><b>multiglob</b>(*patterns) + <a name="M000056"></a><b>multiglob</b>(*patterns) </div> <div class="description"> <p> Like <tt>glob</tt> but can take multiple patterns. </p> <pre> Dir.multiglob( '*.rb', '*.py' ) </pre> <p> -Rather then constants for options <a href="Dir.html#M000058">multiglob</a> +Rather then constants for options <a href="Dir.html#M000056">multiglob</a> accepts a trailing options hash of symbol keys. </p> <pre> :noescape File::FNM_NOESCAPE :casefold File::FNM_CASEFOLD :pathname File::FNM_PATHNAME :dotmatch File::FNM_DOTMATCH :strict File::FNM_PATHNAME &amp;&amp; File::FNM_DOTMATCH </pre> <p> -It also has an option for <a href="Dir.html#M000060">recurse</a>. +It also has an option for <a href="Dir.html#M000058">recurse</a>. </p> <pre> :recurse Recurively include contents of directories. </pre> <p> @@ -371,12 +371,12 @@ <pre> Dir.multiglob('**/*') </pre> </div> <div class="sourcecode"> - <p class="source-link">[ <a href="javascript:toggleSource('M000058_source')" id="l_M000058_source">show source</a> ]</p> - <div id="M000058_source" class="dyn-source"> + <p class="source-link">[ <a href="javascript:toggleSource('M000056_source')" id="l_M000056_source">show source</a> ]</p> + <div id="M000056_source" class="dyn-source"> <pre> <span class="ruby-comment cmt"># File lib/core/facets/dir/multiglob.rb, line 41</span> <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">multiglob</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">patterns</span>) <span class="ruby-identifier">options</span> = (<span class="ruby-constant">Hash</span> <span class="ruby-operator">===</span> <span class="ruby-identifier">patterns</span>.<span class="ruby-identifier">last</span> <span class="ruby-value">? </span><span class="ruby-identifier">patterns</span>.<span class="ruby-identifier">pop</span> <span class="ruby-operator">:</span> {}) @@ -406,32 +406,32 @@ </div> </div> </div> <div class="method"> <div class="title"> - <a name="M000065"></a><b>multiglob</b>(*patterns) + <a name="M000063"></a><b>multiglob</b>(*patterns) </div> <div class="description"> <p> Like <tt>glob</tt> but can take multiple patterns. </p> <pre> Dir.multiglob( '*.rb', '*.py' ) </pre> <p> -Rather then constants for options <a href="Dir.html#M000058">multiglob</a> +Rather then constants for options <a href="Dir.html#M000056">multiglob</a> accepts a trailing options hash of symbol keys. </p> <pre> :noescape File::FNM_NOESCAPE :casefold File::FNM_CASEFOLD :pathname File::FNM_PATHNAME :dotmatch File::FNM_DOTMATCH :strict File::FNM_PATHNAME &amp;&amp; File::FNM_DOTMATCH </pre> <p> -It also has an option for <a href="Dir.html#M000060">recurse</a>. +It also has an option for <a href="Dir.html#M000058">recurse</a>. </p> <pre> :recurse Recurively include contents of directories. </pre> <p> @@ -446,12 +446,12 @@ <pre> Dir.multiglob('**/*') </pre> </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('M000063_source')" id="l_M000063_source">show source</a> ]</p> + <div id="M000063_source" class="dyn-source"> <pre> <span class="ruby-comment cmt"># File lib/core/facets/dir/multiglob.rb, line 41</span> <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">multiglob</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">patterns</span>) <span class="ruby-identifier">options</span> = (<span class="ruby-constant">Hash</span> <span class="ruby-operator">===</span> <span class="ruby-identifier">patterns</span>.<span class="ruby-identifier">last</span> <span class="ruby-value">? </span><span class="ruby-identifier">patterns</span>.<span class="ruby-identifier">pop</span> <span class="ruby-operator">:</span> {}) @@ -481,15 +481,15 @@ </div> </div> </div> <div class="method"> <div class="title"> - <a name="M000066"></a><b>multiglob_r</b>(*patterns) + <a name="M000064"></a><b>multiglob_r</b>(*patterns) </div> <div class="description"> <p> -The same as <tt><a href="Dir.html#M000058">multiglob</a></tt>, but +The same as <tt><a href="Dir.html#M000056">multiglob</a></tt>, but recusively includes directories. </p> <pre> Dir.multiglob_r( 'folder' ) </pre> @@ -505,12 +505,12 @@ <pre> Dir.multiglob( 'folder', 'folder/**/**' ) </pre> </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('M000064_source')" id="l_M000064_source">show source</a> ]</p> + <div id="M000064_source" class="dyn-source"> <pre> <span class="ruby-comment cmt"># File lib/core/facets/dir/multiglob.rb, line 80</span> <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">multiglob_r</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">patterns</span>) <span class="ruby-identifier">options</span> = (<span class="ruby-constant">Hash</span> <span class="ruby-operator">===</span> <span class="ruby-identifier">patterns</span>.<span class="ruby-identifier">last</span> <span class="ruby-value">? </span><span class="ruby-identifier">patterns</span>.<span class="ruby-identifier">pop</span> <span class="ruby-operator">:</span> {}) <span class="ruby-identifier">matches</span> = <span class="ruby-identifier">multiglob</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">patterns</span>) @@ -526,15 +526,15 @@ </div> </div> </div> <div class="method"> <div class="title"> - <a name="M000059"></a><b>multiglob_r</b>(*patterns) + <a name="M000057"></a><b>multiglob_r</b>(*patterns) </div> <div class="description"> <p> -The same as <tt><a href="Dir.html#M000058">multiglob</a></tt>, but +The same as <tt><a href="Dir.html#M000056">multiglob</a></tt>, but recusively includes directories. </p> <pre> Dir.multiglob_r( 'folder' ) </pre> @@ -550,12 +550,12 @@ <pre> Dir.multiglob( 'folder', 'folder/**/**' ) </pre> </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('M000057_source')" id="l_M000057_source">show source</a> ]</p> + <div id="M000057_source" class="dyn-source"> <pre> <span class="ruby-comment cmt"># File lib/core/facets/dir/multiglob.rb, line 80</span> <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">multiglob_r</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">patterns</span>) <span class="ruby-identifier">options</span> = (<span class="ruby-constant">Hash</span> <span class="ruby-operator">===</span> <span class="ruby-identifier">patterns</span>.<span class="ruby-identifier">last</span> <span class="ruby-value">? </span><span class="ruby-identifier">patterns</span>.<span class="ruby-identifier">pop</span> <span class="ruby-operator">:</span> {}) <span class="ruby-identifier">matches</span> = <span class="ruby-identifier">multiglob</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">patterns</span>) @@ -571,23 +571,23 @@ </div> </div> </div> <div class="method"> <div class="title"> - <a name="M000062"></a><b>parent?</b>(parent_path, child_path) + <a name="M000060"></a><b>parent?</b>(parent_path, child_path) </div> <div class="description"> <p> Is a path parental to another? </p> <p> TODO: Needs improvement. TODO: Instance version? </p> </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('M000060_source')" id="l_M000060_source">show source</a> ]</p> + <div id="M000060_source" class="dyn-source"> <pre> <span class="ruby-comment cmt"># File lib/core/facets/dir/parent.rb, line 8</span> <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">parent?</span>(<span class="ruby-identifier">parent_path</span>, <span class="ruby-identifier">child_path</span>) <span class="ruby-node">%r|^#{Regexp.escape(parent_path)}|</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">child_path</span> <span class="ruby-keyword kw">end</span> @@ -595,23 +595,23 @@ </div> </div> </div> <div class="method"> <div class="title"> - <a name="M000069"></a><b>parent?</b>(parent_path, child_path) + <a name="M000067"></a><b>parent?</b>(parent_path, child_path) </div> <div class="description"> <p> Is a path parental to another? </p> <p> TODO: Needs improvement. TODO: Instance version? </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('M000067_source')" id="l_M000067_source">show source</a> ]</p> + <div id="M000067_source" class="dyn-source"> <pre> <span class="ruby-comment cmt"># File lib/core/facets/dir/parent.rb, line 8</span> <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">parent?</span>(<span class="ruby-identifier">parent_path</span>, <span class="ruby-identifier">child_path</span>) <span class="ruby-node">%r|^#{Regexp.escape(parent_path)}|</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">child_path</span> <span class="ruby-keyword kw">end</span> @@ -619,23 +619,23 @@ </div> </div> </div> <div class="method"> <div class="title"> - <a name="M000067"></a><b>recurse</b>(path='.', &amp;block) + <a name="M000065"></a><b>recurse</b>(path='.', &amp;block) </div> <div class="description"> <p> Recursively scan a directory and pass each file to the given block. </p> <pre> CREDIT: George Moschovitis </pre> </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('M000065_source')" id="l_M000065_source">show source</a> ]</p> + <div id="M000065_source" class="dyn-source"> <pre> <span class="ruby-comment cmt"># File lib/core/facets/dir/recurse.rb, line 8</span> <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">recurse</span>(<span class="ruby-identifier">path</span>=<span class="ruby-value str">'.'</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) <span class="ruby-identifier">list</span> = [] <span class="ruby-identifier">stoplist</span> = [<span class="ruby-value str">'.'</span>, <span class="ruby-value str">'..'</span>] @@ -654,22 +654,22 @@ </div> </div> </div> <div class="method"> <div class="title"> - <a name="M000060"></a><b>recurse</b>(path='.', &amp;block) + <a name="M000058"></a><b>recurse</b>(path='.', &amp;block) </div> <div class="description"> <p> Recursively scan a directory and pass each file to the given block. </p> <pre> CREDIT: George Moschovitis </pre> </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('M000058_source')" id="l_M000058_source">show source</a> ]</p> + <div id="M000058_source" class="dyn-source"> <pre> <span class="ruby-comment cmt"># File lib/core/facets/dir/recurse.rb, line 8</span> <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">recurse</span>(<span class="ruby-identifier">path</span>=<span class="ruby-value str">'.'</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) <span class="ruby-identifier">list</span> = [] <span class="ruby-identifier">stoplist</span> = [<span class="ruby-value str">'.'</span>, <span class="ruby-value str">'..'</span>] \ No newline at end of file