Skip to content
Browse files

use autogenerated rdoc from rdoc.info

  • Loading branch information...
1 parent fec498e commit 371af8d0249ee83aeb647ba457efcec2df4ae333 Gabriel Gilder committed
Showing with 4 additions and 6,219 deletions.
  1. +3 −2 .gitignore
  2. +0 −119 doc/classes/Array.html
  3. +0 −97 doc/classes/Blank.html
  4. +0 −101 doc/classes/Commander.html
  5. +0 −449 doc/classes/Commander/Command.html
  6. +0 −257 doc/classes/Commander/Command/Options.html
  7. +0 −81 doc/classes/Commander/HelpFormatter.html
  8. +0 −158 doc/classes/Commander/HelpFormatter/Base.html
  9. +0 −162 doc/classes/Commander/HelpFormatter/Terminal.html
  10. +0 −101 doc/classes/Commander/HelpFormatter/TerminalCompact.html
  11. +0 −653 doc/classes/Commander/Runner.html
  12. +0 −60 doc/classes/Commander/Runner/CommandError.html
  13. +0 −60 doc/classes/Commander/Runner/InvalidCommandError.html
  14. +0 −799 doc/classes/Commander/UI.html
  15. +0 −104 doc/classes/Commander/UI/AskForClass.html
  16. +0 −621 doc/classes/Commander/UI/ProgressBar.html
  17. +0 −133 doc/classes/Object.html
  18. +0 −16 doc/created.rid
  19. +0 −278 doc/css/main.css
  20. +0 −383 doc/css/panel.css
  21. +0 −53 doc/css/reset.css
  22. +0 −59 doc/files/lib/commander/blank_rb.html
  23. +0 −70 doc/files/lib/commander/command_rb.html
  24. +0 −59 doc/files/lib/commander/core_ext/array_rb.html
  25. +0 −59 doc/files/lib/commander/core_ext/object_rb.html
  26. +0 −61 doc/files/lib/commander/core_ext_rb.html
  27. +0 −63 doc/files/lib/commander/help_formatters/base_rb.html
  28. +0 −70 doc/files/lib/commander/help_formatters/terminal_compact_rb.html
  29. +0 −70 doc/files/lib/commander/help_formatters/terminal_rb.html
  30. +0 −61 doc/files/lib/commander/help_formatters_rb.html
  31. +0 −72 doc/files/lib/commander/runner_rb.html
  32. +0 −72 doc/files/lib/commander/user_interaction_rb.html
  33. +0 −59 doc/files/lib/commander/version_rb.html
  34. BIN doc/i/arrows.png
  35. BIN doc/i/results_bg.png
  36. BIN doc/i/tree_bg.png
  37. +0 −14 doc/index.html
  38. +0 −19 doc/js/jquery-1.3.2.min.js
  39. +0 −22 doc/js/main.js
  40. +0 −628 doc/js/searchdoc.js
  41. +0 −71 doc/panel/index.html
  42. +0 −1 doc/panel/search_index.js
  43. +0 −1 doc/panel/tree.js
  44. +1 −1 index.html
