Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autogen doc #67

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
460 changes: 460 additions & 0 deletions doc/BettyConfig.html

Large diffs are not rendered by default.

257 changes: 257 additions & 0 deletions doc/Count.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,257 @@
<!DOCTYPE html>

<html>
<head>
<meta charset="UTF-8">

<title>module Count - RDoc Documentation</title>

<link href="./fonts.css" rel="stylesheet">
<link href="./rdoc.css" rel="stylesheet">

<script type="text/javascript">
var rdoc_rel_prefix = "./";
</script>

<script src="./js/jquery.js"></script>
<script src="./js/navigation.js"></script>
<script src="./js/search_index.js"></script>
<script src="./js/search.js"></script>
<script src="./js/searcher.js"></script>
<script src="./js/darkfish.js"></script>


<body id="top" role="document" class="module">
<nav role="navigation">
<div id="project-navigation">
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
<h2>
<a href="./index.html" rel="home">Home</a>
</h2>

<div id="table-of-contents-navigation">
<a href="./table_of_contents.html#pages">Pages</a>
<a href="./table_of_contents.html#classes">Classes</a>
<a href="./table_of_contents.html#methods">Methods</a>
</div>
</div>

<div id="search-section" role="search" class="project-section initially-hidden">
<form action="#" method="get" accept-charset="utf-8">
<div id="search-field-wrapper">
<input id="search-field" role="combobox" aria-label="Search"
aria-autocomplete="list" aria-controls="search-results"
type="text" name="search" placeholder="Search" spellcheck="false"
title="Type to search, Up and Down to navigate, Enter to load">
</div>

<ul id="search-results" aria-label="Search Results"
aria-busy="false" aria-expanded="false"
aria-atomic="false" class="initially-hidden"></ul>
</form>
</div>

</div>



<div id="class-metadata">




<!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
<h3>Methods</h3>

<ul class="link-list" role="directory">

<li ><a href="#method-c-count_stuff">::count_stuff</a>

<li ><a href="#method-c-help">::help</a>

<li ><a href="#method-c-interpret">::interpret</a>

</ul>
</div>

</div>
</nav>

<main role="main" aria-labelledby="module-Count">
<h1 id="module-Count" class="module">
module Count
</h1>

<section class="description">

</section>




<section id="5Buntitled-5D" class="documentation-section">









<section id="public-class-5Buntitled-5D-method-details" class="method-section">
<header>
<h3>Public Class Methods</h3>
</header>


<div id="method-c-count_stuff" class="method-detail ">

<div class="method-heading">
<span class="method-name">count_stuff</span><span
class="method-args">(command)</span>

<span class="method-click-advice">click to toggle source</span>

</div>


<div class="method-description">






<div class="method-source-code" id="count_stuff-source">
<pre><span class="ruby-comment"># File lib/count.rb, line 2</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">count_stuff</span>(<span class="ruby-identifier">command</span>)
<span class="ruby-identifier">match</span> = <span class="ruby-identifier">command</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp">/^count\s+(?:the\s+)?(?:total\s+)?(?:number\s+of\s+)?(words?|lines?|char(?:acter)?s?)\s+in\s+(.+)$/i</span>) <span class="ruby-operator">||</span>
<span class="ruby-identifier">command</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp">/^how\s+many\s+(words?|lines?|char(?:acter)?s?)\s+are(?:\s+there)?\s+in\s+(.+)$/i</span>)

<span class="ruby-keyword">if</span> <span class="ruby-identifier">match</span>
<span class="ruby-identifier">what</span> = <span class="ruby-identifier">match</span>[<span class="ruby-value">1</span>].<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">downcase</span>
<span class="ruby-identifier">where</span> = <span class="ruby-identifier">match</span>[<span class="ruby-value">2</span>].<span class="ruby-identifier">strip</span>
<span class="ruby-identifier">is_this_directory</span> = <span class="ruby-identifier">where</span> <span class="ruby-operator">==</span> <span class="ruby-string">&#39;.&#39;</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">where</span>.<span class="ruby-identifier">downcase</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp">/^(this\s+)?(?:dir(?:ectory)|folder|path)?$/</span>)

