cli 1.2.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +5 -7
- data/Gemfile.lock +29 -37
- data/README.md +43 -44
- data/Rakefile +1 -28
- data/cli.gemspec +14 -84
- data/examples/httpclient +6 -6
- data/examples/ls +4 -4
- data/examples/processor +5 -5
- data/examples/sinatra +9 -9
- data/lib/cli/dsl.rb +3 -3
- data/rdoc/CLI/Arguments.html +178 -0
- data/rdoc/CLI/DSL/Argument.html +200 -0
- data/rdoc/CLI/DSL/Arguments.html +172 -0
- data/rdoc/CLI/DSL/Base.html +154 -0
- data/rdoc/CLI/DSL/Cast.html +152 -0
- data/rdoc/CLI/DSL/Description.html +150 -0
- data/rdoc/CLI/DSL/Input.html +143 -0
- data/rdoc/CLI/DSL/MultiDefault.html +151 -0
- data/rdoc/CLI/DSL/Option.html +143 -0
- data/rdoc/CLI/DSL/Options.html +142 -0
- data/rdoc/CLI/DSL/Switch.html +267 -0
- data/rdoc/CLI/DSL/Value.html +238 -0
- data/rdoc/CLI/DSL.html +91 -0
- data/rdoc/CLI/Options.html +200 -0
- data/rdoc/CLI/ParserError/ArgumentNameSpecifiedTwice.html +138 -0
- data/rdoc/CLI/ParserError/LongNameSpecifiedTwiceError.html +138 -0
- data/rdoc/CLI/ParserError/MultipleArgumentsSpecifierError.html +138 -0
- data/rdoc/CLI/ParserError/NameArgumetNotSymbolError.html +138 -0
- data/rdoc/CLI/ParserError/OptionsArgumentNotHashError.html +138 -0
- data/rdoc/CLI/ParserError/ShortNameIsInvalidError.html +138 -0
- data/rdoc/CLI/ParserError/ShortNameNotSymbolError.html +138 -0
- data/rdoc/CLI/ParserError/ShortNameSpecifiedTwiceError.html +138 -0
- data/rdoc/CLI/ParserError.html +97 -0
- data/rdoc/CLI/ParsingError/CastError.html +138 -0
- data/rdoc/CLI/ParsingError/MandatoryArgumentNotSpecifiedError.html +138 -0
- data/rdoc/CLI/ParsingError/MandatoryOptionsNotSpecifiedError.html +138 -0
- data/rdoc/CLI/ParsingError/MissingOptionValueError.html +138 -0
- data/rdoc/CLI/ParsingError/UnknownSwitchError.html +138 -0
- data/rdoc/CLI/ParsingError/UsageError.html +97 -0
- data/rdoc/CLI/ParsingError.html +97 -0
- data/rdoc/CLI/Switches.html +306 -0
- data/rdoc/CLI/Values.html +202 -0
- data/rdoc/CLI.html +652 -0
- data/rdoc/README_md.html +553 -0
- data/rdoc/created.rid +7 -0
- data/rdoc/css/fonts.css +167 -0
- data/rdoc/css/rdoc.css +639 -0
- data/rdoc/fonts/Lato-Light.ttf +0 -0
- data/rdoc/fonts/Lato-LightItalic.ttf +0 -0
- data/rdoc/fonts/Lato-Regular.ttf +0 -0
- data/rdoc/fonts/Lato-RegularItalic.ttf +0 -0
- data/rdoc/fonts/SourceCodePro-Bold.ttf +0 -0
- data/rdoc/fonts/SourceCodePro-Regular.ttf +0 -0
- data/rdoc/images/add.png +0 -0
- data/rdoc/images/arrow_up.png +0 -0
- data/rdoc/images/brick.png +0 -0
- data/rdoc/images/brick_link.png +0 -0
- data/rdoc/images/bug.png +0 -0
- data/rdoc/images/bullet_black.png +0 -0
- data/rdoc/images/bullet_toggle_minus.png +0 -0
- data/rdoc/images/bullet_toggle_plus.png +0 -0
- data/rdoc/images/date.png +0 -0
- data/rdoc/images/delete.png +0 -0
- data/rdoc/images/find.png +0 -0
- data/rdoc/images/loadingAnimation.gif +0 -0
- data/rdoc/images/macFFBgHack.png +0 -0
- data/rdoc/images/package.png +0 -0
- data/rdoc/images/page_green.png +0 -0
- data/rdoc/images/page_white_text.png +0 -0
- data/rdoc/images/page_white_width.png +0 -0
- data/rdoc/images/plugin.png +0 -0
- data/rdoc/images/ruby.png +0 -0
- data/rdoc/images/tag_blue.png +0 -0
- data/rdoc/images/tag_green.png +0 -0
- data/rdoc/images/transparent.png +0 -0
- data/rdoc/images/wrench.png +0 -0
- data/rdoc/images/wrench_orange.png +0 -0
- data/rdoc/images/zoom.png +0 -0
- data/rdoc/index.html +120 -0
- data/rdoc/js/darkfish.js +84 -0
- data/rdoc/js/navigation.js +105 -0
- data/rdoc/js/navigation.js.gz +0 -0
- data/rdoc/js/search.js +110 -0
- data/rdoc/js/search_index.js +1 -0
- data/rdoc/js/search_index.js.gz +0 -0
- data/rdoc/js/searcher.js +229 -0
- data/rdoc/js/searcher.js.gz +0 -0
- data/rdoc/table_of_contents.html +533 -0
- data/spec/argument_spec.rb +122 -99
- data/spec/cli_spec.rb +27 -28
- data/spec/conflict_reporting_spec.rb +16 -17
- data/spec/option_spec.rb +79 -56
- data/spec/separator_spec.rb +19 -20
- data/spec/stdin_spec.rb +13 -14
- data/spec/switch_spec.rb +15 -16
- data/spec/usage_spec.rb +80 -81
- metadata +91 -104
- data/.document +0 -5
- data/.rspec +0 -1
- data/VERSION +0 -1
- data/features/cli.feature +0 -9
- data/features/step_definitions/cli_steps.rb +0 -0
- data/features/support/env.rb +0 -13
@@ -0,0 +1,306 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>class CLI::Switches - cli 1.3.1</title>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
var rdoc_rel_prefix = "../";
|
11
|
+
var index_rel_prefix = "../";
|
12
|
+
</script>
|
13
|
+
|
14
|
+
<script src="../js/navigation.js" defer></script>
|
15
|
+
<script src="../js/search.js" defer></script>
|
16
|
+
<script src="../js/search_index.js" defer></script>
|
17
|
+
<script src="../js/searcher.js" defer></script>
|
18
|
+
<script src="../js/darkfish.js" defer></script>
|
19
|
+
|
20
|
+
<link href="../css/fonts.css" rel="stylesheet">
|
21
|
+
<link href="../css/rdoc.css" rel="stylesheet">
|
22
|
+
|
23
|
+
|
24
|
+
<body id="top" role="document" class="class">
|
25
|
+
<nav role="navigation">
|
26
|
+
<div id="project-navigation">
|
27
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
28
|
+
<h2>
|
29
|
+
<a href="../index.html" rel="home">Home</a>
|
30
|
+
</h2>
|
31
|
+
|
32
|
+
<div id="table-of-contents-navigation">
|
33
|
+
<a href="../table_of_contents.html#pages">Pages</a>
|
34
|
+
<a href="../table_of_contents.html#classes">Classes</a>
|
35
|
+
<a href="../table_of_contents.html#methods">Methods</a>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
40
|
+
<form action="#" method="get" accept-charset="utf-8">
|
41
|
+
<div id="search-field-wrapper">
|
42
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
43
|
+
aria-autocomplete="list" aria-controls="search-results"
|
44
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
45
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
46
|
+
</div>
|
47
|
+
|
48
|
+
<ul id="search-results" aria-label="Search Results"
|
49
|
+
aria-busy="false" aria-expanded="false"
|
50
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
51
|
+
</form>
|
52
|
+
</div>
|
53
|
+
|
54
|
+
</div>
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
<div id="class-metadata">
|
59
|
+
|
60
|
+
|
61
|
+
<div id="parent-class-section" class="nav-section">
|
62
|
+
<h3>Parent</h3>
|
63
|
+
|
64
|
+
<p class="link">Array
|
65
|
+
</div>
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
<!-- Method Quickref -->
|
71
|
+
<div id="method-list-section" class="nav-section">
|
72
|
+
<h3>Methods</h3>
|
73
|
+
|
74
|
+
<ul class="link-list" role="directory">
|
75
|
+
<li ><a href="#method-c-is_switch-3F">::is_switch?</a>
|
76
|
+
<li ><a href="#method-c-new">::new</a>
|
77
|
+
<li class="calls-super" ><a href="#method-i-3C-3C">#<<</a>
|
78
|
+
<li ><a href="#method-i-find">#find</a>
|
79
|
+
<li ><a href="#method-i-find_long">#find_long</a>
|
80
|
+
<li ><a href="#method-i-find_short">#find_short</a>
|
81
|
+
<li ><a href="#method-i-has_long-3F">#has_long?</a>
|
82
|
+
<li ><a href="#method-i-has_short-3F">#has_short?</a>
|
83
|
+
</ul>
|
84
|
+
</div>
|
85
|
+
|
86
|
+
</div>
|
87
|
+
</nav>
|
88
|
+
|
89
|
+
<main role="main" aria-labelledby="class-CLI::Switches">
|
90
|
+
<h1 id="class-CLI::Switches" class="class">
|
91
|
+
class CLI::Switches
|
92
|
+
</h1>
|
93
|
+
|
94
|
+
<section class="description">
|
95
|
+
|
96
|
+
</section>
|
97
|
+
|
98
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
105
|
+
<header>
|
106
|
+
<h3>Public Class Methods</h3>
|
107
|
+
</header>
|
108
|
+
|
109
|
+
<div id="method-c-is_switch-3F" class="method-detail ">
|
110
|
+
<div class="method-heading">
|
111
|
+
<span class="method-name">is_switch?</span><span
|
112
|
+
class="method-args">(arg)</span>
|
113
|
+
<span class="method-click-advice">click to toggle source</span>
|
114
|
+
</div>
|
115
|
+
|
116
|
+
<div class="method-description">
|
117
|
+
|
118
|
+
|
119
|
+
<div class="method-source-code" id="is_switch-3F-source">
|
120
|
+
<pre><span class="ruby-comment"># File lib/cli/switches.rb, line 13</span>
|
121
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">is_switch?</span>(<span class="ruby-identifier">arg</span>)
|
122
|
+
<span class="ruby-identifier">arg</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/^-/</span>
|
123
|
+
<span class="ruby-keyword">end</span></pre>
|
124
|
+
</div>
|
125
|
+
</div>
|
126
|
+
|
127
|
+
|
128
|
+
</div>
|
129
|
+
|
130
|
+
<div id="method-c-new" class="method-detail ">
|
131
|
+
<div class="method-heading">
|
132
|
+
<span class="method-name">new</span><span
|
133
|
+
class="method-args">()</span>
|
134
|
+
<span class="method-click-advice">click to toggle source</span>
|
135
|
+
</div>
|
136
|
+
|
137
|
+
<div class="method-description">
|
138
|
+
|
139
|
+
|
140
|
+
<div class="method-source-code" id="new-source">
|
141
|
+
<pre><span class="ruby-comment"># File lib/cli/switches.rb, line 2</span>
|
142
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>
|
143
|
+
<span class="ruby-ivar">@long</span> = {}
|
144
|
+
<span class="ruby-ivar">@short</span> = {}
|
145
|
+
<span class="ruby-keyword">end</span></pre>
|
146
|
+
</div>
|
147
|
+
</div>
|
148
|
+
|
149
|
+
|
150
|
+
</div>
|
151
|
+
|
152
|
+
</section>
|
153
|
+
|
154
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
155
|
+
<header>
|
156
|
+
<h3>Public Instance Methods</h3>
|
157
|
+
</header>
|
158
|
+
|
159
|
+
<div id="method-i-3C-3C" class="method-detail ">
|
160
|
+
<div class="method-heading">
|
161
|
+
<span class="method-name"><<</span><span
|
162
|
+
class="method-args">(switch_dsl)</span>
|
163
|
+
<span class="method-click-advice">click to toggle source</span>
|
164
|
+
</div>
|
165
|
+
|
166
|
+
<div class="method-description">
|
167
|
+
|
168
|
+
<div class="method-calls-super">
|
169
|
+
Calls superclass method
|
170
|
+
|
171
|
+
</div>
|
172
|
+
|
173
|
+
<div class="method-source-code" id="3C-3C-source">
|
174
|
+
<pre><span class="ruby-comment"># File lib/cli/switches.rb, line 7</span>
|
175
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title"><<</span>(<span class="ruby-identifier">switch_dsl</span>)
|
176
|
+
<span class="ruby-keyword">super</span>(<span class="ruby-identifier">switch_dsl</span>)
|
177
|
+
<span class="ruby-ivar">@long</span>[<span class="ruby-identifier">switch_dsl</span>.<span class="ruby-identifier">name</span>] = <span class="ruby-identifier">switch_dsl</span>
|
178
|
+
<span class="ruby-ivar">@short</span>[<span class="ruby-identifier">switch_dsl</span>.<span class="ruby-identifier">short</span>] = <span class="ruby-identifier">switch_dsl</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">switch_dsl</span>.<span class="ruby-identifier">has_short?</span>
|
179
|
+
<span class="ruby-keyword">end</span></pre>
|
180
|
+
</div>
|
181
|
+
</div>
|
182
|
+
|
183
|
+
|
184
|
+
</div>
|
185
|
+
|
186
|
+
<div id="method-i-find" class="method-detail ">
|
187
|
+
<div class="method-heading">
|
188
|
+
<span class="method-name">find</span><span
|
189
|
+
class="method-args">(arg)</span>
|
190
|
+
<span class="method-click-advice">click to toggle source</span>
|
191
|
+
</div>
|
192
|
+
|
193
|
+
<div class="method-description">
|
194
|
+
|
195
|
+
|
196
|
+
<div class="method-source-code" id="find-source">
|
197
|
+
<pre><span class="ruby-comment"># File lib/cli/switches.rb, line 17</span>
|
198
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">find</span>(<span class="ruby-identifier">arg</span>)
|
199
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">arg</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/^--/</span>
|
200
|
+
<span class="ruby-identifier">find_long</span>(<span class="ruby-identifier">arg</span>)
|
201
|
+
<span class="ruby-keyword">else</span>
|
202
|
+
<span class="ruby-identifier">find_short</span>(<span class="ruby-identifier">arg</span>)
|
203
|
+
<span class="ruby-keyword">end</span>
|
204
|
+
<span class="ruby-keyword">end</span></pre>
|
205
|
+
</div>
|
206
|
+
</div>
|
207
|
+
|
208
|
+
|
209
|
+
</div>
|
210
|
+
|
211
|
+
<div id="method-i-find_long" class="method-detail ">
|
212
|
+
<div class="method-heading">
|
213
|
+
<span class="method-name">find_long</span><span
|
214
|
+
class="method-args">(arg)</span>
|
215
|
+
<span class="method-click-advice">click to toggle source</span>
|
216
|
+
</div>
|
217
|
+
|
218
|
+
<div class="method-description">
|
219
|
+
|
220
|
+
|
221
|
+
<div class="method-source-code" id="find_long-source">
|
222
|
+
<pre><span class="ruby-comment"># File lib/cli/switches.rb, line 25</span>
|
223
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">find_long</span>(<span class="ruby-identifier">arg</span>)
|
224
|
+
<span class="ruby-ivar">@long</span>[<span class="ruby-identifier">arg</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp">/^--/</span>, <span class="ruby-string">''</span>).<span class="ruby-identifier">tr</span>(<span class="ruby-string">'-'</span>, <span class="ruby-string">'_'</span>).<span class="ruby-identifier">to_sym</span>]
|
225
|
+
<span class="ruby-keyword">end</span></pre>
|
226
|
+
</div>
|
227
|
+
</div>
|
228
|
+
|
229
|
+
|
230
|
+
</div>
|
231
|
+
|
232
|
+
<div id="method-i-find_short" class="method-detail ">
|
233
|
+
<div class="method-heading">
|
234
|
+
<span class="method-name">find_short</span><span
|
235
|
+
class="method-args">(arg)</span>
|
236
|
+
<span class="method-click-advice">click to toggle source</span>
|
237
|
+
</div>
|
238
|
+
|
239
|
+
<div class="method-description">
|
240
|
+
|
241
|
+
|
242
|
+
<div class="method-source-code" id="find_short-source">
|
243
|
+
<pre><span class="ruby-comment"># File lib/cli/switches.rb, line 29</span>
|
244
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">find_short</span>(<span class="ruby-identifier">arg</span>)
|
245
|
+
<span class="ruby-ivar">@short</span>[<span class="ruby-identifier">arg</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp">/^-/</span>, <span class="ruby-string">''</span>).<span class="ruby-identifier">tr</span>(<span class="ruby-string">'-'</span>, <span class="ruby-string">'_'</span>).<span class="ruby-identifier">to_sym</span>]
|
246
|
+
<span class="ruby-keyword">end</span></pre>
|
247
|
+
</div>
|
248
|
+
</div>
|
249
|
+
|
250
|
+
|
251
|
+
</div>
|
252
|
+
|
253
|
+
<div id="method-i-has_long-3F" class="method-detail ">
|
254
|
+
<div class="method-heading">
|
255
|
+
<span class="method-name">has_long?</span><span
|
256
|
+
class="method-args">(switch_dsl)</span>
|
257
|
+
<span class="method-click-advice">click to toggle source</span>
|
258
|
+
</div>
|
259
|
+
|
260
|
+
<div class="method-description">
|
261
|
+
|
262
|
+
|
263
|
+
<div class="method-source-code" id="has_long-3F-source">
|
264
|
+
<pre><span class="ruby-comment"># File lib/cli/switches.rb, line 33</span>
|
265
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">has_long?</span>(<span class="ruby-identifier">switch_dsl</span>)
|
266
|
+
<span class="ruby-ivar">@long</span>.<span class="ruby-identifier">member?</span>(<span class="ruby-identifier">switch_dsl</span>.<span class="ruby-identifier">name</span>)
|
267
|
+
<span class="ruby-keyword">end</span></pre>
|
268
|
+
</div>
|
269
|
+
</div>
|
270
|
+
|
271
|
+
|
272
|
+
</div>
|
273
|
+
|
274
|
+
<div id="method-i-has_short-3F" class="method-detail ">
|
275
|
+
<div class="method-heading">
|
276
|
+
<span class="method-name">has_short?</span><span
|
277
|
+
class="method-args">(switch_dsl)</span>
|
278
|
+
<span class="method-click-advice">click to toggle source</span>
|
279
|
+
</div>
|
280
|
+
|
281
|
+
<div class="method-description">
|
282
|
+
|
283
|
+
|
284
|
+
<div class="method-source-code" id="has_short-3F-source">
|
285
|
+
<pre><span class="ruby-comment"># File lib/cli/switches.rb, line 37</span>
|
286
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">has_short?</span>(<span class="ruby-identifier">switch_dsl</span>)
|
287
|
+
<span class="ruby-ivar">@short</span>.<span class="ruby-identifier">member?</span>(<span class="ruby-identifier">switch_dsl</span>.<span class="ruby-identifier">short</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">switch_dsl</span>.<span class="ruby-identifier">has_short?</span>
|
288
|
+
<span class="ruby-keyword">end</span></pre>
|
289
|
+
</div>
|
290
|
+
</div>
|
291
|
+
|
292
|
+
|
293
|
+
</div>
|
294
|
+
|
295
|
+
</section>
|
296
|
+
|
297
|
+
</section>
|
298
|
+
</main>
|
299
|
+
|
300
|
+
|
301
|
+
<footer id="validator-badges" role="contentinfo">
|
302
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
303
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.
|
304
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
305
|
+
</footer>
|
306
|
+
|
@@ -0,0 +1,202 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>class CLI::Values - cli 1.3.1</title>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
var rdoc_rel_prefix = "../";
|
11
|
+
var index_rel_prefix = "../";
|
12
|
+
</script>
|
13
|
+
|
14
|
+
<script src="../js/navigation.js" defer></script>
|
15
|
+
<script src="../js/search.js" defer></script>
|
16
|
+
<script src="../js/search_index.js" defer></script>
|
17
|
+
<script src="../js/searcher.js" defer></script>
|
18
|
+
<script src="../js/darkfish.js" defer></script>
|
19
|
+
|
20
|
+
<link href="../css/fonts.css" rel="stylesheet">
|
21
|
+
<link href="../css/rdoc.css" rel="stylesheet">
|
22
|
+
|
23
|
+
|
24
|
+
<body id="top" role="document" class="class">
|
25
|
+
<nav role="navigation">
|
26
|
+
<div id="project-navigation">
|
27
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
28
|
+
<h2>
|
29
|
+
<a href="../index.html" rel="home">Home</a>
|
30
|
+
</h2>
|
31
|
+
|
32
|
+
<div id="table-of-contents-navigation">
|
33
|
+
<a href="../table_of_contents.html#pages">Pages</a>
|
34
|
+
<a href="../table_of_contents.html#classes">Classes</a>
|
35
|
+
<a href="../table_of_contents.html#methods">Methods</a>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
40
|
+
<form action="#" method="get" accept-charset="utf-8">
|
41
|
+
<div id="search-field-wrapper">
|
42
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
43
|
+
aria-autocomplete="list" aria-controls="search-results"
|
44
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
45
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
46
|
+
</div>
|
47
|
+
|
48
|
+
<ul id="search-results" aria-label="Search Results"
|
49
|
+
aria-busy="false" aria-expanded="false"
|
50
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
51
|
+
</form>
|
52
|
+
</div>
|
53
|
+
|
54
|
+
</div>
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
<div id="class-metadata">
|
59
|
+
|
60
|
+
|
61
|
+
<div id="parent-class-section" class="nav-section">
|
62
|
+
<h3>Parent</h3>
|
63
|
+
|
64
|
+
<p class="link">OpenStruct
|
65
|
+
</div>
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
<!-- Method Quickref -->
|
71
|
+
<div id="method-list-section" class="nav-section">
|
72
|
+
<h3>Methods</h3>
|
73
|
+
|
74
|
+
<ul class="link-list" role="directory">
|
75
|
+
<li ><a href="#method-i-append">#append</a>
|
76
|
+
<li ><a href="#method-i-get">#get</a>
|
77
|
+
<li ><a href="#method-i-set">#set</a>
|
78
|
+
<li ><a href="#method-i-value">#value</a>
|
79
|
+
</ul>
|
80
|
+
</div>
|
81
|
+
|
82
|
+
</div>
|
83
|
+
</nav>
|
84
|
+
|
85
|
+
<main role="main" aria-labelledby="class-CLI::Values">
|
86
|
+
<h1 id="class-CLI::Values" class="class">
|
87
|
+
class CLI::Values
|
88
|
+
</h1>
|
89
|
+
|
90
|
+
<section class="description">
|
91
|
+
|
92
|
+
</section>
|
93
|
+
|
94
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
101
|
+
<header>
|
102
|
+
<h3>Public Instance Methods</h3>
|
103
|
+
</header>
|
104
|
+
|
105
|
+
<div id="method-i-append" class="method-detail ">
|
106
|
+
<div class="method-heading">
|
107
|
+
<span class="method-name">append</span><span
|
108
|
+
class="method-args">(argument, value)</span>
|
109
|
+
<span class="method-click-advice">click to toggle source</span>
|
110
|
+
</div>
|
111
|
+
|
112
|
+
<div class="method-description">
|
113
|
+
|
114
|
+
|
115
|
+
<div class="method-source-code" id="append-source">
|
116
|
+
<pre><span class="ruby-comment"># File lib/cli.rb, line 100</span>
|
117
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">append</span>(<span class="ruby-identifier">argument</span>, <span class="ruby-identifier">value</span>)
|
118
|
+
<span class="ruby-identifier">v</span> = (<span class="ruby-identifier">get</span>(<span class="ruby-identifier">argument</span>) <span class="ruby-keyword">or</span> [])
|
119
|
+
<span class="ruby-identifier">v</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">value</span>
|
120
|
+
<span class="ruby-identifier">send</span>((<span class="ruby-identifier">argument</span>.<span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">+</span> <span class="ruby-string">'='</span>).<span class="ruby-identifier">to_sym</span>, <span class="ruby-identifier">v</span>)
|
121
|
+
<span class="ruby-keyword">end</span></pre>
|
122
|
+
</div>
|
123
|
+
</div>
|
124
|
+
|
125
|
+
|
126
|
+
</div>
|
127
|
+
|
128
|
+
<div id="method-i-get" class="method-detail ">
|
129
|
+
<div class="method-heading">
|
130
|
+
<span class="method-name">get</span><span
|
131
|
+
class="method-args">(argument)</span>
|
132
|
+
<span class="method-click-advice">click to toggle source</span>
|
133
|
+
</div>
|
134
|
+
|
135
|
+
<div class="method-description">
|
136
|
+
|
137
|
+
|
138
|
+
<div class="method-source-code" id="get-source">
|
139
|
+
<pre><span class="ruby-comment"># File lib/cli.rb, line 110</span>
|
140
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">get</span>(<span class="ruby-identifier">argument</span>)
|
141
|
+
<span class="ruby-identifier">send</span>(<span class="ruby-identifier">argument</span>.<span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_s</span>)
|
142
|
+
<span class="ruby-keyword">end</span></pre>
|
143
|
+
</div>
|
144
|
+
</div>
|
145
|
+
|
146
|
+
|
147
|
+
</div>
|
148
|
+
|
149
|
+
<div id="method-i-set" class="method-detail ">
|
150
|
+
<div class="method-heading">
|
151
|
+
<span class="method-name">set</span><span
|
152
|
+
class="method-args">(argument)</span>
|
153
|
+
<span class="method-click-advice">click to toggle source</span>
|
154
|
+
</div>
|
155
|
+
|
156
|
+
<div class="method-description">
|
157
|
+
|
158
|
+
|
159
|
+
<div class="method-source-code" id="set-source">
|
160
|
+
<pre><span class="ruby-comment"># File lib/cli.rb, line 106</span>
|
161
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">set</span>(<span class="ruby-identifier">argument</span>)
|
162
|
+
<span class="ruby-identifier">value</span>(<span class="ruby-identifier">argument</span>, <span class="ruby-keyword">true</span>)
|
163
|
+
<span class="ruby-keyword">end</span></pre>
|
164
|
+
</div>
|
165
|
+
</div>
|
166
|
+
|
167
|
+
|
168
|
+
</div>
|
169
|
+
|
170
|
+
<div id="method-i-value" class="method-detail ">
|
171
|
+
<div class="method-heading">
|
172
|
+
<span class="method-name">value</span><span
|
173
|
+
class="method-args">(argument, value)</span>
|
174
|
+
<span class="method-click-advice">click to toggle source</span>
|
175
|
+
</div>
|
176
|
+
|
177
|
+
<div class="method-description">
|
178
|
+
|
179
|
+
|
180
|
+
<div class="method-source-code" id="value-source">
|
181
|
+
<pre><span class="ruby-comment"># File lib/cli.rb, line 96</span>
|
182
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">value</span>(<span class="ruby-identifier">argument</span>, <span class="ruby-identifier">value</span>)
|
183
|
+
<span class="ruby-identifier">send</span>((<span class="ruby-identifier">argument</span>.<span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">+</span> <span class="ruby-string">'='</span>).<span class="ruby-identifier">to_sym</span>, <span class="ruby-identifier">value</span>)
|
184
|
+
<span class="ruby-keyword">end</span></pre>
|
185
|
+
</div>
|
186
|
+
</div>
|
187
|
+
|
188
|
+
|
189
|
+
</div>
|
190
|
+
|
191
|
+
</section>
|
192
|
+
|
193
|
+
</section>
|
194
|
+
</main>
|
195
|
+
|
196
|
+
|
197
|
+
<footer id="validator-badges" role="contentinfo">
|
198
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
199
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.
|
200
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
201
|
+
</footer>
|
202
|
+
|