View
5 .gitignore
@@ -1,3 +1,4 @@
-doc
-test
+/doc
+/test
+/pkg
/.rvmrc
View
119 doc/classes/Array.html
@@ -1,119 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
- <title>Array</title>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <link rel="stylesheet" href="../css/reset.css" type="text/css" media="screen" />
- <link rel="stylesheet" href="../css/main.css" type="text/css" media="screen" />
- <script src="../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
- <script src="../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
- <script src="../js/main.js" type="text/javascript" charset="utf-8"></script>
-</head>
-
-<body>
- <div class="banner">
- <h1>
- <span class="type">Class</span>
- Array
-
- <span class="parent">&lt;
-
- <a href="Object.html">Object</a>
-
- </span>
-
- </h1>
- <ul class="files">
-
- <li><a href="../files/lib/commander/core_ext/array_rb.html">lib/commander/core_ext/array.rb</a></li>
-
- </ul>
- </div>
- <div id="bodyContent">
- <div id="content">
-
-
-
-
-
-
-
-
-
- <div class="sectiontitle">Methods</div>
- <dl class="methods">
-
- <dt>P</dt>
- <dd>
- <ul>
-
- <li><a href="#method-c-parse">parse</a></li>
-
- </ul>
- </dd>
-
- </dl>
-
-
-
-
-
-
-
-
-
-
-
-
-
- <div class="sectiontitle">Class Public methods</div>
-
- <div class="method">
- <div class="title" id="method-c-parse">
-
- <a name="method-c-parse"></a><b>parse</b>(string)
-
- </div>
-
- <div class="description">
-
-<p>Split <em>string</em> into an array. Used in conjunction with Highline’s
-ask, or ask_for_array methods, which must respond to parse.</p>
-
-<p>This method allows escaping of whitespace. For example the arguments foo
-bar\ baz will become [‘foo’, ‘bar baz’]</p>
-
-<h3>Example</h3>
-
-<pre># ask invokes Array#parse
-list = ask 'Favorite cookies:', Array
-
-# or use ask_for_CLASS
-list = ask_for_array 'Favorite cookies: '</pre>
-
- </div>
-
-
-
-
- <div class="sourcecode">
- <p class="source-link">
- Source: <a href="javascript:toggleSource('method-c-parse_source')" id="l_method-c-parse_source">show</a>
-
- </p>
- <div id="method-c-parse_source" class="dyn-source">
- <pre><span class="ruby-comment"># File lib/commander/core_ext/array.rb, line 21</span>
-<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">parse</span> <span class="ruby-identifier">string</span>
- <span class="ruby-identifier">eval</span> <span class="ruby-node">&quot;%w(#{string})&quot;</span>
-<span class="ruby-keyword">end</span></pre>
- </div>
- </div>
-
- </div>
-
-</div>
- </div>
- </body>
-</html>
View
97 doc/classes/Blank.html
@@ -1,97 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
- <title>Blank</title>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <link rel="stylesheet" href="../css/reset.css" type="text/css" media="screen" />
- <link rel="stylesheet" href="../css/main.css" type="text/css" media="screen" />
- <script src="../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
- <script src="../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
- <script src="../js/main.js" type="text/javascript" charset="utf-8"></script>
-</head>
-
-<body>
- <div class="banner">
- <h1>
- <span class="type">Module</span>
- Blank
-
- </h1>
- <ul class="files">
-
- <li><a href="../files/lib/commander/blank_rb.html">lib/commander/blank.rb</a></li>
-
- </ul>
- </div>
- <div id="bodyContent">
- <div id="content">
-
-
-
-
-
-
-
-
-
- <div class="sectiontitle">Methods</div>
- <dl class="methods">
-
- <dt>I</dt>
- <dd>
- <ul>
-
- <li><a href="#method-c-included">included</a></li>
-
- </ul>
- </dd>
-
- </dl>
-
-
-
-
-
-
-
-
-
-
-
-
-
- <div class="sectiontitle">Class Public methods</div>
-
- <div class="method">
- <div class="title" id="method-c-included">
-
- <a name="method-c-included"></a><b>included</b>(base)
-
- </div>
-
-
-
-
- <div class="sourcecode">
- <p class="source-link">
- Source: <a href="javascript:toggleSource('method-c-included_source')" id="l_method-c-included_source">show</a>
-
- </p>
- <div id="method-c-included_source" class="dyn-source">
- <pre><span class="ruby-comment"># File lib/commander/blank.rb, line 3</span>
-<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">included</span> <span class="ruby-identifier">base</span>
- <span class="ruby-identifier">base</span>.<span class="ruby-identifier">class_eval</span> <span class="ruby-keyword">do</span>
- <span class="ruby-identifier">instance_methods</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">m</span><span class="ruby-operator">|</span> <span class="ruby-identifier">undef_method</span> <span class="ruby-identifier">m</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">m</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/^__|object_id/</span> }
- <span class="ruby-keyword">end</span>
-<span class="ruby-keyword">end</span></pre>
- </div>
- </div>
-
- </div>
-
-</div>
- </div>
- </body>
-</html>
View
101 doc/classes/Commander.html
@@ -1,101 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
- <title>Commander</title>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <link rel="stylesheet" href="../css/reset.css" type="text/css" media="screen" />
- <link rel="stylesheet" href="../css/main.css" type="text/css" media="screen" />
- <script src="../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
- <script src="../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
- <script src="../js/main.js" type="text/javascript" charset="utf-8"></script>
-</head>
-
-<body>
- <div class="banner">
- <h1>
- <span class="type">Module</span>
- Commander
-
- </h1>
- <ul class="files">
-
- <li><a href="../files/lib/commander/command_rb.html">lib/commander/command.rb</a></li>
-
- <li><a href="../files/lib/commander/delegates_rb.html">lib/commander/delegates.rb</a></li>
-
- <li><a href="../files/lib/commander/help_formatters/base_rb.html">lib/commander/help_formatters/base.rb</a></li>
-
- <li><a href="../files/lib/commander/help_formatters/terminal_rb.html">lib/commander/help_formatters/terminal.rb</a></li>
-
- <li><a href="../files/lib/commander/help_formatters/terminal_compact_rb.html">lib/commander/help_formatters/terminal_compact.rb</a></li>
-
- <li><a href="../files/lib/commander/help_formatters_rb.html">lib/commander/help_formatters.rb</a></li>
-
- <li><a href="../files/lib/commander/platform_rb.html">lib/commander/platform.rb</a></li>
-
- <li><a href="../files/lib/commander/runner_rb.html">lib/commander/runner.rb</a></li>
-
- <li><a href="../files/lib/commander/user_interaction_rb.html">lib/commander/user_interaction.rb</a></li>
-
- <li><a href="../files/lib/commander/version_rb.html">lib/commander/version.rb</a></li>
-
- </ul>
- </div>
- <div id="bodyContent">
- <div id="content">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <div class="sectiontitle">Classes and Modules</div>
- <ul>
-
- <li><span class="type">MODULE</span> <a href="Commander/Delegates.html">Commander::Delegates</a></li>
-
- <li><span class="type">MODULE</span> <a href="Commander/HelpFormatter.html">Commander::HelpFormatter</a></li>
-
- <li><span class="type">MODULE</span> <a href="Commander/Platform.html">Commander::Platform</a></li>
-
- <li><span class="type">MODULE</span> <a href="Commander/UI.html">Commander::UI</a></li>
-
- <li><span class="type">CLASS</span> <a href="Commander/Command.html">Commander::Command</a></li>
-
- <li><span class="type">CLASS</span> <a href="Commander/Runner.html">Commander::Runner</a></li>
-
- </ul>
-
-
-
- <div class="sectiontitle">Constants</div>
- <table border='0' cellpadding='5'>
-
- <tr valign='top'>
- <td class="attr-name">VERSION</td>
- <td>=</td>
- <td class="attr-value">'4.0.5'</td>
- </tr>
-
-
- </table>
-
-
-
-
-
-</div>
- </div>
- </body>
-</html>
View
449 doc/classes/Commander/Command.html
@@ -1,449 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
- <title>Commander::Command</title>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <link rel="stylesheet" href="../../css/reset.css" type="text/css" media="screen" />
- <link rel="stylesheet" href="../../css/main.css" type="text/css" media="screen" />
- <script src="../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
- <script src="../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
- <script src="../../js/main.js" type="text/javascript" charset="utf-8"></script>
-</head>
-
-<body>
- <div class="banner">
- <h1>
- <span class="type">Class</span>
- Commander::Command
-
- <span class="parent">&lt;
-
- <a href="../Object.html">Object</a>
-
- </span>
-
- </h1>
- <ul class="files">
-
- <li><a href="../../files/lib/commander/command_rb.html">lib/commander/command.rb</a></li>
-
- </ul>
- </div>
- <div id="bodyContent">
- <div id="content">
-
-
-
-
-
-
-
-
-
- <div class="sectiontitle">Methods</div>
- <dl class="methods">
-
- <dt>A</dt>
- <dd>
- <ul>
-
- <li><a href="#method-i-action">action</a></li>
-
- </ul>
- </dd>
-
- <dt>E</dt>
- <dd>
- <ul>
-
- <li><a href="#method-i-example">example</a></li>
-
- </ul>
- </dd>
-
- <dt>N</dt>
- <dd>
- <ul>
-
- <li><a href="#method-c-new">new</a></li>
-
- </ul>
- </dd>
-
- <dt>O</dt>
- <dd>
- <ul>
-
- <li><a href="#method-i-option">option</a></li>
-
- </ul>
- </dd>
-
- <dt>R</dt>
- <dd>
- <ul>
-
- <li><a href="#method-i-run">run</a></li>
-
- </ul>
- </dd>
-
- <dt>W</dt>
- <dd>
- <ul>
-
- <li><a href="#method-i-when_called">when_called</a></li>
-
- </ul>
- </dd>
-
- </dl>
-
-
-
-
-
-
-
- <div class="sectiontitle">Classes and Modules</div>
- <ul>
-
- <li><span class="type">CLASS</span> <a href="Command/Options.html">Commander::Command::Options</a></li>
-
- </ul>
-
-
-
-
-
- <div class="sectiontitle">Attributes</div>
- <table border='0' cellpadding='5'>
-
- <tr valign='top'>
- <td class='attr-rw'>
- [RW]
- </td>
- <td class='attr-name'>name</td>
- <td class='attr-desc'></td>
- </tr>
-
- <tr valign='top'>
- <td class='attr-rw'>
- [RW]
- </td>
- <td class='attr-name'>examples</td>
- <td class='attr-desc'></td>
- </tr>
-
- <tr valign='top'>
- <td class='attr-rw'>
- [RW]
- </td>
- <td class='attr-name'>syntax</td>
- <td class='attr-desc'></td>
- </tr>
-
- <tr valign='top'>
- <td class='attr-rw'>
- [RW]
- </td>
- <td class='attr-name'>description</td>
- <td class='attr-desc'></td>
- </tr>
-
- <tr valign='top'>
- <td class='attr-rw'>
- [RW]
- </td>
- <td class='attr-name'>summary</td>
- <td class='attr-desc'></td>
- </tr>
-
- <tr valign='top'>
- <td class='attr-rw'>
- [RW]
- </td>
- <td class='attr-name'>proxy_options</td>
- <td class='attr-desc'></td>
- </tr>
-
- <tr valign='top'>
- <td class='attr-rw'>
- [RW]
- </td>
- <td class='attr-name'>options</td>
- <td class='attr-desc'></td>
- </tr>
-
- </table>
-
-
-
- <div class="sectiontitle">Class Public methods</div>
-
- <div class="method">
- <div class="title" id="method-c-new">
-
- <a name="method-c-new"></a><b>new</b>(name)
-
- </div>
-
- <div class="description">
-
-<p>Initialize new command with specified <em>name</em>.</p>
-
- </div>
-
-
-
-
- <div class="sourcecode">
- <p class="source-link">
- Source: <a href="javascript:toggleSource('method-c-new_source')" id="l_method-c-new_source">show</a>
-
- </p>
- <div id="method-c-new_source" class="dyn-source">
- <pre><span class="ruby-comment"># File lib/commander/command.rb, line 40</span>
-<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span> <span class="ruby-identifier">name</span>
- <span class="ruby-ivar">@name</span>, <span class="ruby-ivar">@examples</span>, <span class="ruby-ivar">@when_called</span> = <span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_s</span>, [], []
- <span class="ruby-ivar">@options</span>, <span class="ruby-ivar">@proxy_options</span> = [], []
-<span class="ruby-keyword">end</span></pre>
- </div>
- </div>
-
- </div>
-
- <div class="sectiontitle">Instance Public methods</div>
-
- <div class="method">
- <div class="title" id="method-i-action">
-
- <a name="method-i-action"></a><b>action</b>(*args, &amp;block)
-
- </div>
-
-
-
- </div>
-
- <div class="method">
- <div class="title" id="method-i-example">
-
- <a name="method-i-example"></a><b>example</b>(description, command)
-
- </div>
-
- <div class="description">
-
-<p>Add a usage example for this command.</p>
-
-<p>Usage examples are later displayed in help documentation created by the
-help formatters.</p>
-
-<h3>Examples</h3>
-
-<pre>command :something do |c|
- c.example &quot;Should do something&quot;, &quot;my_command something&quot;
-end</pre>
-
- </div>
-
-
-
-
- <div class="sourcecode">
- <p class="source-link">
- Source: <a href="javascript:toggleSource('method-i-example_source')" id="l_method-i-example_source">show</a>
-
- </p>
- <div id="method-i-example_source" class="dyn-source">
- <pre><span class="ruby-comment"># File lib/commander/command.rb, line 58</span>
-<span class="ruby-keyword">def</span> <span class="ruby-identifier">example</span> <span class="ruby-identifier">description</span>, <span class="ruby-identifier">command</span>
- <span class="ruby-ivar">@examples</span> <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-identifier">description</span>, <span class="ruby-identifier">command</span>]
-<span class="ruby-keyword">end</span></pre>
- </div>
- </div>
-
- </div>
-
- <div class="method">
- <div class="title" id="method-i-option">
-
- <a name="method-i-option"></a><b>option</b>(*args, &amp;block)
-
- </div>
-
- <div class="description">
-
-<p>Add an option.</p>
-
-<p><a href="Command/Options.html">Options</a> are parsed via OptionParser so
-view it for additional usage documentation. A block may optionally be
-passed to handle the option, otherwise the <em>options</em> struct seen
-below contains the results of this option. This handles common formats
-such as:</p>
-
-<pre>-h, --help options.help # =&gt; bool
---[no-]feature options.feature # =&gt; bool
---large-switch options.large_switch # =&gt; bool
---file FILE options.file # =&gt; file passed
---list WORDS options.list # =&gt; array
---date [DATE] options.date # =&gt; date or nil when optional argument not set</pre>
-
-<h3>Examples</h3>
-
-<pre>command :something do |c|
- c.option '--recursive', 'Do something recursively'
- c.option '--file FILE', 'Specify a file'
- c.option('--info', 'Display info') { puts &quot;handle with block&quot; }
- c.option '--[no-]feature', 'With or without feature'
- c.option '--list FILES', Array, 'List the files specified'
-
- c.when_called do |args, options|
- do_something_recursively if options.recursive
- do_something_with_file options.file if options.file
- end
-end</pre>
-
-<h3>Help Formatters</h3>
-
-<p>This method also parses the arguments passed in order to determine which
-were switches, and which were descriptions for the option which can later
-be used within help formatters using option[:switches] and
-option[:description].</p>
-
-<h3>Input Parsing</h3>
-
-<p>Since <a href="../Commander.html">Commander</a> utilizes OptionParser you
-can pre-parse and evaluate option arguments. Simply require
-‘optparse/time’, or ‘optparse/date’, as these objects must respond
-to parse.</p>
-
-<pre>c.option '--time TIME', Time
-c.option '--date [DATE]', Date</pre>
-
- </div>
-
-
-
-
- <div class="sourcecode">
- <p class="source-link">
- Source: <a href="javascript:toggleSource('method-i-option_source')" id="l_method-i-option_source">show</a>
-
- </p>
- <div id="method-i-option_source" class="dyn-source">
- <pre><span class="ruby-comment"># File lib/commander/command.rb, line 109</span>
-<span class="ruby-keyword">def</span> <span class="ruby-identifier">option</span> *<span class="ruby-identifier">args</span>, &amp;<span class="ruby-identifier">block</span>
- <span class="ruby-identifier">switches</span>, <span class="ruby-identifier">description</span> = <span class="ruby-constant">Runner</span>.<span class="ruby-identifier">separate_switches_from_description</span> *<span class="ruby-identifier">args</span>
- <span class="ruby-identifier">proc</span> = <span class="ruby-identifier">block</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">option_proc</span>(<span class="ruby-identifier">switches</span>)
- <span class="ruby-ivar">@options</span> <span class="ruby-operator">&lt;&lt;</span> {
- <span class="ruby-value">:args</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">args</span>,
- <span class="ruby-value">:proc</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">proc</span>,
- <span class="ruby-value">:switches</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">switches</span>,
- <span class="ruby-value">:description</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">description</span>,
- }
-<span class="ruby-keyword">end</span></pre>
- </div>
- </div>
-
- </div>
-
- <div class="method">
- <div class="title" id="method-i-run">
-
- <a name="method-i-run"></a><b>run</b>(*args)
-
- </div>
-
- <div class="description">
-
-<p>Run the command with <em>args</em>.</p>
-<ul><li>
-<p>parses options, call option blocks</p>
-</li><li>
-<p>invokes <a href="Command.html#method-i-when_called">when_called</a> proc</p>
-</li></ul>
-
- </div>
-
-
-
-
- <div class="sourcecode">
- <p class="source-link">
- Source: <a href="javascript:toggleSource('method-i-run_source')" id="l_method-i-run_source">show</a>
-
- </p>
- <div id="method-i-run_source" class="dyn-source">
- <pre><span class="ruby-comment"># File lib/commander/command.rb, line 154</span>
-<span class="ruby-keyword">def</span> <span class="ruby-identifier">run</span> *<span class="ruby-identifier">args</span>
- <span class="ruby-identifier">call</span> <span class="ruby-identifier">parse_options_and_call_procs</span>(*<span class="ruby-identifier">args</span>)
-<span class="ruby-keyword">end</span></pre>
- </div>
- </div>
-
- </div>
-
- <div class="method">
- <div class="title" id="method-i-when_called">
-
- <a name="method-i-when_called"></a><b>when_called</b>(*args, &amp;block)
-
- </div>
-
- <div class="description">
-
-<p>Handle execution of command. The handler may be a class, object, or block
-(see examples below).</p>
-
-<h3>Examples</h3>
-
-<pre># Simple block handling
-c.when_called do |args, options|
- # do something
-end
-
-# Create inst of Something and pass args / options
-c.when_called MyLib::Command::Something
-
-# Create inst of Something and use arbitrary method
- c.when_called MyLib::Command::Something, :some_method
-
-# Pass an object to handle callback (requires method symbol)
-c.when_called SomeObject, :some_method</pre>
-
- </div>
-
-
- <div class="aka">
- This method is also aliased as
-
- <a href="Command.html#method-i-action">action</a>
-
- </div>
-
-
-
- <div class="sourcecode">
- <p class="source-link">
- Source: <a href="javascript:toggleSource('method-i-when_called_source')" id="l_method-i-when_called_source">show</a>
-
- </p>
- <div id="method-i-when_called_source" class="dyn-source">
- <pre><span class="ruby-comment"># File lib/commander/command.rb, line 141</span>
-<span class="ruby-keyword">def</span> <span class="ruby-identifier">when_called</span> *<span class="ruby-identifier">args</span>, &amp;<span class="ruby-identifier">block</span>
- <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-string">'must pass an object, class, or block.'</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-keyword">and</span> <span class="ruby-operator">!</span><span class="ruby-identifier">block</span>
- <span class="ruby-ivar">@when_called</span> = <span class="ruby-identifier">block</span> <span class="ruby-operator">?</span> [<span class="ruby-identifier">block</span>] <span class="ruby-operator">:</span> <span class="ruby-identifier">args</span>
-<span class="ruby-keyword">end</span></pre>
- </div>
- </div>
-
- </div>
-
-</div>
- </div>
- </body>
-</html>
View
257 doc/classes/Commander/Command/Options.html
@@ -1,257 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
- <title>Commander::Command::Options</title>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <link rel="stylesheet" href="../../../css/reset.css" type="text/css" media="screen" />
- <link rel="stylesheet" href="../../../css/main.css" type="text/css" media="screen" />
- <script src="../../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
- <script src="../../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
- <script src="../../../js/main.js" type="text/javascript" charset="utf-8"></script>
-</head>
-
-<body>
- <div class="banner">
- <h1>
- <span class="type">Class</span>
- Commander::Command::Options
-
- <span class="parent">&lt;
-
- <a href="../../Object.html">Object</a>
-
- </span>
-
- </h1>
- <ul class="files">
-
- <li><a href="../../../files/lib/commander/command_rb.html">lib/commander/command.rb</a></li>
-
- </ul>
- </div>
- <div id="bodyContent">
- <div id="content">
-
- <div class="description">
-
-<p><a href="Options.html">Options</a> struct.</p>
-
- </div>
-
-
-
-
-
-
-
-
-
- <div class="sectiontitle">Methods</div>
- <dl class="methods">
-
- <dt>#</dt>
- <dd>
- <ul>
-
- <li><a href="#method-i-__hash__">__hash__</a></li>
-
- </ul>
- </dd>
-
- <dt>D</dt>
- <dd>
- <ul>
-
- <li><a href="#method-i-default">default</a></li>
-
- </ul>
- </dd>
-
- <dt>I</dt>
- <dd>
- <ul>
-
- <li><a href="#method-i-inspect">inspect</a></li>
-
- </ul>
- </dd>
-
- <dt>M</dt>
- <dd>
- <ul>
-
- <li><a href="#method-i-method_missing">method_missing</a></li>
-
- </ul>
- </dd>
-
- <dt>N</dt>
- <dd>
- <ul>
-
- <li><a href="#method-c-new">new</a></li>
-
- </ul>
- </dd>
-
- </dl>
-
-
-
- <div class="sectiontitle">Included Modules</div>
- <ul>
-
- <li>
-
- <a href="../../Blank.html">Blank</a>
-
- START:includes
- </li>
-
- </ul>
-
-
-
-
-
-
-
-
-
-
-
- <div class="sectiontitle">Class Public methods</div>
-
- <div class="method">
- <div class="title" id="method-c-new">
-
- <a name="method-c-new"></a><b>new</b>()
-
- </div>
-
-
-
-
- <div class="sourcecode">
- <p class="source-link">
- Source: <a href="javascript:toggleSource('method-c-new_source')" id="l_method-c-new_source">show</a>
-
- </p>
- <div id="method-c-new_source" class="dyn-source">
- <pre><span class="ruby-comment"># File lib/commander/command.rb, line 16</span>
-<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>
- <span class="ruby-ivar">@table</span> = {}
-<span class="ruby-keyword">end</span></pre>
- </div>
- </div>
-
- </div>
-
- <div class="sectiontitle">Instance Public methods</div>
-
- <div class="method">
- <div class="title" id="method-i-__hash__">
-
- <a name="method-i-__hash__"></a><b>__hash__</b>()
-
- </div>
-
-
-
-
- <div class="sourcecode">
- <p class="source-link">
- Source: <a href="javascript:toggleSource('method-i-__hash___source')" id="l_method-i-__hash___source">show</a>
-
- </p>
- <div id="method-i-__hash___source" class="dyn-source">
- <pre><span class="ruby-comment"># File lib/commander/command.rb, line 20</span>
-<span class="ruby-keyword">def</span> <span class="ruby-identifier">__hash__</span>
- <span class="ruby-ivar">@table</span>
-<span class="ruby-keyword">end</span></pre>
- </div>
- </div>
-
- </div>
-
- <div class="method">
- <div class="title" id="method-i-default">
-
- <a name="method-i-default"></a><b>default</b>(defaults = {})
-
- </div>
-
-
-
-
- <div class="sourcecode">
- <p class="source-link">
- Source: <a href="javascript:toggleSource('method-i-default_source')" id="l_method-i-default_source">show</a>
-
- </p>
- <div id="method-i-default_source" class="dyn-source">
- <pre><span class="ruby-comment"># File lib/commander/command.rb, line 28</span>
-<span class="ruby-keyword">def</span> <span class="ruby-identifier">default</span> <span class="ruby-identifier">defaults</span> = {}
- <span class="ruby-ivar">@table</span> = <span class="ruby-identifier">defaults</span>.<span class="ruby-identifier">merge!</span> <span class="ruby-ivar">@table</span>
-<span class="ruby-keyword">end</span></pre>
- </div>
- </div>
-
- </div>
-
- <div class="method">
- <div class="title" id="method-i-inspect">
-
- <a name="method-i-inspect"></a><b>inspect</b>()
-
- </div>
-
-
-
-
- <div class="sourcecode">
- <p class="source-link">
- Source: <a href="javascript:toggleSource('method-i-inspect_source')" id="l_method-i-inspect_source">show</a>
-
- </p>
- <div id="method-i-inspect_source" class="dyn-source">
- <pre><span class="ruby-comment"># File lib/commander/command.rb, line 32</span>
-<span class="ruby-keyword">def</span> <span class="ruby-identifier">inspect</span>
- <span class="ruby-node">&quot;&lt;Commander::Command::Options #{ __hash__.map { |k,v| &quot;#{k}=#{v.inspect}&quot; }.join(', ') }&gt;&quot;</span>
-<span class="ruby-keyword">end</span></pre>
- </div>
- </div>
-
- </div>
-
- <div class="method">
- <div class="title" id="method-i-method_missing">
-
- <a name="method-i-method_missing"></a><b>method_missing</b>(meth, *args, &amp;block)
-
- </div>
-
-
-
-
- <div class="sourcecode">
- <p class="source-link">
- Source: <a href="javascript:toggleSource('method-i-method_missing_source')" id="l_method-i-method_missing_source">show</a>
-
- </p>
- <div id="method-i-method_missing_source" class="dyn-source">
- <pre><span class="ruby-comment"># File lib/commander/command.rb, line 24</span>
-<span class="ruby-keyword">def</span> <span class="ruby-identifier">method_missing</span> <span class="ruby-identifier">meth</span>, *<span class="ruby-identifier">args</span>, &amp;<span class="ruby-identifier">block</span>
- <span class="ruby-identifier">meth</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/=$/</span> <span class="ruby-operator">?</span> <span class="ruby-ivar">@table</span>[<span class="ruby-identifier">meth</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">chop</span>.<span class="ruby-identifier">to_sym</span>] = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">first</span> <span class="ruby-operator">:</span> <span class="ruby-ivar">@table</span>[<span class="ruby-identifier">meth</span>]
-<span class="ruby-keyword">end</span></pre>
- </div>
- </div>
-
- </div>
-
-</div>
- </div>
- </body>
-</html>
View
81 doc/classes/Commander/HelpFormatter.html
@@ -1,81 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
- <title>Commander::HelpFormatter</title>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <link rel="stylesheet" href="../../css/reset.css" type="text/css" media="screen" />
- <link rel="stylesheet" href="../../css/main.css" type="text/css" media="screen" />
- <script src="../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
- <script src="../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
- <script src="../../js/main.js" type="text/javascript" charset="utf-8"></script>
-</head>
-
-<body>
- <div class="banner">
- <h1>
- <span class="type">Module</span>
- Commander::HelpFormatter
-
- </h1>
- <ul class="files">
-
- <li><a href="../../files/lib/commander/help_formatters/base_rb.html">lib/commander/help_formatters/base.rb</a></li>
-
- <li><a href="../../files/lib/commander/help_formatters/terminal_rb.html">lib/commander/help_formatters/terminal.rb</a></li>
-
- <li><a href="../../files/lib/commander/help_formatters/terminal_compact_rb.html">lib/commander/help_formatters/terminal_compact.rb</a></li>
-
- <li><a href="../../files/lib/commander/help_formatters_rb.html">lib/commander/help_formatters.rb</a></li>
-
- </ul>
- </div>
- <div id="bodyContent">
- <div id="content">
-
- <div class="description">
-
-<h1>Help Formatter</h1>
-
-<p>Commander’s help formatters control the output when either the help
-command, or –help switch are called. The default formatter is <a
-href="HelpFormatter/Terminal.html">Commander::HelpFormatter::Terminal</a>.</p>
-
- </div>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <div class="sectiontitle">Classes and Modules</div>
- <ul>
-
- <li><span class="type">CLASS</span> <a href="HelpFormatter/Base.html">Commander::HelpFormatter::Base</a></li>
-
- <li><span class="type">CLASS</span> <a href="HelpFormatter/Terminal.html">Commander::HelpFormatter::Terminal</a></li>
-
- <li><span class="type">CLASS</span> <a href="HelpFormatter/TerminalCompact.html">Commander::HelpFormatter::TerminalCompact</a></li>
-
- </ul>
-
-
-
-
-
-
-
-</div>
- </div>
- </body>
-</html>
View
158 doc/classes/Commander/HelpFormatter/Base.html
@@ -1,158 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
- <title>Commander::HelpFormatter::Base</title>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <link rel="stylesheet" href="../../../css/reset.css" type="text/css" media="screen" />
- <link rel="stylesheet" href="../../../css/main.css" type="text/css" media="screen" />
- <script src="../../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
- <script src="../../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
- <script src="../../../js/main.js" type="text/javascript" charset="utf-8"></script>
-</head>
-
-<body>
- <div class="banner">
- <h1>
- <span class="type">Class</span>
- Commander::HelpFormatter::Base
-
- <span class="parent">&lt;
-
- <a href="../../Object.html">Object</a>
-
- </span>
-
- </h1>
- <ul class="files">
-
- <li><a href="../../../files/lib/commander/help_formatters/base_rb.html">lib/commander/help_formatters/base.rb</a></li>
-
- </ul>
- </div>
- <div id="bodyContent">
- <div id="content">
-
-
-
-
-
-
-
-
-
- <div class="sectiontitle">Methods</div>
- <dl class="methods">
-
- <dt>N</dt>
- <dd>
- <ul>
-
- <li><a href="#method-c-new">new</a></li>
-
- </ul>
- </dd>
-
- <dt>R</dt>
- <dd>
- <ul>
-
- <li><a href="#method-i-render">render</a>,</li>
-
- <li><a href="#method-i-render_command">render_command</a></li>
-
- </ul>
- </dd>
-
- </dl>
-
-
-
-
-
-
-
-
-
-
-
-
-
- <div class="sectiontitle">Class Public methods</div>
-
- <div class="method">
- <div class="title" id="method-c-new">
-
- <a name="method-c-new"></a><b>new</b>(runner;)
-
- </div>
-
-
-
-
- <div class="sourcecode">
- <p class="source-link">
- Source: <a href="javascript:toggleSource('method-c-new_source')" id="l_method-c-new_source">show</a>
-
- </p>
- <div id="method-c-new_source" class="dyn-source">
- <pre><span class="ruby-comment"># File lib/commander/help_formatters/base.rb, line 13</span>
-<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span> <span class="ruby-identifier">runner</span>; <span class="ruby-ivar">@runner</span> = <span class="ruby-identifier">runner</span> <span class="ruby-keyword">end</span></pre>
- </div>
- </div>
-
- </div>
-
- <div class="sectiontitle">Instance Public methods</div>
-
- <div class="method">
- <div class="title" id="method-i-render">
-
- <a name="method-i-render"></a><b>render</b>()
-
- </div>
-
-
-
-
- <div class="sourcecode">
- <p class="source-link">
- Source: <a href="javascript:toggleSource('method-i-render_source')" id="l_method-i-render_source">show</a>
-
- </p>
- <div id="method-i-render_source" class="dyn-source">
- <pre><span class="ruby-comment"># File lib/commander/help_formatters/base.rb, line 14</span>
-<span class="ruby-keyword">def</span> <span class="ruby-identifier">render</span>; <span class="ruby-string">'Implement global help here'</span> <span class="ruby-keyword">end</span></pre>
- </div>
- </div>
-
- </div>
-
- <div class="method">
- <div class="title" id="method-i-render_command">
-
- <a name="method-i-render_command"></a><b>render_command</b>(command;)
-
- </div>
-
-
-
-
- <div class="sourcecode">
- <p class="source-link">
- Source: <a href="javascript:toggleSource('method-i-render_command_source')" id="l_method-i-render_command_source">show</a>
-
- </p>
- <div id="method-i-render_command_source" class="dyn-source">
- <pre><span class="ruby-comment"># File lib/commander/help_formatters/base.rb, line 15</span>
-<span class="ruby-keyword">def</span> <span class="ruby-identifier">render_command</span> <span class="ruby-identifier">command</span>; <span class="ruby-node">&quot;Implement help for #{command.name} here&quot;</span> <span class="ruby-keyword">end</span></pre>
- </div>
- </div>
-
- </div>
-
-</div>
- </div>
- </body>
-</html>
View
162 doc/classes/Commander/HelpFormatter/Terminal.html
@@ -1,162 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
- <title>Commander::HelpFormatter::Terminal</title>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <link rel="stylesheet" href="../../../css/reset.css" type="text/css" media="screen" />
- <link rel="stylesheet" href="../../../css/main.css" type="text/css" media="screen" />
- <script src="../../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
- <script src="../../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
- <script src="../../../js/main.js" type="text/javascript" charset="utf-8"></script>
-</head>
-
-<body>
- <div class="banner">
- <h1>
- <span class="type">Class</span>
- Commander::HelpFormatter::Terminal
-
- <span class="parent">&lt;
-
- <a href="Base.html">Commander::HelpFormatter::Base</a>
-
- </span>
-
- </h1>
- <ul class="files">
-
- <li><a href="../../../files/lib/commander/help_formatters/terminal_rb.html">lib/commander/help_formatters/terminal.rb</a></li>
-
- </ul>
- </div>
- <div id="bodyContent">
- <div id="content">
-
-
-
-
-
-
-
-
-
- <div class="sectiontitle">Methods</div>
- <dl class="methods">
-
- <dt>R</dt>
- <dd>
- <ul>
-
- <li><a href="#method-i-render">render</a>,</li>
-
- <li><a href="#method-i-render_command">render_command</a></li>
-
- </ul>
- </dd>
-
- <dt>T</dt>
- <dd>
- <ul>
-
- <li><a href="#method-i-template">template</a></li>
-
- </ul>
- </dd>
-
- </dl>
-
-
-
-
-
-
-
-
-
-
-
-
-
- <div class="sectiontitle">Instance Public methods</div>
-
- <div class="method">
- <div class="title" id="method-i-render">
-
- <a name="method-i-render"></a><b>render</b>()
-
- </div>
-
-
-
-
- <div class="sourcecode">
- <p class="source-link">
- Source: <a href="javascript:toggleSource('method-i-render_source')" id="l_method-i-render_source">show</a>
-
- </p>
- <div id="method-i-render_source" class="dyn-source">
- <pre><span class="ruby-comment"># File lib/commander/help_formatters/terminal.rb, line 7</span>
-<span class="ruby-keyword">def</span> <span class="ruby-identifier">render</span>
- <span class="ruby-identifier">template</span>(<span class="ruby-value">:help</span>).<span class="ruby-identifier">result</span> <span class="ruby-ivar">@runner</span>.<span class="ruby-identifier">get_binding</span>
-<span class="ruby-keyword">end</span></pre>
- </div>
- </div>
-
- </div>
-
- <div class="method">
- <div class="title" id="method-i-render_command">
-
- <a name="method-i-render_command"></a><b>render_command</b>(command)
-
- </div>
-
-
-
-
- <div class="sourcecode">
- <p class="source-link">
- Source: <a href="javascript:toggleSource('method-i-render_command_source')" id="l_method-i-render_command_source">show</a>
-
- </p>
- <div id="method-i-render_command_source" class="dyn-source">
- <pre><span class="ruby-comment"># File lib/commander/help_formatters/terminal.rb, line 11</span>
-<span class="ruby-keyword">def</span> <span class="ruby-identifier">render_command</span> <span class="ruby-identifier">command</span>
- <span class="ruby-identifier">template</span>(<span class="ruby-value">:command_help</span>).<span class="ruby-identifier">result</span> <span class="ruby-identifier">command</span>.<span class="ruby-identifier">get_binding</span>
-<span class="ruby-keyword">end</span></pre>
- </div>
- </div>
-
- </div>
-
- <div class="method">
- <div class="title" id="method-i-template">
-
- <a name="method-i-template"></a><b>template</b>(name)
-
- </div>
-
-
-
-
- <div class="sourcecode">
- <p class="source-link">
- Source: <a href="javascript:toggleSource('method-i-template_source')" id="l_method-i-template_source">show</a>
-
- </p>
- <div id="method-i-template_source" class="dyn-source">
- <pre><span class="ruby-comment"># File lib/commander/help_formatters/terminal.rb, line 15</span>
-<span class="ruby-keyword">def</span> <span class="ruby-identifier">template</span> <span class="ruby-identifier">name</span>
- <span class="ruby-constant">ERB</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-keyword">__FILE__</span>), <span class="ruby-string">'terminal'</span>, <span class="ruby-node">&quot;#{name}.erb&quot;</span>)), <span class="ruby-keyword">nil</span>, <span class="ruby-string">'-'</span>)
-<span class="ruby-keyword">end</span></pre>
- </div>
- </div>
-
- </div>
-
-</div>
- </div>
- </body>
-</html>
View
101 doc/classes/Commander/HelpFormatter/TerminalCompact.html
@@ -1,101 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
- <title>Commander::HelpFormatter::TerminalCompact</title>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <link rel="stylesheet" href="../../../css/reset.css" type="text/css" media="screen" />
- <link rel="stylesheet" href="../../../css/main.css" type="text/css" media="screen" />
- <script src="../../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
- <script src="../../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
- <script src="../../../js/main.js" type="text/javascript" charset="utf-8"></script>
-</head>
-
-<body>
- <div class="banner">
- <h1>
- <span class="type">Class</span>
- Commander::HelpFormatter::TerminalCompact
-
- <span class="parent">&lt;
-
- <a href="Terminal.html">Commander::HelpFormatter::Terminal</a>
-
- </span>
-
- </h1>
- <ul class="files">
-
- <li><a href="../../../files/lib/commander/help_formatters/terminal_compact_rb.html">lib/commander/help_formatters/terminal_compact.rb</a></li>
-
- </ul>
- </div>
- <div id="bodyContent">
- <div id="content">
-
-
-
-
-
-
-
-
-
- <div class="sectiontitle">Methods</div>
- <dl class="methods">
-
- <dt>T</dt>
- <dd>
- <ul>
-
- <li><a href="#method-i-template">template</a></li>
-
- </ul>
- </dd>
-
- </dl>
-
-
-
-
-
-
-
-
-
-
-
-
-
- <div class="sectiontitle">Instance Public methods</div>
-
- <div class="method">
- <div class="title" id="method-i-template">
-
- <a name="method-i-template"></a><b>template</b>(name)
-
- </div>
-
-
-
-
- <div class="sourcecode">
- <p class="source-link">
- Source: <a href="javascript:toggleSource('method-i-template_source')" id="l_method-i-template_source">show</a>
-
- </p>
- <div id="method-i-template_source" class="dyn-source">
- <pre><span class="ruby-comment"># File lib/commander/help_formatters/terminal_compact.rb, line 7</span>
-<span class="ruby-keyword">def</span> <span class="ruby-identifier">template</span> <span class="ruby-identifier">name</span>
- <span class="ruby-constant">ERB</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-keyword">__FILE__</span>), <span class="ruby-string">'terminal_compact'</span>, <span class="ruby-node">&quot;#{name}.erb&quot;</span>)), <span class="ruby-keyword">nil</span>, <span class="ruby-string">'-'</span>)
-<span class="ruby-keyword">end</span></pre>
- </div>
- </div>
-
- </div>
-
-</div>
- </div>
- </body>
-</html>
View
653 doc/classes/Commander/Runner.html
@@ -1,653 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
- <title>Commander::Runner</title>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <link rel="stylesheet" href="../../css/reset.css" type="text/css" media="screen" />
- <link rel="stylesheet" href="../../css/main.css" type="text/css" media="screen" />
- <script src="../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
- <script src="../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
- <script src="../../js/main.js" type="text/javascript" charset="utf-8"></script>
-</head>
-
-<body>
- <div class="banner">
- <h1>
- <span class="type">Class</span>
- Commander::Runner
-
- <span class="parent">&lt;
-
- <a href="../Object.html">Object</a>
-
- </span>
-
- </h1>
- <ul class="files">
-
- <li><a href="../../files/lib/commander/runner_rb.html">lib/commander/runner.rb</a></li>
-
- </ul>
- </div>
- <div id="bodyContent">
- <div id="content">
-
-
-
-
-
-
-
-
-
- <div class="sectiontitle">Methods</div>
- <dl class="methods">
-
- <dt>A</dt>
- <dd>
- <ul>
-
- <li><a href="#method-i-add_command">add_command</a>,</li>
-
- <li><a href="#method-i-alias-3F">alias?</a>,</li>
-
- <li><a href="#method-i-alias_command">alias_command</a></li>
-
- </ul>
- </dd>
-
- <dt>C</dt>
- <dd>
- <ul>
-
- <li><a href="#method-i-command">command</a>,</li>
-
- <li><a href="#method-i-command_exists-3F">command_exists?</a></li>
-
- </ul>
- </dd>
-
- <dt>D</dt>
- <dd>
- <ul>
-
- <li><a href="#method-i-default_command">default_command</a></li>
-
- </ul>
- </dd>
-
- <dt>G</dt>
- <dd>
- <ul>
-
- <li><a href="#method-i-global_option">global_option</a></li>
-
- </ul>
- </dd>
-
- <dt>I</dt>
- <dd>
- <ul>
-
- <li><a href="#method-c-instance">instance</a></li>
-
- </ul>
- </dd>
-
- <dt>N</dt>
- <dd>
- <ul>
-
- <li><a href="#method-c-new">new</a></li>
-
- </ul>
- </dd>
-
- <dt>P</dt>
- <dd>
- <ul>
-
- <li><a href="#method-i-program">program</a></li>
-
- </ul>
- </dd>
-
- <dt>R</dt>
- <dd>
- <ul>
-
- <li><a href="#method-i-run-21">run!</a></li>
-
- </ul>
- </dd>
-
- <dt>V</dt>
- <dd>
- <ul>
-
- <li><a href="#method-i-version">version</a></li>
-
- </ul>
- </dd>
-
- </dl>
-
-
-
-
-
-
-
- <div class="sectiontitle">Classes and Modules</div>
- <ul>
-
- <li><span class="type">CLASS</span> <a href="Runner/CommandError.html">Commander::Runner::CommandError</a></li>
-
- <li><span class="type">CLASS</span> <a href="Runner/InvalidCommandError.html">Commander::Runner::InvalidCommandError</a></li>
-
- </ul>
-
-
-
-
-
- <div class="sectiontitle">Attributes</div>
- <table border='0' cellpadding='5'>
-
- <tr valign='top'>
- <td class='attr-rw'>
- [R]
- </td>
- <td class='attr-name'>commands</td>
- <td class='attr-desc'><p><a href="../Array.html">Array</a> of commands.</p></td>
- </tr>
-
- <tr valign='top'>
- <td class='attr-rw'>
- [R]
- </td>
- <td class='attr-name'>options</td>
- <td class='attr-desc'><p>Global options.</p></td>
- </tr>
-
- <tr valign='top'>
- <td class='attr-rw'>
- [R]
- </td>
- <td class='attr-name'>help_formatter_aliases</td>
- <td class='attr-desc'><p>Hash of help formatter aliases.</p></td>
- </tr>
-
- </table>
-
-
-
- <div class="sectiontitle">Class Public methods</div>
-
- <div class="method">
- <div class="title" id="method-c-instance">
-
- <a name="method-c-instance"></a><b>instance</b>()
-
- </div>
-
- <div class="description">
-
-<p>Return singleton <a href="Runner.html">Runner</a> instance.</p>
-
- </div>
-
-
-
-
- <div class="sourcecode">
- <p class="source-link">
- Source: <a href="javascript:toggleSource('method-c-instance_source')" id="l_method-c-instance_source">show</a>
-
- </p>
- <div id="method-c-instance_source" class="dyn-source">
- <pre><span class="ruby-comment"># File lib/commander/runner.rb, line 43</span>
-<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">instance</span>
- <span class="ruby-ivar">@singleton</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">new</span>
-<span class="ruby-keyword">end</span></pre>
- </div>
- </div>
-
- </div>
-
- <div class="method">
- <div class="title" id="method-c-new">
-
- <a name="method-c-new"></a><b>new</b>(args = ARGV)
-
- </div>
-
- <div class="description">
-
-<p>Initialize a new command runner. Optionally supplying <em>args</em> for
-mocking, or arbitrary usage.</p>
-
- </div>
-
-
-
-
- <div class="sourcecode">
- <p class="source-link">
- Source: <a href="javascript:toggleSource('method-c-new_source')" id="l_method-c-new_source">show</a>
-
- </p>
- <div id="method-c-new_source" class="dyn-source">
- <pre><span class="ruby-comment"># File lib/commander/runner.rb, line 33</span>
-<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span> <span class="ruby-identifier">args</span> = <span class="ruby-constant">ARGV</span>
- <span class="ruby-ivar">@args</span>, <span class="ruby-ivar">@commands</span>, <span class="ruby-ivar">@aliases</span>, <span class="ruby-ivar">@options</span> = <span class="ruby-identifier">args</span>, {}, {}, []
- <span class="ruby-ivar">@help_formatter_aliases</span> = <span class="ruby-identifier">help_formatter_alias_defaults</span>
- <span class="ruby-ivar">@program</span> = <span class="ruby-identifier">program_defaults</span>
- <span class="ruby-identifier">create_default_commands</span>
-<span class="ruby-keyword">end</span></pre>
- </div>
- </div>
-
- </div>
-
- <div class="sectiontitle">Instance Public methods</div>
-
- <div class="method">
- <div class="title" id="method-i-add_command">
-
- <a name="method-i-add_command"></a><b>add_command</b>(command)
-
- </div>
-
- <div class="description">
-
-<p>Add a command object to this runner.</p>
-
- </div>
-
-
-
-
- <div class="sourcecode">
- <p class="source-link">
- Source: <a href="javascript:toggleSource('method-i-add_command_source')" id="l_method-i-add_command_source">show</a>
-
- </p>
- <div id="method-i-add_command_source" class="dyn-source">
- <pre><span class="ruby-comment"># File lib/commander/runner.rb, line 182</span>
-<span class="ruby-keyword">def</span> <span class="ruby-identifier">add_command</span> <span class="ruby-identifier">command</span>
- <span class="ruby-ivar">@commands</span>[<span class="ruby-identifier">command</span>.<span class="ruby-identifier">name</span>] = <span class="ruby-identifier">command</span>
-<span class="ruby-keyword">end</span></pre>
- </div>
- </div>
-
- </div>
-
- <div class="method">
- <div class="title" id="method-i-alias-3F">
-
- <a name="method-i-alias-3F"></a><b>alias?</b>(name)
-
- </div>
-
- <div class="description">
-
-<p>Check if command <em>name</em> is an alias.</p>
-
- </div>
-
-
-
-
- <div class="sourcecode">
- <p class="source-link">
- Source: <a href="javascript:toggleSource('method-i-alias-3F_source')" id="l_method-i-alias-3F_source">show</a>
-
- </p>
- <div id="method-i-alias-3F_source" class="dyn-source">
- <pre><span class="ruby-comment"># File lib/commander/runner.rb, line 189</span>
-<span class="ruby-keyword">def</span> <span class="ruby-identifier">alias?</span> <span class="ruby-identifier">name</span>
- <span class="ruby-ivar">@aliases</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_s</span>
-<span class="ruby-keyword">end</span></pre>
- </div>
- </div>
-
- </div>
-
- <div class="method">
- <div class="title" id="method-i-alias_command">
-
- <a name="method-i-alias_command"></a><b>alias_command</b>(alias_name, name, *args)
-
- </div>
-
- <div class="description">
-
-<p>Alias command <em>name</em> with <em>alias_name</em>. Optionally
-<em>args</em> may be passed as if they were being passed straight to the
-original command via the command-line.</p>
-
- </div>
-
-
-
-
- <div class="sourcecode">
- <p class="source-link">
- Source: <a href="javascript:toggleSource('method-i-alias_command_source')" id="l_method-i-alias_command_source">show</a>
-
- </p>
- <div id="method-i-alias_command_source" class="dyn-source">
- <pre><span class="ruby-comment"># File lib/commander/runner.rb, line 166</span>
-<span class="ruby-keyword">def</span> <span class="ruby-identifier">alias_command</span> <span class="ruby-identifier">alias_name</span>, <span class="ruby-identifier">name</span>, *<span class="ruby-identifier">args</span>
- <span class="ruby-ivar">@commands</span>[<span class="ruby-identifier">alias_name</span>.<span class="ruby-identifier">to_s</span>] = <span class="ruby-identifier">command</span> <span class="ruby-identifier">name</span>
- <span class="ruby-ivar">@aliases</span>[<span class="ruby-identifier">alias_name</span>.<span class="ruby-identifier">to_s</span>] = <span class="ruby-identifier">args</span>
-<span class="ruby-keyword">end</span></pre>
- </div>
- </div>
-
- </div>
-
- <div class="method">
- <div class="title" id="method-i-command">
-
- <a name="method-i-command"></a><b>command</b>(name, &amp;block)
-
- </div>
-
- <div class="description">
-
-<p>Creates and yields a command instance when a block is passed. Otherwise
-attempts to return the command, raising <a
-href="Runner/InvalidCommandError.html">InvalidCommandError</a> when it does
-not exist.</p>
-
-<h3>Examples</h3>
-
-<pre>command :my_command do |c|
- c.when_called do |args|
- # Code
- end
-end</pre>
-
- </div>
-
-
-
-
- <div class="sourcecode">
- <p class="source-link">
- Source: <a href="javascript:toggleSource('method-i-command_source')" id="l_method-i-command_source">show</a>
-
- </p>
- <div id="method-i-command_source" class="dyn-source">
- <pre><span class="ruby-comment"># File lib/commander/runner.rb, line 143</span>
-<span class="ruby-keyword">def</span> <span class="ruby-identifier">command</span> <span class="ruby-identifier">name</span>, &amp;<span class="ruby-identifier">block</span>
- <span class="ruby-keyword">yield</span> <span class="ruby-identifier">add_command</span>(<span class="ruby-constant">Commander</span><span class="ruby-operator">::</span><span class="ruby-constant">Command</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">name</span>)) <span class="ruby-keyword">if</span> <span class="ruby-identifier">block</span>
- <span class="ruby-ivar">@commands</span>[<span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_s</span>]
-<span class="ruby-keyword">end</span></pre>
- </div>
- </div>
-
- </div>
-
- <div class="method">
- <div class="title" id="method-i-command_exists-3F">
-
- <a name="method-i-command_exists-3F"></a><b>command_exists?</b>(name)
-
- </div>
-
- <div class="description">
-
-<p>Check if a command <em>name</em> exists.</p>
-
- </div>
-
-
-
-
- <div class="sourcecode">
- <p class="source-link">
- Source: <a href="javascript:toggleSource('method-i-command_exists-3F_source')" id="l_method-i-command_exists-3F_source">show</a>
-
- </p>
- <div id="method-i-command_exists-3F_source" class="dyn-source">
- <pre><span class="ruby-comment"># File lib/commander/runner.rb, line 196</span>
-<span class="ruby-keyword">def</span> <span class="ruby-identifier">command_exists?</span> <span class="ruby-identifier">name</span>
- <span class="ruby-ivar">@commands</span>[<span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_s</span>]
-<span class="ruby-keyword">end</span></pre>
- </div>
- </div>
-
- </div>
-
- <div class="method">
- <div class="title" id="method-i-default_command">
-
- <a name="method-i-default_command"></a><b>default_command</b>(name)
-
- </div>
-
- <div class="description">
-
-<p>Default command <em>name</em> to be used when no other command is found in
-the arguments.</p>
-
- </div>
-
-
-
-
- <div class="sourcecode">
- <p class="source-link">
- Source: <a href="javascript:toggleSource('method-i-default_command_source')" id="l_method-i-default_command_source">show</a>
-
- </p>
- <div id="method-i-default_command_source" class="dyn-source">
- <pre><span class="ruby-comment"># File lib/commander/runner.rb, line 175</span>
-<span class="ruby-keyword">def</span> <span class="ruby-identifier">default_command</span> <span class="ruby-identifier">name</span>
- <span class="ruby-ivar">@default_command</span> = <span class="ruby-identifier">name</span>
-<span class="ruby-keyword">end</span></pre>
- </div>
- </div>
-
- </div>
-
- <div class="method">
- <div class="title" id="method-i-global_option">
-
- <a name="method-i-global_option"></a><b>global_option</b>(*args, &amp;block)
-
- </div>
-
- <div class="description">
-
-<p>Add a global option; follows the same syntax as <a
-href="Command.html#method-i-option">Command#option</a> This would be used
-for switches such as –version, –trace, etc.</p>
-
- </div>
-
-
-
-
- <div class="sourcecode">
- <p class="source-link">
- Source: <a href="javascript:toggleSource('method-i-global_option_source')" id="l_method-i-global_option_source">show</a>
-
- </p>
- <div id="method-i-global_option_source" class="dyn-source">
- <pre><span class="ruby-comment"># File lib/commander/runner.rb, line 152</span>
-<span class="ruby-keyword">def</span> <span class="ruby-identifier">global_option</span> *<span class="ruby-identifier">args</span>, &amp;<span class="ruby-identifier">block</span>
- <span class="ruby-identifier">switches</span>, <span class="ruby-identifier">description</span> = <span class="ruby-constant">Runner</span>.<span class="ruby-identifier">separate_switches_from_description</span> *<span class="ruby-identifier">args</span>
- <span class="ruby-ivar">@options</span> <span class="ruby-operator">&lt;&lt;</span> {
- <span class="ruby-value">:args</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">args</span>,
- <span class="ruby-value">:proc</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">block</span>,
- <span class="ruby-value">:switches</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">switches</span>,
- <span class="ruby-value">:description</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">description</span>,
- }
-<span class="ruby-keyword">end</span></pre>
- </div>
- </div>
-
- </div>
-
- <div class="method">
- <div class="title" id="method-i-program">
-
- <a name="method-i-program"></a><b>program</b>(key, *args, &amp;block)
-
- </div>
-
- <div class="description">
-
-<p>Assign program information.</p>
-
-<h3>Examples</h3>
-
-<pre># Set data
-program :name, 'Commander'
-program :version, Commander::VERSION
-program :description, 'Commander utility program.'
-program :help, 'Copyright', '2008 TJ Holowaychuk'
-program :help, 'Anything', 'You want'
-program :int_message 'Bye bye!'
-program :help_formatter, :compact
-program :help_formatter, Commander::HelpFormatter::TerminalCompact