<span class="ruby-identifier">flag</span> = <span class="ruby-keyword">nil</span>
<span class="ruby-keyword">if</span> <span class="ruby-identifier">what</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;word&quot;</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">what</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;words&quot;</span>
<span class="ruby-identifier">what</span> = <span class="ruby-string">&quot;words&quot;</span>
<span class="ruby-identifier">flag</span> = <span class="ruby-string">&quot;w&quot;</span>
<span class="ruby-keyword">elsif</span> <span class="ruby-identifier">what</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;line&quot;</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">what</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;lines&quot;</span>
<span class="ruby-identifier">what</span> = <span class="ruby-string">&quot;lines&quot;</span>
<span class="ruby-identifier">flag</span> = <span class="ruby-string">&quot;l&quot;</span>
<span class="ruby-keyword">elsif</span> [<span class="ruby-string">&quot;char&quot;</span>, <span class="ruby-string">&quot;chars&quot;</span>, <span class="ruby-string">&quot;character&quot;</span>, <span class="ruby-string">&quot;characters&quot;</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">what</span>)
<span class="ruby-identifier">what</span> = <span class="ruby-string">&quot;characters&quot;</span>
<span class="ruby-identifier">flag</span> = <span class="ruby-string">&quot;c&quot;</span>
<span class="ruby-keyword">end</span>

{
<span class="ruby-value">:command</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-node">&quot;find #{ is_this_directory ? &#39;.&#39; : where } -type f -exec wc -#{ flag } \{\} \\; | awk &#39;{total += $1} END {print total}&#39;&quot;</span>,
<span class="ruby-value">:explanation</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-node">&quot;Counts the total number of #{ what } in #{ is_this_directory ? &#39;all the files in the current directory, including subdirectories&#39; : where }.&quot;</span>
}
<span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
</div>

</div>




</div>


<div id="method-c-help" class="method-detail ">

<div class="method-heading">
<span class="method-name">help</span><span
class="method-args">()</span>

<span class="method-click-advice">click to toggle source</span>

</div>


<div class="method-description">






<div class="method-source-code" id="help-source">
<pre><span class="ruby-comment"># File lib/count.rb, line 39</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">help</span>
<span class="ruby-identifier">commands</span> = []
<span class="ruby-identifier">commands</span> <span class="ruby-operator">&lt;&lt;</span> {
<span class="ruby-value">:category</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">&quot;Count&quot;</span>,
<span class="ruby-value">:description</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">&#39;\033[34mCount\033[0m&#39;</span>,
<span class="ruby-value">:usage</span> =<span class="ruby-operator">&gt;</span> [<span class="ruby-string">&quot;- betty how many words are in this directory&quot;</span>,
<span class="ruby-string">&quot;- betty how many characters are in myfile.py&quot;</span>,
<span class="ruby-string">&quot;- betty count lines in this folder&quot;</span>,
<span class="ruby-string">&quot;(Note that there&#39;re many ways to say more or less the same thing.)&quot;</span>]
}
<span class="ruby-identifier">commands</span>
<span class="ruby-keyword">end</span></pre>
</div>

</div>




</div>


<div id="method-c-interpret" class="method-detail ">

<div class="method-heading">
<span class="method-name">interpret</span><span
class="method-args">(command)</span>

<span class="method-click-advice">click to toggle source</span>

</div>


<div class="method-description">






<div class="method-source-code" id="interpret-source">
<pre><span class="ruby-comment"># File lib/count.rb, line 30</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">interpret</span>(<span class="ruby-identifier">command</span>)
<span class="ruby-identifier">responses</span> = []

<span class="ruby-identifier">count_stuff_command</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">count_stuff</span>(<span class="ruby-identifier">command</span>)
<span class="ruby-identifier">responses</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">count_stuff_command</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">count_stuff_command</span>

<span class="ruby-identifier">responses</span>
<span class="ruby-keyword">end</span></pre>
</div>

</div>




</div>


</section>

</section>
</main>


<footer id="validator-badges" role="contentinfo">
<p><a href="http://validator.w3.org/check/referer">Validate</a>
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.1.
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
</footer>

Loading