drydock 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,180 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2
+ <html lang='en'>
3
+ <head>
4
+ <title>Class: Drydock::Command [Drydock, A seaworthy DSL for command-line apps.]</title>
5
+ <meta content='text/html; charset=utf-8' http-equiv='Content-Type'>
6
+ <link href='../.././rdoc-style.css' media='screen' rel='stylesheet' type='text/css'>
7
+ <script type='text/javascript'>
8
+ //<![CDATA[
9
+ function popupCode(url) {
10
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
11
+ }
12
+
13
+ function toggleCode(id) {
14
+ var code = document.getElementById(id)
15
+
16
+ code.style.display = code.style.display != 'block' ? 'block' : 'none'
17
+ return true
18
+ }
19
+
20
+ // Make codeblocks hidden by default
21
+ document.writeln('<' + 'style type="text/css">.method .source pre { display: none }<\/style>')
22
+ //]]>
23
+ </script>
24
+ </head>
25
+ <body class='page'>
26
+ <div class='class' id='wrapper'>
27
+ <div class='header'>
28
+ <h1 class='name'>
29
+ <span class='type'>Class</span>
30
+ Drydock::Command
31
+ </h1>
32
+ <ol class='paths'>
33
+ <li>
34
+ <a href="../../files/lib/drydock_rb.html">lib/drydock.rb</a>
35
+ </li>
36
+ </ol>
37
+ <div class='parent'>
38
+ Parent:
39
+ <strong>Object</strong>
40
+ </div>
41
+ </div>
42
+ <div id='content'>
43
+ <div id='text'>
44
+ <div id='description'>
45
+ <p>
46
+ The base class for all command objects. There is an instance of this class
47
+ for every command defined. Global and command-specific options are added as
48
+ attributes to this class dynamically.
49
+ </p>
50
+ <p>
51
+ i.e. &#8220;example -v date -f yaml&#8220;
52
+ </p>
53
+ <pre>global_option :v, :verbose, &quot;I want mooooore!&quot;&#x000A;option :f, :format, String, &quot;Long date format&quot;&#x000A;command :date do |obj|&#x000A; puts obj.verbose #=&gt; true&#x000A; puts obj.format #=&gt; &quot;yaml&quot;&#x000A;end</pre>
54
+ <p>
55
+ You can inherit from this class to create your own: EatFood < <a
56
+ href="Command.html">Drydock::Command</a>. And then specific your class in
57
+ the command definition:
58
+ </p>
59
+ <pre>command :eat =&gt; EatFood do |obj|; ...; end</pre>
60
+ </div>
61
+ <div id='method-list'>
62
+ <h2>Methods</h2>
63
+ <h3>public class</h3>
64
+ <ol>
65
+ <li><a href="#M000027">new</a></li>
66
+ </ol>
67
+ <h3>public instance</h3>
68
+ <ol>
69
+ <li><a href="#M000028">call</a></li>
70
+ <li><a href="#M000029">to_s</a></li>
71
+ </ol>
72
+ </div>
73
+ <div id='section'>
74
+ <div id='attribute-list'>
75
+ <h2 class='section-bar'>Attributes</h2>
76
+ <div class='name-list'>
77
+ <table>
78
+ <tr class='top-aligned-row context-row'>
79
+ <td class='context-item-name'>alias</td>
80
+ <td class='context-item-value'>[R]</td>
81
+ <td class='context-item-desc'></td>
82
+ </tr>
83
+ <tr class='top-aligned-row context-row'>
84
+ <td class='context-item-name'>cmd</td>
85
+ <td class='context-item-value'>[R]</td>
86
+ <td class='context-item-desc'></td>
87
+ </tr>
88
+ </table>
89
+ </div>
90
+ </div>
91
+ <div id='methods'>
92
+ <h2>Public class methods</h2>
93
+ <div class='public-class method' id='method-M000027'>
94
+ <a name='M000027'> </a>
95
+ <div class='synopsis'>
96
+ <span class='name'>new</span>
97
+ <span class='arguments'>(cmd, &amp;b)</span>
98
+ </div>
99
+ <div class='description'>
100
+ <p>
101
+ <tt>cmd</tt> is the short name of this command. <tt>b</tt> is the block
102
+ associated to this command.
103
+ </p>
104
+ </div>
105
+ <div class='source'>
106
+ <a class='source-toggle' href='#' onclick="toggleCode('M000027-source'); return false">
107
+ [show source]
108
+ </a>
109
+ <pre id='M000027-source'> <span class="ruby-comment cmt"># File lib/drydock.rb, line 29</span>&#x000A;29: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">cmd</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">b</span>)&#x000A;30: <span class="ruby-ivar">@cmd</span> = (<span class="ruby-identifier">cmd</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-constant">Symbol</span>)) <span class="ruby-operator">?</span> <span class="ruby-identifier">cmd</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">cmd</span>.<span class="ruby-identifier">to_sym</span>&#x000A;31: <span class="ruby-ivar">@b</span> = <span class="ruby-identifier">b</span>&#x000A;32: <span class="ruby-keyword kw">end</span></pre>
110
+ </div>
111
+ </div>
112
+ <h2>Public instance methods</h2>
113
+ <div class='public-instance method' id='method-M000028'>
114
+ <a name='M000028'> </a>
115
+ <div class='synopsis'>
116
+ <span class='name'>call</span>
117
+ <span class='arguments'>(cmd_str=nil, argv=[], stdin=[], global_options={}, options={})</span>
118
+ </div>
119
+ <div class='description'>
120
+ <p>
121
+ Execute the block.
122
+ </p>
123
+ <p>
124
+ <tt>cmd_str</tt> is the short name used to evoke this command. It will
125
+ equal @cmd unless an alias was used used to evoke this command.
126
+ <tt>argv</tt> an array of unnamed arguments. If ignore :options was
127
+ declared this will contain the arguments exactly as they were defined on
128
+ the command-line. <tt>stdin</tt> contains the output of stdin do; &#8230;;
129
+ end otherwise it&#8217;s a STDIN IO handle. <tt>global_options</tt> a hash
130
+ of the global options specified on the command-line <tt>options</tt> a hash
131
+ of the command-specific options specific on the command-line.
132
+ </p>
133
+ </div>
134
+ <div class='source'>
135
+ <a class='source-toggle' href='#' onclick="toggleCode('M000028-source'); return false">
136
+ [show source]
137
+ </a>
138
+ <pre id='M000028-source'> <span class="ruby-comment cmt"># File lib/drydock.rb, line 43</span>&#x000A;43: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">call</span>(<span class="ruby-identifier">cmd_str</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">argv</span>=[], <span class="ruby-identifier">stdin</span>=[], <span class="ruby-identifier">global_options</span>={}, <span class="ruby-identifier">options</span>={})&#x000A;44: <span class="ruby-ivar">@alias</span> = <span class="ruby-identifier">cmd_str</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-value">? </span><span class="ruby-ivar">@cmd</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">cmd_str</span>&#x000A;45: <span class="ruby-identifier">global_options</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">options</span>).<span class="ruby-identifier">each_pair</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">n</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span>&#x000A;46: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">send</span>(<span class="ruby-node">&quot;#{n}=&quot;</span>, <span class="ruby-identifier">v</span>)&#x000A;47: <span class="ruby-keyword kw">end</span>&#x000A;48: <span class="ruby-identifier">block_args</span> = [<span class="ruby-keyword kw">self</span>, <span class="ruby-identifier">argv</span>, <span class="ruby-identifier">stdin</span>] <span class="ruby-comment cmt"># TODO: review order</span>&#x000A;49: <span class="ruby-ivar">@b</span>.<span class="ruby-identifier">call</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">block_args</span>[<span class="ruby-value">0</span><span class="ruby-operator">..</span>(<span class="ruby-ivar">@b</span>.<span class="ruby-identifier">arity</span><span class="ruby-operator">-</span><span class="ruby-value">1</span>)]) <span class="ruby-comment cmt"># send only as many args as defined</span>&#x000A;50: <span class="ruby-keyword kw">end</span></pre>
139
+ </div>
140
+ </div>
141
+ <div class='public-instance method' id='method-M000029'>
142
+ <a name='M000029'> </a>
143
+ <div class='synopsis'>
144
+ <span class='name'>to_s</span>
145
+ <span class='arguments'>()</span>
146
+ </div>
147
+ <div class='description'>
148
+ <p>
149
+ The name of the command
150
+ </p>
151
+ </div>
152
+ <div class='source'>
153
+ <a class='source-toggle' href='#' onclick="toggleCode('M000029-source'); return false">
154
+ [show source]
155
+ </a>
156
+ <pre id='M000029-source'> <span class="ruby-comment cmt"># File lib/drydock.rb, line 53</span>&#x000A;53: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>&#x000A;54: <span class="ruby-ivar">@cmd</span>.<span class="ruby-identifier">to_s</span>&#x000A;55: <span class="ruby-keyword kw">end</span></pre>
157
+ </div>
158
+ </div>
159
+ </div>
160
+ </div>
161
+ </div>
162
+ </div>
163
+ <div id='footer-push'></div>
164
+ </div>
165
+ <div id='footer'>
166
+ <a href="http://github.com/mislav/hanna/tree/master"><strong>Hanna</strong> RDoc template</a>
167
+ <script type='text/javascript'>
168
+ //<![CDATA[
169
+ var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
170
+ document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/scr
171
+
172
+ try {
173
+ var pageTracker = _gat._getTracker("UA-4642735-10");
174
+ pageTracker._trackPageview();
175
+ } catch(err) {}
176
+ //]]>
177
+ </script>
178
+ </div>
179
+ </body>
180
+ </html>
@@ -0,0 +1,118 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2
+ <html lang='en'>
3
+ <head>
4
+ <title>Class: Drydock::InvalidArgument [Drydock, A seaworthy DSL for command-line apps.]</title>
5
+ <meta content='text/html; charset=utf-8' http-equiv='Content-Type'>
6
+ <link href='../.././rdoc-style.css' media='screen' rel='stylesheet' type='text/css'>
7
+ <script type='text/javascript'>
8
+ //<![CDATA[
9
+ function popupCode(url) {
10
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
11
+ }
12
+
13
+ function toggleCode(id) {
14
+ var code = document.getElementById(id)
15
+
16
+ code.style.display = code.style.display != 'block' ? 'block' : 'none'
17
+ return true
18
+ }
19
+
20
+ // Make codeblocks hidden by default
21
+ document.writeln('<' + 'style type="text/css">.method .source pre { display: none }<\/style>')
22
+ //]]>
23
+ </script>
24
+ </head>
25
+ <body class='page'>
26
+ <div class='class' id='wrapper'>
27
+ <div class='header'>
28
+ <h1 class='name'>
29
+ <span class='type'>Class</span>
30
+ Drydock::InvalidArgument
31
+ </h1>
32
+ <ol class='paths'>
33
+ <li>
34
+ <a href="../../files/lib/drydock_rb.html">lib/drydock.rb</a>
35
+ </li>
36
+ </ol>
37
+ <div class='parent'>
38
+ Parent:
39
+ <strong>RuntimeError</strong>
40
+ </div>
41
+ </div>
42
+ <div id='content'>
43
+ <div id='text'>
44
+ <div id='method-list'>
45
+ <h2>Methods</h2>
46
+ <h3>public class</h3>
47
+ <ol>
48
+ <li><a href="#M000024">new</a></li>
49
+ </ol>
50
+ <h3>public instance</h3>
51
+ <ol>
52
+ <li><a href="#M000025">message</a></li>
53
+ </ol>
54
+ </div>
55
+ <div id='section'>
56
+ <div id='attribute-list'>
57
+ <h2 class='section-bar'>Attributes</h2>
58
+ <div class='name-list'>
59
+ <table>
60
+ <tr class='top-aligned-row context-row'>
61
+ <td class='context-item-name'>args</td>
62
+ <td class='context-item-value'>[RW]</td>
63
+ <td class='context-item-desc'></td>
64
+ </tr>
65
+ </table>
66
+ </div>
67
+ </div>
68
+ <div id='methods'>
69
+ <h2>Public class methods</h2>
70
+ <div class='public-class method' id='method-M000024'>
71
+ <a name='M000024'> </a>
72
+ <div class='synopsis'>
73
+ <span class='name'>new</span>
74
+ <span class='arguments'>(args)</span>
75
+ </div>
76
+ <div class='source'>
77
+ <a class='source-toggle' href='#' onclick="toggleCode('M000024-source'); return false">
78
+ [show source]
79
+ </a>
80
+ <pre id='M000024-source'> <span class="ruby-comment cmt"># File lib/drydock.rb, line 76</span>&#x000A;76: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">args</span>)&#x000A;77: <span class="ruby-ivar">@args</span> = <span class="ruby-identifier">args</span> <span class="ruby-operator">||</span> []&#x000A;78: <span class="ruby-keyword kw">end</span></pre>
81
+ </div>
82
+ </div>
83
+ <h2>Public instance methods</h2>
84
+ <div class='public-instance method' id='method-M000025'>
85
+ <a name='M000025'> </a>
86
+ <div class='synopsis'>
87
+ <span class='name'>message</span>
88
+ <span class='arguments'>()</span>
89
+ </div>
90
+ <div class='source'>
91
+ <a class='source-toggle' href='#' onclick="toggleCode('M000025-source'); return false">
92
+ [show source]
93
+ </a>
94
+ <pre id='M000025-source'> <span class="ruby-comment cmt"># File lib/drydock.rb, line 79</span>&#x000A;79: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">message</span>&#x000A;80: <span class="ruby-node">&quot;Unknown option: #{@args.join(&quot;, &quot;)}&quot;</span>&#x000A;81: <span class="ruby-keyword kw">end</span></pre>
95
+ </div>
96
+ </div>
97
+ </div>
98
+ </div>
99
+ </div>
100
+ </div>
101
+ <div id='footer-push'></div>
102
+ </div>
103
+ <div id='footer'>
104
+ <a href="http://github.com/mislav/hanna/tree/master"><strong>Hanna</strong> RDoc template</a>
105
+ <script type='text/javascript'>
106
+ //<![CDATA[
107
+ var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
108
+ document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/scr
109
+
110
+ try {
111
+ var pageTracker = _gat._getTracker("UA-4642735-10");
112
+ pageTracker._trackPageview();
113
+ } catch(err) {}
114
+ //]]>
115
+ </script>
116
+ </div>
117
+ </body>
118
+ </html>
@@ -0,0 +1,88 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2
+ <html lang='en'>
3
+ <head>
4
+ <title>Class: Drydock::MissingArgument [Drydock, A seaworthy DSL for command-line apps.]</title>
5
+ <meta content='text/html; charset=utf-8' http-equiv='Content-Type'>
6
+ <link href='../.././rdoc-style.css' media='screen' rel='stylesheet' type='text/css'>
7
+ <script type='text/javascript'>
8
+ //<![CDATA[
9
+ function popupCode(url) {
10
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
11
+ }
12
+
13
+ function toggleCode(id) {
14
+ var code = document.getElementById(id)
15
+
16
+ code.style.display = code.style.display != 'block' ? 'block' : 'none'
17
+ return true
18
+ }
19
+
20
+ // Make codeblocks hidden by default
21
+ document.writeln('<' + 'style type="text/css">.method .source pre { display: none }<\/style>')
22
+ //]]>
23
+ </script>
24
+ </head>
25
+ <body class='page'>
26
+ <div class='class' id='wrapper'>
27
+ <div class='header'>
28
+ <h1 class='name'>
29
+ <span class='type'>Class</span>
30
+ Drydock::MissingArgument
31
+ </h1>
32
+ <ol class='paths'>
33
+ <li>
34
+ <a href="../../files/lib/drydock_rb.html">lib/drydock.rb</a>
35
+ </li>
36
+ </ol>
37
+ <div class='parent'>
38
+ Parent:
39
+ <strong><a href="InvalidArgument.html">Drydock::InvalidArgument</a></strong>
40
+ </div>
41
+ </div>
42
+ <div id='content'>
43
+ <div id='text'>
44
+ <div id='method-list'>
45
+ <h2>Methods</h2>
46
+ <h3>public instance</h3>
47
+ <ol>
48
+ <li><a href="#M000030">message</a></li>
49
+ </ol>
50
+ </div>
51
+ <div id='section'>
52
+ <div id='methods'>
53
+ <h2>Public instance methods</h2>
54
+ <div class='public-instance method' id='method-M000030'>
55
+ <a name='M000030'> </a>
56
+ <div class='synopsis'>
57
+ <span class='name'>message</span>
58
+ <span class='arguments'>()</span>
59
+ </div>
60
+ <div class='source'>
61
+ <a class='source-toggle' href='#' onclick="toggleCode('M000030-source'); return false">
62
+ [show source]
63
+ </a>
64
+ <pre id='M000030-source'> <span class="ruby-comment cmt"># File lib/drydock.rb, line 84</span>&#x000A;84: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">message</span>&#x000A;85: <span class="ruby-node">&quot;Option requires a value: #{@args.join(&quot;, &quot;)}&quot;</span>&#x000A;86: <span class="ruby-keyword kw">end</span></pre>
65
+ </div>
66
+ </div>
67
+ </div>
68
+ </div>
69
+ </div>
70
+ </div>
71
+ <div id='footer-push'></div>
72
+ </div>
73
+ <div id='footer'>
74
+ <a href="http://github.com/mislav/hanna/tree/master"><strong>Hanna</strong> RDoc template</a>
75
+ <script type='text/javascript'>
76
+ //<![CDATA[
77
+ var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
78
+ document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/scr
79
+
80
+ try {
81
+ var pageTracker = _gat._getTracker("UA-4642735-10");
82
+ pageTracker._trackPageview();
83
+ } catch(err) {}
84
+ //]]>
85
+ </script>
86
+ </div>
87
+ </body>
88
+ </html>
@@ -0,0 +1,88 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2
+ <html lang='en'>
3
+ <head>
4
+ <title>Class: Drydock::NoCommandsDefined [Drydock, A seaworthy DSL for command-line apps.]</title>
5
+ <meta content='text/html; charset=utf-8' http-equiv='Content-Type'>
6
+ <link href='../.././rdoc-style.css' media='screen' rel='stylesheet' type='text/css'>
7
+ <script type='text/javascript'>
8
+ //<![CDATA[
9
+ function popupCode(url) {
10
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
11
+ }
12
+
13
+ function toggleCode(id) {
14
+ var code = document.getElementById(id)
15
+
16
+ code.style.display = code.style.display != 'block' ? 'block' : 'none'
17
+ return true
18
+ }
19
+
20
+ // Make codeblocks hidden by default
21
+ document.writeln('<' + 'style type="text/css">.method .source pre { display: none }<\/style>')
22
+ //]]>
23
+ </script>
24
+ </head>
25
+ <body class='page'>
26
+ <div class='class' id='wrapper'>
27
+ <div class='header'>
28
+ <h1 class='name'>
29
+ <span class='type'>Class</span>
30
+ Drydock::NoCommandsDefined
31
+ </h1>
32
+ <ol class='paths'>
33
+ <li>
34
+ <a href="../../files/lib/drydock_rb.html">lib/drydock.rb</a>
35
+ </li>
36
+ </ol>
37
+ <div class='parent'>
38
+ Parent:
39
+ <strong>RuntimeError</strong>
40
+ </div>
41
+ </div>
42
+ <div id='content'>
43
+ <div id='text'>
44
+ <div id='method-list'>
45
+ <h2>Methods</h2>
46
+ <h3>public instance</h3>
47
+ <ol>
48
+ <li><a href="#M000026">message</a></li>
49
+ </ol>
50
+ </div>
51
+ <div id='section'>
52
+ <div id='methods'>
53
+ <h2>Public instance methods</h2>
54
+ <div class='public-instance method' id='method-M000026'>
55
+ <a name='M000026'> </a>
56
+ <div class='synopsis'>
57
+ <span class='name'>message</span>
58
+ <span class='arguments'>()</span>
59
+ </div>
60
+ <div class='source'>
61
+ <a class='source-toggle' href='#' onclick="toggleCode('M000026-source'); return false">
62
+ [show source]
63
+ </a>
64
+ <pre id='M000026-source'> <span class="ruby-comment cmt"># File lib/drydock.rb, line 70</span>&#x000A;70: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">message</span>&#x000A;71: <span class="ruby-value str">&quot;No commands defined&quot;</span>&#x000A;72: <span class="ruby-keyword kw">end</span></pre>
65
+ </div>
66
+ </div>
67
+ </div>
68
+ </div>
69
+ </div>
70
+ </div>
71
+ <div id='footer-push'></div>
72
+ </div>
73
+ <div id='footer'>
74
+ <a href="http://github.com/mislav/hanna/tree/master"><strong>Hanna</strong> RDoc template</a>
75
+ <script type='text/javascript'>
76
+ //<![CDATA[
77
+ var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
78
+ document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/scr
79
+
80
+ try {
81
+ var pageTracker = _gat._getTracker("UA-4642735-10");
82
+ pageTracker._trackPageview();
83
+ } catch(err) {}
84
+ //]]>
85
+ </script>
86
+ </div>
87
+ </body>
88
+ </html>