term_utils 0.3.2 → 0.5.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 +16 -2
- data/COPYING +3 -3
- data/README.md +51 -16
- data/Rakefile +6 -0
- data/doc/TermUtils/AP/Article.html +57 -55
- data/doc/TermUtils/AP/ArticleResult.html +584 -0
- data/doc/TermUtils/AP/Flag.html +295 -78
- data/doc/TermUtils/AP/Parameter.html +891 -103
- data/doc/TermUtils/AP/ParameterResult.html +980 -0
- data/doc/TermUtils/{FF/Cursor/Context.html → AP/ParameterWalkerHooks.html} +60 -60
- data/doc/TermUtils/AP/ParseError.html +651 -19
- data/doc/TermUtils/AP/Parser.html +181 -121
- data/doc/TermUtils/AP/Result.html +201 -528
- data/doc/TermUtils/AP/Syntax.html +103 -393
- data/doc/TermUtils/AP/SyntaxError.html +9 -91
- data/doc/TermUtils/AP/Walker.html +686 -0
- data/doc/TermUtils/AP.html +49 -160
- data/doc/TermUtils/FF/Config.html +203 -35
- data/doc/TermUtils/FF/Context.html +585 -0
- data/doc/TermUtils/FF/Entry.html +626 -0
- data/doc/TermUtils/FF/Finder.html +850 -0
- data/doc/TermUtils/FF/{Cursor.html → FinderEntry.html} +473 -211
- data/doc/TermUtils/FF/FinderQuery.html +946 -0
- data/doc/TermUtils/FF/Query.html +402 -70
- data/doc/TermUtils/FF.html +135 -11
- data/doc/TermUtils/PropertyTreeNode.html +304 -190
- data/doc/TermUtils/Tab/Column.html +98 -96
- data/doc/TermUtils/Tab/Header.html +30 -30
- data/doc/TermUtils/Tab/Holder.html +81 -81
- data/doc/TermUtils/Tab/Printer.html +43 -43
- data/doc/TermUtils/Tab/Table.html +124 -128
- data/doc/TermUtils/Tab/TableError.html +7 -89
- data/doc/TermUtils/Tab.html +93 -86
- data/doc/TermUtils.html +10 -10
- data/doc/_index.html +62 -42
- data/doc/class_list.html +3 -3
- data/doc/css/style.css +3 -2
- data/doc/file.README.html +63 -26
- data/doc/file_list.html +2 -2
- data/doc/frames.html +2 -2
- data/doc/index.html +63 -26
- data/doc/js/app.js +14 -3
- data/doc/method_list.html +708 -236
- data/doc/top-level-namespace.html +7 -7
- data/lib/term_utils/ap/article.rb +15 -9
- data/lib/term_utils/ap/flag.rb +37 -20
- data/lib/term_utils/ap/parameter.rb +88 -19
- data/lib/term_utils/ap/parser.rb +143 -116
- data/lib/term_utils/ap/result.rb +208 -161
- data/lib/term_utils/ap/syntax.rb +53 -69
- data/lib/term_utils/ap.rb +79 -24
- data/lib/term_utils/ff/config.rb +22 -10
- data/lib/term_utils/{ap/no_such_value_error.rb → ff/entry.rb} +26 -8
- data/lib/term_utils/ff/finder.rb +255 -0
- data/lib/term_utils/ff/query.rb +94 -17
- data/lib/term_utils/ff.rb +12 -2
- data/lib/term_utils/property_tree_node.rb +47 -19
- data/lib/term_utils/tab.rb +106 -61
- data/lib/term_utils.rb +8 -1
- data/term_utils.gemspec +4 -4
- metadata +18 -17
- data/doc/TermUtils/AP/Element.html +0 -1025
- data/doc/TermUtils/AP/Level.html +0 -638
- data/doc/TermUtils/AP/NoSuchValueError.html +0 -217
- 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
data/doc/index.html
CHANGED
@@ -6,15 +6,15 @@
|
|
6
6
|
<title>
|
7
7
|
File: README
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.34
|
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 = "README";
|
19
19
|
relpath = '';
|
20
20
|
</script>
|
@@ -57,25 +57,66 @@
|
|
57
57
|
<div class="clear"></div>
|
58
58
|
</div>
|
59
59
|
|
60
|
-
<div id="content"><div id='filecontents'>
|
61
|
-
<h1 id="label-term_utils">term_utils</h1>
|
60
|
+
<div id="content"><div id='filecontents'><h1 id="termutils">term_utils</h1>
|
62
61
|
|
63
|
-
<
|
62
|
+
<h2 id="purpose">Purpose</h2>
|
64
63
|
|
65
|
-
<
|
64
|
+
<p>Provides utilities like argument parsing, table formatting and file finding.</p>
|
66
65
|
|
67
|
-
<
|
66
|
+
<h2 id="getting-started">Getting Started</h2>
|
68
67
|
|
69
|
-
<
|
68
|
+
<p>Install term_utils at the command prompt:</p>
|
70
69
|
|
71
|
-
<
|
70
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_gem'>gem</span> <span class='id identifier rubyid_install'>install</span> <span class='id identifier rubyid_term_utils'>term_utils</span>
|
71
|
+
</code></pre>
|
72
|
+
|
73
|
+
<p>Require term_utils in the source file:</p>
|
74
|
+
|
75
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>term_utils</span><span class='tstring_end'>'</span></span>
|
76
|
+
</code></pre>
|
77
|
+
|
78
|
+
<h2 id="content">Content</h2>
|
79
|
+
|
80
|
+
<h3 id="argument-parsing">Argument Parsing</h3>
|
81
|
+
|
82
|
+
<p>Exmaple:</p>
|
83
|
+
|
84
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>term_utils/ap</span><span class='tstring_end'>'</span></span>
|
85
|
+
<span class='id identifier rubyid_syntax'>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="TermUtils/AP.html" title="TermUtils::AP (module)">AP</a></span></span><span class='period'>.</span><span class='id identifier rubyid_create_syntax'><span class='object_link'><a href="TermUtils/AP.html#create_syntax-class_method" title="TermUtils::AP.create_syntax (method)">create_syntax</a></span></span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_s'>s</span><span class='op'>|</span>
|
86
|
+
<span class='id identifier rubyid_s'>s</span><span class='period'>.</span><span class='id identifier rubyid_define_parameter'>define_parameter</span> <span class='symbol'>:limit</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_p'>p</span><span class='op'>|</span>
|
87
|
+
<span class='id identifier rubyid_p'>p</span><span class='period'>.</span><span class='id identifier rubyid_define_flag'>define_flag</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>-l</span><span class='tstring_end'>'</span></span>
|
88
|
+
<span class='id identifier rubyid_p'>p</span><span class='period'>.</span><span class='id identifier rubyid_define_article'>define_article</span>
|
89
|
+
<span class='kw'>end</span>
|
90
|
+
<span class='id identifier rubyid_s'>s</span><span class='period'>.</span><span class='id identifier rubyid_define_parameter'>define_parameter</span> <span class='symbol'>:path</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_p'>p</span><span class='op'>|</span>
|
91
|
+
<span class='id identifier rubyid_p'>p</span><span class='period'>.</span><span class='id identifier rubyid_max_occurs'>max_occurs</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
92
|
+
<span class='id identifier rubyid_p'>p</span><span class='period'>.</span><span class='id identifier rubyid_define_article'>define_article</span>
|
93
|
+
<span class='kw'>end</span>
|
94
|
+
<span class='kw'>end</span>
|
95
|
+
<span class='id identifier rubyid_limit'>limit</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
96
|
+
<span class='id identifier rubyid_paths'>paths</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
97
|
+
<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="TermUtils/AP.html" title="TermUtils::AP (module)">AP</a></span></span><span class='period'>.</span><span class='id identifier rubyid_parse_arguments'><span class='object_link'><a href="TermUtils/AP.html#parse_arguments-class_method" title="TermUtils::AP.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='const'>ARGV</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_on'>on</span><span class='op'>|</span>
|
98
|
+
<span class='id identifier rubyid_on'>on</span><span class='period'>.</span><span class='id identifier rubyid_parameter'>parameter</span> <span class='symbol'>:limit</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_p'>p</span><span class='op'>|</span>
|
99
|
+
<span class='id identifier rubyid_limit'>limit</span> <span class='op'>=</span> <span class='id identifier rubyid_p'>p</span><span class='period'>.</span><span class='id identifier rubyid_value'>value</span>
|
100
|
+
<span class='kw'>end</span>
|
101
|
+
<span class='id identifier rubyid_on'>on</span><span class='period'>.</span><span class='id identifier rubyid_parameter'>parameter</span> <span class='symbol'>:path</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_p'>p</span><span class='op'>|</span>
|
102
|
+
<span class='id identifier rubyid_paths'>paths</span> <span class='op'><<</span> <span class='id identifier rubyid_p'>p</span><span class='period'>.</span><span class='id identifier rubyid_value'>value</span>
|
103
|
+
<span class='kw'>end</span>
|
104
|
+
<span class='kw'>end</span>
|
105
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>limit: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_limit'>limit</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
106
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>paths:</span><span class='tstring_end'>"</span></span>
|
107
|
+
<span class='id identifier rubyid_paths'>paths</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_p'>p</span><span class='op'>|</span> <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_p'>p</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span> <span class='rbrace'>}</span>
|
108
|
+
</code></pre>
|
109
|
+
|
110
|
+
<p>See the <a href="manual/ARGUMENT_PARSING.md">manual</a> for more details.</p>
|
111
|
+
|
112
|
+
<h3 id="table-formatting">Table Formatting</h3>
|
72
113
|
|
73
114
|
<p>Take the following table:</p>
|
74
115
|
|
75
|
-
<pre class="code ruby"><code class="ruby"> id string8 string16
|
116
|
+
<pre class="code ruby"><code class="ruby"> id string8 string16
|
76
117
|
---- -------- ----------------
|
77
|
-
1 Fiat Lux Fiat Lux
|
78
|
-
2 Alea ... Alea jacta est
|
118
|
+
1 Fiat Lux Fiat Lux
|
119
|
+
2 Alea ... Alea jacta est
|
79
120
|
3 Audac... Audaces fortuna juvat
|
80
121
|
---- -------- ----------------
|
81
122
|
id string8 string16
|
@@ -109,27 +150,23 @@
|
|
109
150
|
<span class='kw'>end</span>
|
110
151
|
</code></pre>
|
111
152
|
|
112
|
-
<h3 id="
|
113
|
-
|
114
|
-
<p>The Argument Parsing module provides a way to parse command line arguments.</p>
|
115
|
-
|
116
|
-
<p>See Samples.</p>
|
153
|
+
<h3 id="file-finding">File Finding</h3>
|
117
154
|
|
118
|
-
<
|
155
|
+
<p>The File Finding module provides a way to query the filesystem.</p>
|
119
156
|
|
120
|
-
<
|
157
|
+
<h2 id="version-history">Version History</h2>
|
121
158
|
|
122
|
-
<p>
|
159
|
+
<p><a href="CHANGELOG.md">CHANGELOG</a></p>
|
123
160
|
|
124
|
-
<h2 id="
|
161
|
+
<h2 id="license">License</h2>
|
125
162
|
|
126
163
|
<p>GPL-3.0-only.</p>
|
127
164
|
</div></div>
|
128
165
|
|
129
166
|
<div id="footer">
|
130
|
-
Generated on
|
131
|
-
<a href="
|
132
|
-
0.9.
|
167
|
+
Generated on Wed Aug 9 17:34:25 2023 by
|
168
|
+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
169
|
+
0.9.34 (ruby-3.2.2).
|
133
170
|
</div>
|
134
171
|
|
135
172
|
</div>
|
data/doc/js/app.js
CHANGED
@@ -171,6 +171,7 @@ function generateTOC() {
|
|
171
171
|
var counter = 0;
|
172
172
|
var tags = ['h2', 'h3', 'h4', 'h5', 'h6'];
|
173
173
|
var i;
|
174
|
+
var curli;
|
174
175
|
if ($('#filecontents h1').length > 1) tags.unshift('h1');
|
175
176
|
for (i = 0; i < tags.length; i++) { tags[i] = '#filecontents ' + tags[i]; }
|
176
177
|
var lastTag = parseInt(tags[0][1], 10);
|
@@ -190,15 +191,25 @@ function generateTOC() {
|
|
190
191
|
}
|
191
192
|
if (thisTag > lastTag) {
|
192
193
|
for (i = 0; i < thisTag - lastTag; i++) {
|
193
|
-
|
194
|
+
if ( typeof(curli) == "undefined" ) {
|
195
|
+
curli = $('<li/>');
|
196
|
+
toc.append(curli);
|
197
|
+
}
|
198
|
+
toc = $('<ol/>');
|
199
|
+
curli.append(toc);
|
200
|
+
curli = undefined;
|
194
201
|
}
|
195
202
|
}
|
196
203
|
if (thisTag < lastTag) {
|
197
|
-
for (i = 0; i < lastTag - thisTag; i++)
|
204
|
+
for (i = 0; i < lastTag - thisTag; i++) {
|
205
|
+
toc = toc.parent();
|
206
|
+
toc = toc.parent();
|
207
|
+
}
|
198
208
|
}
|
199
209
|
var title = $(this).attr('toc-title');
|
200
210
|
if (typeof(title) == "undefined") title = $(this).text();
|
201
|
-
|
211
|
+
curli =$('<li><a href="#' + this.id + '">' + title + '</a></li>');
|
212
|
+
toc.append(curli);
|
202
213
|
lastTag = thisTag;
|
203
214
|
});
|
204
215
|
if (!show) return;
|