term_utils 0.3.2 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -2
- data/COPYING +3 -3
- data/README.md +51 -16
- data/doc/TermUtils.html +9 -9
- data/doc/TermUtils/AP.html +48 -159
- data/doc/TermUtils/AP/Article.html +48 -46
- data/doc/TermUtils/AP/ArticleResult.html +584 -0
- data/doc/TermUtils/AP/Flag.html +294 -77
- data/doc/TermUtils/AP/NoSuchValueError.html +13 -13
- data/doc/TermUtils/AP/Parameter.html +885 -97
- data/doc/TermUtils/AP/ParameterResult.html +980 -0
- data/doc/TermUtils/{FF/Cursor/Context.html → AP/ParameterWalkerHooks.html} +59 -59
- data/doc/TermUtils/AP/ParseError.html +13 -13
- data/doc/TermUtils/AP/Parser.html +174 -142
- data/doc/TermUtils/AP/Result.html +200 -527
- data/doc/TermUtils/AP/Syntax.html +102 -392
- data/doc/TermUtils/AP/SyntaxError.html +13 -13
- data/doc/TermUtils/AP/Walker.html +686 -0
- data/doc/TermUtils/FF.html +10 -10
- data/doc/TermUtils/FF/Config.html +201 -33
- data/doc/TermUtils/FF/Context.html +585 -0
- data/doc/TermUtils/FF/Entry.html +626 -0
- data/doc/TermUtils/FF/Query.html +402 -66
- data/doc/TermUtils/PropertyTreeNode.html +302 -188
- data/doc/TermUtils/Tab.html +90 -83
- data/doc/TermUtils/Tab/Column.html +94 -92
- data/doc/TermUtils/Tab/Header.html +26 -26
- data/doc/TermUtils/Tab/Holder.html +74 -74
- data/doc/TermUtils/Tab/Printer.html +42 -42
- data/doc/TermUtils/Tab/Table.html +124 -128
- data/doc/TermUtils/Tab/TableError.html +11 -11
- data/doc/_index.html +48 -34
- data/doc/class_list.html +3 -3
- data/doc/css/style.css +2 -2
- data/doc/file.README.html +64 -31
- data/doc/file_list.html +2 -2
- data/doc/frames.html +2 -2
- data/doc/index.html +64 -31
- data/doc/js/app.js +14 -3
- data/doc/method_list.html +387 -211
- data/doc/top-level-namespace.html +6 -6
- data/lib/term_utils.rb +8 -1
- data/lib/term_utils/ap.rb +41 -30
- data/lib/term_utils/ap/article.rb +14 -8
- data/lib/term_utils/ap/flag.rb +36 -19
- data/lib/term_utils/ap/parameter.rb +87 -18
- data/lib/term_utils/ap/parser.rb +141 -115
- data/lib/term_utils/ap/result.rb +207 -160
- data/lib/term_utils/ap/syntax.rb +52 -68
- data/lib/term_utils/ff.rb +11 -2
- data/lib/term_utils/ff/config.rb +20 -8
- data/lib/term_utils/{ap/no_such_value_error.rb → ff/entry.rb} +25 -7
- data/lib/term_utils/ff/query.rb +93 -14
- data/lib/term_utils/property_tree_node.rb +47 -19
- data/lib/term_utils/tab.rb +102 -58
- data/term_utils.gemspec +4 -4
- metadata +12 -14
- data/doc/TermUtils/AP/Element.html +0 -1025
- data/doc/TermUtils/AP/Level.html +0 -638
- data/doc/TermUtils/FF/Cursor.html +0 -929
- data/lib/term_utils/ap/element.rb +0 -78
- data/lib/term_utils/ap/level.rb +0 -57
- data/lib/term_utils/ap/parse_error.rb +0 -27
- data/lib/term_utils/ap/syntax_error.rb +0 -27
- data/lib/term_utils/ff/cursor.rb +0 -153
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 37a52bdf0564e80160cccb4745fd96a1a0c125e33d9037dcfc48884e69e113d6
|
4
|
+
data.tar.gz: 7a96fb5e605531f440be0a3c4215a8d40da4a91b83b667d150f1ca6e642c6511
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7cc4fe24ebd4fd5b86172007c8ec0cdbd6b72b0e5709ac378c64e6895733b972f637f40d50d24f992a717ff4ad9bc9b2c2c102e46d204a5353aa1580b19841f
|
7
|
+
data.tar.gz: aeeab30291f4b37c89cef7ce8756b39d4935f74035b8834e8a5efd6a955da125a3db5013f1affdc4ec8879fc5ab99ffd23a58a623bf6a3137b609367c233daa6
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,11 @@
|
|
1
|
-
#
|
1
|
+
# term_utils - Changelog
|
2
|
+
|
3
|
+
### 0.4.0 - 2020-08-02
|
4
|
+
|
5
|
+
### Changed
|
6
|
+
|
7
|
+
- Changed AP API.
|
8
|
+
- Changed FF API.
|
2
9
|
|
3
10
|
## 0.3.2 - 2020-02-07
|
4
11
|
|
@@ -41,4 +48,4 @@
|
|
41
48
|
|
42
49
|
### Added
|
43
50
|
|
44
|
-
- Initial base code.
|
51
|
+
- Initial base code.
|
data/COPYING
CHANGED
@@ -631,8 +631,8 @@ to attach them to the start of each source file to most effectively
|
|
631
631
|
state the exclusion of warranty; and each file should have at least
|
632
632
|
the "copyright" line and a pointer to where the full notice is found.
|
633
633
|
|
634
|
-
term_utils
|
635
|
-
Copyright (C)
|
634
|
+
term_utils provides utilities for terminal application.
|
635
|
+
Copyright (C) 2020 Thomas Baron
|
636
636
|
|
637
637
|
This program is free software: you can redistribute it and/or modify
|
638
638
|
it under the terms of the GNU General Public License as published by
|
@@ -652,7 +652,7 @@ Also add information on how to contact you by electronic and paper mail.
|
|
652
652
|
If the program does terminal interaction, make it output a short
|
653
653
|
notice like this when it starts in an interactive mode:
|
654
654
|
|
655
|
-
term_utils Copyright (C)
|
655
|
+
term_utils Copyright (C) 2020 Thomas Baron
|
656
656
|
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
657
657
|
This is free software, and you are welcome to redistribute it
|
658
658
|
under certain conditions; type `show c' for details.
|
data/README.md
CHANGED
@@ -1,24 +1,63 @@
|
|
1
1
|
# term_utils
|
2
2
|
|
3
|
-
Terminal utilities for ruby.
|
4
|
-
|
5
3
|
## Purpose
|
6
4
|
|
7
|
-
Provides
|
5
|
+
Provides utilities like argument parsing, table formatting and file finding.
|
6
|
+
|
7
|
+
## Getting Started
|
8
|
+
|
9
|
+
Install term_utils at the command prompt:
|
10
|
+
|
11
|
+
gem install term_utils
|
12
|
+
|
13
|
+
Require term_utils in the source file:
|
14
|
+
|
15
|
+
require 'term_utils'
|
8
16
|
|
9
17
|
## Content
|
10
18
|
|
11
|
-
###
|
19
|
+
### Argument Parsing
|
20
|
+
|
21
|
+
Exmaple:
|
22
|
+
|
23
|
+
require 'term_utils/ap'
|
24
|
+
syntax = TermUtils::AP.create_syntax do |s|
|
25
|
+
s.define_parameter :limit do |p|
|
26
|
+
p.define_flag '-l'
|
27
|
+
p.define_article
|
28
|
+
end
|
29
|
+
s.define_parameter :path do |p|
|
30
|
+
p.max_occurs = nil
|
31
|
+
p.define_article
|
32
|
+
end
|
33
|
+
end
|
34
|
+
limit = nil
|
35
|
+
paths = []
|
36
|
+
TermUtils::AP.parse_arguments(syntax, ARGV) do |on|
|
37
|
+
on.parameter :limit do |p|
|
38
|
+
limit = p.value
|
39
|
+
end
|
40
|
+
on.parameter :path do |p|
|
41
|
+
paths << p.value
|
42
|
+
end
|
43
|
+
end
|
44
|
+
puts "limit: #{limit}"
|
45
|
+
puts "paths:"
|
46
|
+
paths.each { |p| puts " #{p}" }
|
47
|
+
|
48
|
+
See the [manual](manual/ARGUMENT_PARSING.md) for more details.
|
49
|
+
|
50
|
+
### Table Formatting
|
12
51
|
|
13
52
|
Take the following table:
|
14
53
|
|
15
|
-
id string8 string16
|
54
|
+
id string8 string16
|
16
55
|
---- -------- ----------------
|
17
|
-
1 Fiat Lux Fiat Lux
|
18
|
-
2 Alea ... Alea jacta est
|
56
|
+
1 Fiat Lux Fiat Lux
|
57
|
+
2 Alea ... Alea jacta est
|
19
58
|
3 Audac... Audaces fortuna juvat
|
20
59
|
---- -------- ----------------
|
21
|
-
id string8 string16
|
60
|
+
id string8 string16
|
22
61
|
|
23
62
|
You can produce it with the following code:
|
24
63
|
|
@@ -47,17 +86,13 @@ You can produce it with the following code:
|
|
47
86
|
tpr.line
|
48
87
|
end
|
49
88
|
|
50
|
-
###
|
51
|
-
|
52
|
-
The Argument Parsing module provides a way to parse command line arguments.
|
53
|
-
|
54
|
-
See Samples.
|
89
|
+
### File Finding
|
55
90
|
|
56
|
-
|
91
|
+
The File Finding module provides a way to query the filesystem.
|
57
92
|
|
58
|
-
|
93
|
+
## Version History
|
59
94
|
|
60
|
-
|
95
|
+
[CHANGELOG](CHANGELOG.md)
|
61
96
|
|
62
97
|
## License
|
63
98
|
|
data/doc/TermUtils.html
CHANGED
@@ -6,15 +6,15 @@
|
|
6
6
|
<title>
|
7
7
|
Module: TermUtils
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.25
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
13
|
-
<link rel="stylesheet" href="css/style.css" type="text/css"
|
13
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" />
|
14
14
|
|
15
|
-
<link rel="stylesheet" href="css/common.css" type="text/css"
|
15
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" />
|
16
16
|
|
17
|
-
<script type="text/javascript"
|
17
|
+
<script type="text/javascript">
|
18
18
|
pathId = "TermUtils";
|
19
19
|
relpath = '';
|
20
20
|
</script>
|
@@ -78,8 +78,8 @@
|
|
78
78
|
|
79
79
|
<dl>
|
80
80
|
<dt>Defined in:</dt>
|
81
|
-
<dd>lib/term_utils
|
82
|
-
lib/term_utils/ap.rb,<br /> lib/term_utils/
|
81
|
+
<dd>lib/term_utils.rb<span class="defines">,<br />
|
82
|
+
lib/term_utils/ap.rb,<br /> lib/term_utils/ff.rb,<br /> lib/term_utils/tab.rb,<br /> lib/term_utils/ap/flag.rb,<br /> lib/term_utils/ff/entry.rb,<br /> lib/term_utils/ff/query.rb,<br /> lib/term_utils/ap/parser.rb,<br /> lib/term_utils/ap/result.rb,<br /> lib/term_utils/ap/syntax.rb,<br /> lib/term_utils/ff/config.rb,<br /> lib/term_utils/ap/article.rb,<br /> lib/term_utils/ap/parameter.rb,<br /> lib/term_utils/property_tree_node.rb</span>
|
83
83
|
</dd>
|
84
84
|
</dl>
|
85
85
|
|
@@ -88,7 +88,7 @@
|
|
88
88
|
<h2>Overview</h2><div class="docstring">
|
89
89
|
<div class="discussion">
|
90
90
|
|
91
|
-
<p>Copyright (C)
|
91
|
+
<p>Copyright (C) 2020 Thomas Baron</p>
|
92
92
|
|
93
93
|
<p>This file is part of term_utils.</p>
|
94
94
|
|
@@ -128,9 +128,9 @@
|
|
128
128
|
</div>
|
129
129
|
|
130
130
|
<div id="footer">
|
131
|
-
Generated on
|
131
|
+
Generated on Sun Aug 2 18:35:09 2020 by
|
132
132
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
133
|
-
0.9.
|
133
|
+
0.9.25 (ruby-2.6.5).
|
134
134
|
</div>
|
135
135
|
|
136
136
|
</div>
|
data/doc/TermUtils/AP.html
CHANGED
@@ -6,15 +6,15 @@
|
|
6
6
|
<title>
|
7
7
|
Module: TermUtils::AP
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.25
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
13
|
-
<link rel="stylesheet" href="../css/style.css" type="text/css"
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" />
|
14
14
|
|
15
|
-
<link rel="stylesheet" href="../css/common.css" type="text/css"
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" />
|
16
16
|
|
17
|
-
<script type="text/javascript"
|
17
|
+
<script type="text/javascript">
|
18
18
|
pathId = "TermUtils::AP";
|
19
19
|
relpath = '../';
|
20
20
|
</script>
|
@@ -79,7 +79,7 @@
|
|
79
79
|
<dl>
|
80
80
|
<dt>Defined in:</dt>
|
81
81
|
<dd>lib/term_utils/ap.rb<span class="defines">,<br />
|
82
|
-
lib/term_utils/ap/flag.rb,<br /> lib/term_utils/ap/
|
82
|
+
lib/term_utils/ap/flag.rb,<br /> lib/term_utils/ap/parser.rb,<br /> lib/term_utils/ap/result.rb,<br /> lib/term_utils/ap/syntax.rb,<br /> lib/term_utils/ap/article.rb,<br /> lib/term_utils/ap/parameter.rb</span>
|
83
83
|
</dd>
|
84
84
|
</dl>
|
85
85
|
|
@@ -88,7 +88,7 @@
|
|
88
88
|
<h2>Overview</h2><div class="docstring">
|
89
89
|
<div class="discussion">
|
90
90
|
|
91
|
-
<p>The Argument Parser module provides a way to parse
|
91
|
+
<p>The Argument Parser module provides a way to parse arguments.</p>
|
92
92
|
|
93
93
|
|
94
94
|
</div>
|
@@ -102,7 +102,7 @@
|
|
102
102
|
|
103
103
|
|
104
104
|
|
105
|
-
<strong class="classes">Classes:</strong> <span class='object_link'><a href="AP/Article.html" title="TermUtils::AP::Article (class)">Article</a></span>, <span class='object_link'><a href="AP/
|
105
|
+
<strong class="classes">Classes:</strong> <span class='object_link'><a href="AP/Article.html" title="TermUtils::AP::Article (class)">Article</a></span>, <span class='object_link'><a href="AP/ArticleResult.html" title="TermUtils::AP::ArticleResult (class)">ArticleResult</a></span>, <span class='object_link'><a href="AP/Flag.html" title="TermUtils::AP::Flag (class)">Flag</a></span>, <span class='object_link'><a href="AP/NoSuchValueError.html" title="TermUtils::AP::NoSuchValueError (class)">NoSuchValueError</a></span>, <span class='object_link'><a href="AP/Parameter.html" title="TermUtils::AP::Parameter (class)">Parameter</a></span>, <span class='object_link'><a href="AP/ParameterResult.html" title="TermUtils::AP::ParameterResult (class)">ParameterResult</a></span>, <span class='object_link'><a href="AP/ParameterWalkerHooks.html" title="TermUtils::AP::ParameterWalkerHooks (class)">ParameterWalkerHooks</a></span>, <span class='object_link'><a href="AP/ParseError.html" title="TermUtils::AP::ParseError (class)">ParseError</a></span>, <span class='object_link'><a href="AP/Parser.html" title="TermUtils::AP::Parser (class)">Parser</a></span>, <span class='object_link'><a href="AP/Result.html" title="TermUtils::AP::Result (class)">Result</a></span>, <span class='object_link'><a href="AP/Syntax.html" title="TermUtils::AP::Syntax (class)">Syntax</a></span>, <span class='object_link'><a href="AP/SyntaxError.html" title="TermUtils::AP::SyntaxError (class)">SyntaxError</a></span>, <span class='object_link'><a href="AP/Walker.html" title="TermUtils::AP::Walker (class)">Walker</a></span>
|
106
106
|
|
107
107
|
|
108
108
|
</p>
|
@@ -148,7 +148,7 @@
|
|
148
148
|
<li class="public ">
|
149
149
|
<span class="summary_signature">
|
150
150
|
|
151
|
-
<a href="#parse_arguments-class_method" title="parse_arguments (class method)">.<strong>parse_arguments</strong>(syntax, arguments, opts = {}) ⇒
|
151
|
+
<a href="#parse_arguments-class_method" title="parse_arguments (class method)">.<strong>parse_arguments</strong>(syntax, arguments, opts = {}, &block) ⇒ Result </a>
|
152
152
|
|
153
153
|
|
154
154
|
|
@@ -166,30 +166,6 @@
|
|
166
166
|
<p>Parses a given list of arguments.</p>
|
167
167
|
</div></span>
|
168
168
|
|
169
|
-
</li>
|
170
|
-
|
171
|
-
|
172
|
-
<li class="public ">
|
173
|
-
<span class="summary_signature">
|
174
|
-
|
175
|
-
<a href="#parse_command-class_method" title="parse_command (class method)">.<strong>parse_command</strong>(syntax, command, opts = {}) ⇒ TermUtils::AP::Result </a>
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
</span>
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
<span class="summary_desc"><div class='inline'>
|
190
|
-
<p>Parses a given command.</p>
|
191
|
-
</div></span>
|
192
|
-
|
193
169
|
</li>
|
194
170
|
|
195
171
|
|
@@ -241,14 +217,14 @@
|
|
241
217
|
<pre class="lines">
|
242
218
|
|
243
219
|
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
220
|
+
45
|
221
|
+
46
|
222
|
+
47
|
223
|
+
48
|
224
|
+
49</pre>
|
249
225
|
</td>
|
250
226
|
<td>
|
251
|
-
<pre class="code"><span class="info file"># File 'lib/term_utils/ap.rb', line
|
227
|
+
<pre class="code"><span class="info file"># File 'lib/term_utils/ap.rb', line 45</span>
|
252
228
|
|
253
229
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_create_syntax'>create_syntax</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
254
230
|
<span class='id identifier rubyid_new_syntax'>new_syntax</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../TermUtils.html" title="TermUtils (module)">TermUtils</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="TermUtils::AP (module)">AP</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="AP/Syntax.html" title="TermUtils::AP::Syntax (class)">Syntax</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="AP/Syntax.html#initialize-instance_method" title="TermUtils::AP::Syntax#initialize (method)">new</a></span></span>
|
@@ -263,7 +239,7 @@
|
|
263
239
|
<div class="method_details ">
|
264
240
|
<h3 class="signature " id="parse_arguments-class_method">
|
265
241
|
|
266
|
-
.<strong>parse_arguments</strong>(syntax, arguments, opts = {}) ⇒ <tt><span class='object_link'><a href="AP/Result.html" title="TermUtils::AP::Result (class)">
|
242
|
+
.<strong>parse_arguments</strong>(syntax, arguments, opts = {}, &block) ⇒ <tt><span class='object_link'><a href="AP/Result.html" title="TermUtils::AP::Result (class)">Result</a></span></tt>
|
267
243
|
|
268
244
|
|
269
245
|
|
@@ -286,7 +262,7 @@
|
|
286
262
|
<span class='name'>syntax</span>
|
287
263
|
|
288
264
|
|
289
|
-
<span class='type'>(<tt><span class='object_link'><a href="AP/Syntax.html" title="TermUtils::AP::Syntax (class)">
|
265
|
+
<span class='type'>(<tt><span class='object_link'><a href="AP/Syntax.html" title="TermUtils::AP::Syntax (class)">Syntax</a></span></tt>)</span>
|
290
266
|
|
291
267
|
|
292
268
|
|
@@ -318,120 +294,33 @@
|
|
318
294
|
|
319
295
|
</ul>
|
320
296
|
|
321
|
-
<p class="tag_title">Returns:</p>
|
322
|
-
<ul class="return">
|
323
297
|
|
324
|
-
<li>
|
325
|
-
|
326
|
-
|
327
|
-
<span class='type'>(<tt><span class='object_link'><a href="AP/Result.html" title="TermUtils::AP::Result (class)">TermUtils::AP::Result</a></span></tt>)</span>
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
</li>
|
332
|
-
|
333
|
-
</ul>
|
334
|
-
<p class="tag_title">Raises:</p>
|
335
|
-
<ul class="raise">
|
336
|
-
|
337
|
-
<li>
|
338
|
-
|
339
|
-
|
340
|
-
<span class='type'>(<tt><span class='object_link'><a href="AP/ParseError.html" title="TermUtils::AP::ParseError (class)">TermUtils::AP::ParseError</a></span></tt>)</span>
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
</li>
|
345
|
-
|
346
|
-
<li>
|
347
|
-
|
348
|
-
|
349
|
-
<span class='type'>(<tt><span class='object_link'><a href="AP/SyntaxError.html" title="TermUtils::AP::SyntaxError (class)">TermUtils::AP::SyntaxError</a></span></tt>)</span>
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
</li>
|
354
|
-
|
355
|
-
</ul>
|
356
|
-
|
357
|
-
</div><table class="source_code">
|
358
|
-
<tr>
|
359
|
-
<td>
|
360
|
-
<pre class="lines">
|
361
|
-
|
362
|
-
|
363
|
-
55
|
364
|
-
56
|
365
|
-
57</pre>
|
366
|
-
</td>
|
367
|
-
<td>
|
368
|
-
<pre class="code"><span class="info file"># File 'lib/term_utils/ap.rb', line 55</span>
|
369
|
-
|
370
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_parse_arguments'>parse_arguments</span><span class='lparen'>(</span><span class='id identifier rubyid_syntax'>syntax</span><span class='comma'>,</span> <span class='id identifier rubyid_arguments'>arguments</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
371
|
-
<span class='const'><span class='object_link'><a href="../TermUtils.html" title="TermUtils (module)">TermUtils</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="TermUtils::AP (module)">AP</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="AP/Parser.html" title="TermUtils::AP::Parser (class)">Parser</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="AP/Parser.html#initialize-instance_method" title="TermUtils::AP::Parser#initialize (method)">new</a></span></span><span class='period'>.</span><span class='id identifier rubyid_parse_arguments'><span class='object_link'><a href="AP/Parser.html#parse_arguments-instance_method" title="TermUtils::AP::Parser#parse_arguments (method)">parse_arguments</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_syntax'>syntax</span><span class='comma'>,</span> <span class='id identifier rubyid_arguments'>arguments</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span>
|
372
|
-
<span class='kw'>end</span></pre>
|
373
|
-
</td>
|
374
|
-
</tr>
|
375
|
-
</table>
|
376
|
-
</div>
|
377
298
|
|
378
|
-
<div class="method_details ">
|
379
|
-
<h3 class="signature " id="parse_command-class_method">
|
380
|
-
|
381
|
-
.<strong>parse_command</strong>(syntax, command, opts = {}) ⇒ <tt><span class='object_link'><a href="AP/Result.html" title="TermUtils::AP::Result (class)">TermUtils::AP::Result</a></span></tt>
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
</h3><div class="docstring">
|
388
|
-
<div class="discussion">
|
389
299
|
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
300
|
+
|
301
|
+
|
302
|
+
|
303
|
+
|
304
|
+
<p class="tag_title">Options Hash (<tt>opts</tt>):</p>
|
305
|
+
<ul class="option">
|
306
|
+
|
307
|
+
<li>
|
308
|
+
<span class="name">:strict</span>
|
309
|
+
<span class="type">(<tt>Boolean</tt>)</span>
|
310
|
+
<span class="default">
|
311
|
+
|
312
|
+
</span>
|
313
|
+
|
314
|
+
— <div class='inline'>
|
315
|
+
<p>Whether the Syntax must be considered strict.</p>
|
394
316
|
</div>
|
395
|
-
|
396
|
-
|
397
|
-
<ul class="param">
|
398
|
-
|
399
|
-
<li>
|
400
|
-
|
401
|
-
<span class='name'>syntax</span>
|
402
|
-
|
403
|
-
|
404
|
-
<span class='type'>(<tt><span class='object_link'><a href="AP/Syntax.html" title="TermUtils::AP::Syntax (class)">TermUtils::AP::Syntax</a></span></tt>)</span>
|
317
|
+
|
318
|
+
</li>
|
405
319
|
|
406
|
-
|
407
|
-
|
408
|
-
</li>
|
409
|
-
|
410
|
-
<li>
|
411
|
-
|
412
|
-
<span class='name'>command</span>
|
413
|
-
|
414
|
-
|
415
|
-
<span class='type'>(<tt>String</tt>)</span>
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
</li>
|
420
|
-
|
421
|
-
<li>
|
422
|
-
|
423
|
-
<span class='name'>opts</span>
|
424
|
-
|
425
|
-
|
426
|
-
<span class='type'>(<tt>Hash</tt>)</span>
|
427
|
-
|
428
|
-
|
429
|
-
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
430
|
-
|
431
|
-
|
432
|
-
</li>
|
320
|
+
</ul>
|
433
321
|
|
434
|
-
|
322
|
+
|
323
|
+
|
435
324
|
|
436
325
|
<p class="tag_title">Returns:</p>
|
437
326
|
<ul class="return">
|
@@ -439,7 +328,7 @@
|
|
439
328
|
<li>
|
440
329
|
|
441
330
|
|
442
|
-
<span class='type'>(<tt><span class='object_link'><a href="AP/Result.html" title="TermUtils::AP::Result (class)">
|
331
|
+
<span class='type'>(<tt><span class='object_link'><a href="AP/Result.html" title="TermUtils::AP::Result (class)">Result</a></span></tt>)</span>
|
443
332
|
|
444
333
|
|
445
334
|
|
@@ -452,7 +341,7 @@
|
|
452
341
|
<li>
|
453
342
|
|
454
343
|
|
455
|
-
<span class='type'>(<tt><span class='object_link'><a href="AP/ParseError.html" title="TermUtils::AP::ParseError (class)">
|
344
|
+
<span class='type'>(<tt><span class='object_link'><a href="AP/ParseError.html" title="TermUtils::AP::ParseError (class)">ParseError</a></span></tt>)</span>
|
456
345
|
|
457
346
|
|
458
347
|
|
@@ -461,7 +350,7 @@
|
|
461
350
|
<li>
|
462
351
|
|
463
352
|
|
464
|
-
<span class='type'>(<tt><span class='object_link'><a href="AP/SyntaxError.html" title="TermUtils::AP::SyntaxError (class)">
|
353
|
+
<span class='type'>(<tt><span class='object_link'><a href="AP/SyntaxError.html" title="TermUtils::AP::SyntaxError (class)">SyntaxError</a></span></tt>)</span>
|
465
354
|
|
466
355
|
|
467
356
|
|
@@ -475,15 +364,15 @@
|
|
475
364
|
<pre class="lines">
|
476
365
|
|
477
366
|
|
478
|
-
|
479
|
-
|
480
|
-
|
367
|
+
59
|
368
|
+
60
|
369
|
+
61</pre>
|
481
370
|
</td>
|
482
371
|
<td>
|
483
|
-
<pre class="code"><span class="info file"># File 'lib/term_utils/ap.rb', line
|
372
|
+
<pre class="code"><span class="info file"># File 'lib/term_utils/ap.rb', line 59</span>
|
484
373
|
|
485
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier
|
486
|
-
<span class='const'><span class='object_link'><a href="../TermUtils.html" title="TermUtils (module)">TermUtils</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="TermUtils::AP (module)">AP</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="AP/Parser.html" title="TermUtils::AP::Parser (class)">Parser</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="AP/Parser.html#initialize-instance_method" title="TermUtils::AP::Parser#initialize (method)">new</a></span></span><span class='period'>.</span><span class='id identifier
|
374
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_parse_arguments'>parse_arguments</span><span class='lparen'>(</span><span class='id identifier rubyid_syntax'>syntax</span><span class='comma'>,</span> <span class='id identifier rubyid_arguments'>arguments</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
375
|
+
<span class='const'><span class='object_link'><a href="../TermUtils.html" title="TermUtils (module)">TermUtils</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="TermUtils::AP (module)">AP</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="AP/Parser.html" title="TermUtils::AP::Parser (class)">Parser</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="AP/Parser.html#initialize-instance_method" title="TermUtils::AP::Parser#initialize (method)">new</a></span></span><span class='period'>.</span><span class='id identifier rubyid_parse_arguments'><span class='object_link'><a href="AP/Parser.html#parse_arguments-instance_method" title="TermUtils::AP::Parser#parse_arguments (method)">parse_arguments</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_syntax'>syntax</span><span class='comma'>,</span> <span class='id identifier rubyid_arguments'>arguments</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
487
376
|
<span class='kw'>end</span></pre>
|
488
377
|
</td>
|
489
378
|
</tr>
|
@@ -495,9 +384,9 @@
|
|
495
384
|
</div>
|
496
385
|
|
497
386
|
<div id="footer">
|
498
|
-
Generated on
|
387
|
+
Generated on Sun Aug 2 18:35:09 2020 by
|
499
388
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
500
|
-
0.9.
|
389
|
+
0.9.25 (ruby-2.6.5).
|
501
390
|
</div>
|
502
391
|
|
503
392
|
</div>
|