mucgly 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1dfea2d4d0a44528b05456bbd1704cbbd449a232
4
- data.tar.gz: e663a7a7e3815a9dc63b9564730ae738b51a9e87
3
+ metadata.gz: 5cfa79d284e275ab42157047bc80f2fcf41698a9
4
+ data.tar.gz: c24ba9a87c3c465d7694a2cd46e4169d362a943b
5
5
  SHA512:
6
- metadata.gz: 18654eba88520a6ffed3f834a28916caa5e17df680e4f90b359794f34e199d162d11fdeb25cccf337cf5be3ff8431fa364254fcbf9dac20e76b82be8b4a32b17
7
- data.tar.gz: 013cd857f5d0c5003d86cc2d2f82ea42dea9642ec0c3f2b8a05277b0f3ce974e05e586b1ee5cf542d8c8ab42c514661ba65c2c3ad1773ebc558e63f3094c1417
6
+ metadata.gz: 656bb80bac123cce4fb236aeb374dddfd11961732c8a59b00a190804f4117453163af9d988b1e472f9577891a60a7ef53fa67568bab6beda041dc23616581466
7
+ data.tar.gz: a91653486da910a3a38a6961962d7391a0e2947365e1e0448186afb107937130c9e30049722b36a7bdfe0bd49ee69070b52e8026270429060e33d90eb88c981c
data/CHANGELOG.rdoc CHANGED
@@ -1,5 +1,10 @@
1
1
  = Version history
2
2
 
3
+ [0.2.0] Multihook feature.
4
+ Remote escape feature.
5
+ Block output feature.
6
+ Fix for hook at EOF parsing.
7
+
3
8
  [0.1.1] Documentation updates.
4
9
  Tiny code cleanups.
5
10
  Better test coverage for Mugcly module.
data/README.rdoc CHANGED
@@ -61,6 +61,8 @@ For all command line options, see:
61
61
  * User settable hooks to define macro boundaries. Can be set from
62
62
  command line, configuration files, or from macro input file.
63
63
 
64
+ * Multiple, concurrent macro start and end limiters (multihook).
65
+
64
66
  * Multiple sources for configuration: default config, environment
65
67
  variable, command line.
66
68
 
@@ -99,8 +101,8 @@ For all command line options, see:
99
101
  === Hooks
100
102
 
101
103
  Hooks start and end the macro definition. By default hookbeg is "-<"
102
- and hookend is ">-". These values are not easily conflicting with
103
- typical macro file body text.
104
+ and hookend is ">-". These values don't conflict easily with typical
105
+ macro file body text.
104
106
 
105
107
  If literal hook string is required in the output, the hookesc sequence
106
108
  should be place before the hook. For example "\\-<" will produce
@@ -118,6 +120,20 @@ hooks, cancel space (" ") output, and cancel newline ("\\n") output.
118
120
 
119
121
  User can set the escape sequence to any character(s).
120
122
 
123
+ === Remote escape
124
+
125
+ hookesc can be used to cancel the newline following the macro. However
126
+ it is sometimes convenient to have "clean" line ending, but still
127
+ cancel the newline. This holds true for example if language sensitive
128
+ editor mode should be respected.
129
+
130
+ If the first character is "+" in the macro body, the character
131
+ following the macro is cancelled from output. "+" is removed silently
132
+ and the rest of the macro body is handled normally.
133
+
134
+ Remote escape is typically used to cancel a newline, since other use
135
+ cases can be handeled by other means.
136
+
121
137
  === Single char hooks and escape
122
138
 
123
139
  If all hooks are single character (including hookesc) and have the
@@ -134,6 +150,20 @@ Hookbeg is detected at "|" if outside macro. Hookend is detected at
134
150
  is not possible, since hookbeg is never detected within macro. The
135
151
  default hook values can be used for nested macros (if desired).
136
152
 
153
+ === Multiple hooks
154
+
155
+ Mucgly allows the user to define multiple hookbeg and hookend
156
+ pairs. This can be done from command line or from Mucgly module
157
+ methods.
158
+
159
+ Any of the possible hookbegs will start an macro, and the
160
+ corresponding hookend pair will terminate the macro. Multiple hooks
161
+ are used as a replacement for single hookbeg and hookend.
162
+
163
+ Multihook mode is entered when first multihook pair is added. This can
164
+ happen multiple times. If a single hook set is performed (again),
165
+ singlehook mode is entered. This can also be used as method for
166
+ resetting the current set of multihooks.
137
167
 
138
168
 
139
169
  == Special commands
@@ -170,6 +200,10 @@ List of ":" style special commands:
170
200
  [comment] Comment is used to add comments into the macro file. No
171
201
  output is produced from comment macros.
172
202
 
203
+ [block] Block output starting with this command, see unblock.
204
+
205
+ [unblock] Unblock output starting with this command, see block.
206
+
173
207
  [source] Source reads a plain Ruby file into the Execution Environment.
174
208
 
175
209
  [hook] Sets both hookbeg and hookend to values separated by
@@ -252,6 +286,9 @@ Complete list of Mucgly module methods:
252
286
 
253
287
  [sethookesc] Set hookesc value.
254
288
 
289
+ [multihook] Define a set of hookbeg/hookend pairs (even number of
290
+ strings in array).
291
+
255
292
  [ifilename] Input file name as String.
256
293
 
257
294
  [ilinenumber] Input file line number.
@@ -262,7 +299,8 @@ Complete list of Mucgly module methods:
262
299
 
263
300
  [pushinput] Makes given file as current input stream. When this stream
264
301
  is runs out (EOF) or is closed (with closeinput), the
265
- input stream is reverted to previous input file.
302
+ input stream is reverted to previous input file. Pushinput
303
+ is same as ":include" command.
266
304
 
267
305
  [closeinput] Close output stream (before EOF is encountered).
268
306
 
@@ -272,6 +310,9 @@ Complete list of Mucgly module methods:
272
310
 
273
311
  [closeoutput] Close output stream.
274
312
 
313
+ [block] Block output starting with this command, see unblock.
314
+
315
+ [unblock] Unblock output starting with this command, see block.
275
316
 
276
317
 
277
318
  == Command line interface
@@ -281,6 +322,9 @@ Please execute:
281
322
 
282
323
  for an overview of the command line options.
283
324
 
325
+ The user must use the same option multiple times in order to enter
326
+ multiple args of the same class.
327
+
284
328
 
285
329
  === Input and Output files
286
330
 
@@ -290,7 +334,8 @@ Mucgly is STDIN.
290
334
  Output file can be defined with "-o" option. The default output stream
291
335
  for Mucgly is STDOUT.
292
336
 
293
- If "-g" option is given, the output file list is created by extracting "-g" option argument value from each input file name.
337
+ If "-g" option is given, the output file list is created by extracting
338
+ "-g" option argument value from each input file name.
294
339
 
295
340
  For example with:
296
341
  mucgly -f foo.rx.txt -f bar.rx.txt -g .rx
data/bin/mucgly CHANGED
@@ -4,4 +4,4 @@ require_relative '../lib/mucgly/mucgly'
4
4
  require_relative '../lib/version'
5
5
 
6
6
  # Send ARGV and add program name as first entry.
7
- Mucgly.run_mucgly( [ __FILE__] + ARGV )
7
+ Mucgly.run_mucgly( [ __FILE__ ] + ARGV )
data/doc/Mucgly.html CHANGED
@@ -92,7 +92,7 @@
92
92
  <dt id="VERSION-constant" class="">VERSION =
93
93
 
94
94
  </dt>
95
- <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>0.1.1</span><span class='tstring_end'>&quot;</span></span></pre></dd>
95
+ <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>0.2.0</span><span class='tstring_end'>&quot;</span></span></pre></dd>
96
96
 
97
97
  </dl>
98
98
 
@@ -177,7 +177,7 @@
177
177
  </div>
178
178
 
179
179
  <div id="footer">
180
- Generated on Sun Apr 5 20:11:53 2015 by
180
+ Generated on Sun Apr 24 19:00:00 2016 by
181
181
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
182
182
  0.8.7.6 (ruby-2.1.2).
183
183
  </div>
data/doc/_index.html CHANGED
@@ -104,7 +104,7 @@
104
104
  </div>
105
105
 
106
106
  <div id="footer">
107
- Generated on Sun Apr 5 20:11:53 2015 by
107
+ Generated on Sun Apr 24 19:00:00 2016 by
108
108
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
109
109
  0.8.7.6 (ruby-2.1.2).
110
110
  </div>
@@ -63,7 +63,11 @@
63
63
 
64
64
  <div id="content"><div id='filecontents'>
65
65
  <h1 id="label-Version+history">Version history</h1>
66
- <dl class="rdoc-list label-list"><dt>0.1.1
66
+ <dl class="rdoc-list label-list"><dt>0.2.0
67
+ <dd>
68
+ <p>Multihook feature. Remote escape feature. Block output feature. Fix for
69
+ hook at EOF parsing.</p>
70
+ </dd><dt>0.1.1
67
71
  <dd>
68
72
  <p>Documentation updates. Tiny code cleanups. Better test coverage for Mugcly
69
73
  module.</p>
@@ -85,7 +89,7 @@ compatible with older versions.</p>
85
89
  </div></div>
86
90
 
87
91
  <div id="footer">
88
- Generated on Sun Apr 5 20:11:53 2015 by
92
+ Generated on Sun Apr 24 19:00:00 2016 by
89
93
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
90
94
  0.8.7.6 (ruby-2.1.2).
91
95
  </div>
data/doc/file.README.html CHANGED
@@ -120,13 +120,16 @@ result. Mucgly module is part of Mucgly.</p>
120
120
 
121
121
  <p>For all command line options, see:</p>
122
122
 
123
- <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_mucgly'>mucgly</span> <span class='op'>-</span><span class='id identifier rubyid_h'>h</span></code></pre>
123
+ <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_mucgly'>mucgly</span> <span class='op'>-</span><span class='id identifier rubyid_h'>h</span>
124
+ </code></pre>
124
125
 
125
126
  <h2 id="label-Features">Features</h2>
126
127
  <ul><li>
127
128
  <p>User settable hooks to define macro boundaries. Can be set from command
128
129
  line, configuration files, or from macro input file.</p>
129
130
  </li><li>
131
+ <p>Multiple, concurrent macro start and end limiters (multihook).</p>
132
+ </li><li>
130
133
  <p>Multiple sources for configuration: default config, environment variable,
131
134
  command line.</p>
132
135
  </li><li>
@@ -163,7 +166,7 @@ command line.</p>
163
166
  <h3 id="label-Hooks">Hooks</h3>
164
167
 
165
168
  <p>Hooks start and end the macro definition. By default hookbeg is “-&lt;” and
166
- hookend is “&gt;-”. These values are not easily conflicting with typical
169
+ hookend is “&gt;-”. These values don&#39;t conflict easily with typical
167
170
  macro file body text.</p>
168
171
 
169
172
  <p>If literal hook string is required in the output, the hookesc sequence
@@ -182,6 +185,20 @@ cancel space (“ ”) output, and cancel newline (“\n”) output.</p>
182
185
 
183
186
  <p>User can set the escape sequence to any character(s).</p>
184
187
 
188
+ <h3 id="label-Remote+escape">Remote escape</h3>
189
+
190
+ <p>hookesc can be used to cancel the newline following the macro. However it
191
+ is sometimes convenient to have “clean” line ending, but still cancel the
192
+ newline. This holds true for example if language sensitive editor mode
193
+ should be respected.</p>
194
+
195
+ <p>If the first character is “+” in the macro body, the character following
196
+ the macro is cancelled from output. “+” is removed silently and the rest of
197
+ the macro body is handled normally.</p>
198
+
199
+ <p>Remote escape is typically used to cancel a newline, since other use cases
200
+ can be handeled by other means.</p>
201
+
185
202
  <h3 id="label-Single+char+hooks+and+escape">Single char hooks and escape</h3>
186
203
 
187
204
  <p>If all hooks are single character (including hookesc) and have the same
@@ -198,6 +215,20 @@ used. Also expressing multilevel macros (macro in macro) is not possible,
198
215
  since hookbeg is never detected within macro. The default hook values can
199
216
  be used for nested macros (if desired).</p>
200
217
 
218
+ <h3 id="label-Multiple+hooks">Multiple hooks</h3>
219
+
220
+ <p>Mucgly allows the user to define multiple hookbeg and hookend pairs. This
221
+ can be done from command line or from Mucgly module methods.</p>
222
+
223
+ <p>Any of the possible hookbegs will start an macro, and the corresponding
224
+ hookend pair will terminate the macro. Multiple hooks are used as a
225
+ replacement for single hookbeg and hookend.</p>
226
+
227
+ <p>Multihook mode is entered when first multihook pair is added. This can
228
+ happen multiple times. If a single hook set is performed (again),
229
+ singlehook mode is entered. This can also be used as method for resetting
230
+ the current set of multihooks.</p>
231
+
201
232
  <h2 id="label-Special+commands">Special commands</h2>
202
233
 
203
234
  <p>In addition to regular Ruby code the macros are allowed to include so
@@ -232,6 +263,12 @@ can be used for example to multiplex multiple files into one (example:
232
263
  <dd>
233
264
  <p>Comment is used to add comments into the macro file. No output is produced
234
265
  from comment macros.</p>
266
+ </dd><dt>block
267
+ <dd>
268
+ <p>Block output starting with this command, see unblock.</p>
269
+ </dd><dt>unblock
270
+ <dd>
271
+ <p>Unblock output starting with this command, see block.</p>
235
272
  </dd><dt>source
236
273
  <dd>
237
274
  <p>Source reads a plain Ruby file into the Execution Environment.</p>
@@ -327,6 +364,9 @@ Hook-commands change the current hook values.</p>
327
364
  </dd><dt>sethookesc
328
365
  <dd>
329
366
  <p>Set hookesc value.</p>
367
+ </dd><dt>multihook
368
+ <dd>
369
+ <p>Define a set of hookbeg/hookend pairs (even number of strings in array).</p>
330
370
  </dd><dt>ifilename
331
371
  <dd>
332
372
  <p>Input file name as String.</p>
@@ -343,7 +383,7 @@ Hook-commands change the current hook values.</p>
343
383
  <dd>
344
384
  <p>Makes given file as current input stream. When this stream is runs out
345
385
  (EOF) or is closed (with closeinput), the input stream is reverted to
346
- previous input file.</p>
386
+ previous input file. Pushinput is same as “:include” command.</p>
347
387
  </dd><dt>closeinput
348
388
  <dd>
349
389
  <p>Close output stream (before EOF is encountered).</p>
@@ -354,16 +394,26 @@ closeoutput), the output stream is reverted to previous output file.</p>
354
394
  </dd><dt>closeoutput
355
395
  <dd>
356
396
  <p>Close output stream.</p>
397
+ </dd><dt>block
398
+ <dd>
399
+ <p>Block output starting with this command, see unblock.</p>
400
+ </dd><dt>unblock
401
+ <dd>
402
+ <p>Unblock output starting with this command, see block.</p>
357
403
  </dd></dl>
358
404
 
359
405
  <h2 id="label-Command+line+interface">Command line interface</h2>
360
406
 
361
407
  <p>Please execute:</p>
362
408
 
363
- <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_mucgly'>mucgly</span> <span class='op'>-</span><span class='id identifier rubyid_h'>h</span></code></pre>
409
+ <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_mucgly'>mucgly</span> <span class='op'>-</span><span class='id identifier rubyid_h'>h</span>
410
+ </code></pre>
364
411
 
365
412
  <p>for an overview of the command line options.</p>
366
413
 
414
+ <p>The user must use the same option multiple times in order to enter multiple
415
+ args of the same class.</p>
416
+
367
417
  <h3 id="label-Input+and+Output+files">Input and Output files</h3>
368
418
 
369
419
  <p>Input files can be listed to “-f” option. The default input stream for
@@ -416,7 +466,7 @@ GEM executable (i.e. same command line options).</p>
416
466
  </div></div>
417
467
 
418
468
  <div id="footer">
419
- Generated on Sun Apr 5 20:11:53 2015 by
469
+ Generated on Sun Apr 24 19:00:00 2016 by
420
470
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
421
471
  0.8.7.6 (ruby-2.1.2).
422
472
  </div>
data/doc/index.html CHANGED
@@ -120,13 +120,16 @@ result. Mucgly module is part of Mucgly.</p>
120
120
 
121
121
  <p>For all command line options, see:</p>
122
122
 
123
- <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_mucgly'>mucgly</span> <span class='op'>-</span><span class='id identifier rubyid_h'>h</span></code></pre>
123
+ <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_mucgly'>mucgly</span> <span class='op'>-</span><span class='id identifier rubyid_h'>h</span>
124
+ </code></pre>
124
125
 
125
126
  <h2 id="label-Features">Features</h2>
126
127
  <ul><li>
127
128
  <p>User settable hooks to define macro boundaries. Can be set from command
128
129
  line, configuration files, or from macro input file.</p>
129
130
  </li><li>
131
+ <p>Multiple, concurrent macro start and end limiters (multihook).</p>
132
+ </li><li>
130
133
  <p>Multiple sources for configuration: default config, environment variable,
131
134
  command line.</p>
132
135
  </li><li>
@@ -163,7 +166,7 @@ command line.</p>
163
166
  <h3 id="label-Hooks">Hooks</h3>
164
167
 
165
168
  <p>Hooks start and end the macro definition. By default hookbeg is “-&lt;” and
166
- hookend is “&gt;-”. These values are not easily conflicting with typical
169
+ hookend is “&gt;-”. These values don&#39;t conflict easily with typical
167
170
  macro file body text.</p>
168
171
 
169
172
  <p>If literal hook string is required in the output, the hookesc sequence
@@ -182,6 +185,20 @@ cancel space (“ ”) output, and cancel newline (“\n”) output.</p>
182
185
 
183
186
  <p>User can set the escape sequence to any character(s).</p>
184
187
 
188
+ <h3 id="label-Remote+escape">Remote escape</h3>
189
+
190
+ <p>hookesc can be used to cancel the newline following the macro. However it
191
+ is sometimes convenient to have “clean” line ending, but still cancel the
192
+ newline. This holds true for example if language sensitive editor mode
193
+ should be respected.</p>
194
+
195
+ <p>If the first character is “+” in the macro body, the character following
196
+ the macro is cancelled from output. “+” is removed silently and the rest of
197
+ the macro body is handled normally.</p>
198
+
199
+ <p>Remote escape is typically used to cancel a newline, since other use cases
200
+ can be handeled by other means.</p>
201
+
185
202
  <h3 id="label-Single+char+hooks+and+escape">Single char hooks and escape</h3>
186
203
 
187
204
  <p>If all hooks are single character (including hookesc) and have the same
@@ -198,6 +215,20 @@ used. Also expressing multilevel macros (macro in macro) is not possible,
198
215
  since hookbeg is never detected within macro. The default hook values can
199
216
  be used for nested macros (if desired).</p>
200
217
 
218
+ <h3 id="label-Multiple+hooks">Multiple hooks</h3>
219
+
220
+ <p>Mucgly allows the user to define multiple hookbeg and hookend pairs. This
221
+ can be done from command line or from Mucgly module methods.</p>
222
+
223
+ <p>Any of the possible hookbegs will start an macro, and the corresponding
224
+ hookend pair will terminate the macro. Multiple hooks are used as a
225
+ replacement for single hookbeg and hookend.</p>
226
+
227
+ <p>Multihook mode is entered when first multihook pair is added. This can
228
+ happen multiple times. If a single hook set is performed (again),
229
+ singlehook mode is entered. This can also be used as method for resetting
230
+ the current set of multihooks.</p>
231
+
201
232
  <h2 id="label-Special+commands">Special commands</h2>
202
233
 
203
234
  <p>In addition to regular Ruby code the macros are allowed to include so
@@ -232,6 +263,12 @@ can be used for example to multiplex multiple files into one (example:
232
263
  <dd>
233
264
  <p>Comment is used to add comments into the macro file. No output is produced
234
265
  from comment macros.</p>
266
+ </dd><dt>block
267
+ <dd>
268
+ <p>Block output starting with this command, see unblock.</p>
269
+ </dd><dt>unblock
270
+ <dd>
271
+ <p>Unblock output starting with this command, see block.</p>
235
272
  </dd><dt>source
236
273
  <dd>
237
274
  <p>Source reads a plain Ruby file into the Execution Environment.</p>
@@ -327,6 +364,9 @@ Hook-commands change the current hook values.</p>
327
364
  </dd><dt>sethookesc
328
365
  <dd>
329
366
  <p>Set hookesc value.</p>
367
+ </dd><dt>multihook
368
+ <dd>
369
+ <p>Define a set of hookbeg/hookend pairs (even number of strings in array).</p>
330
370
  </dd><dt>ifilename
331
371
  <dd>
332
372
  <p>Input file name as String.</p>
@@ -343,7 +383,7 @@ Hook-commands change the current hook values.</p>
343
383
  <dd>
344
384
  <p>Makes given file as current input stream. When this stream is runs out
345
385
  (EOF) or is closed (with closeinput), the input stream is reverted to
346
- previous input file.</p>
386
+ previous input file. Pushinput is same as “:include” command.</p>
347
387
  </dd><dt>closeinput
348
388
  <dd>
349
389
  <p>Close output stream (before EOF is encountered).</p>
@@ -354,16 +394,26 @@ closeoutput), the output stream is reverted to previous output file.</p>
354
394
  </dd><dt>closeoutput
355
395
  <dd>
356
396
  <p>Close output stream.</p>
397
+ </dd><dt>block
398
+ <dd>
399
+ <p>Block output starting with this command, see unblock.</p>
400
+ </dd><dt>unblock
401
+ <dd>
402
+ <p>Unblock output starting with this command, see block.</p>
357
403
  </dd></dl>
358
404
 
359
405
  <h2 id="label-Command+line+interface">Command line interface</h2>
360
406
 
361
407
  <p>Please execute:</p>
362
408
 
363
- <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_mucgly'>mucgly</span> <span class='op'>-</span><span class='id identifier rubyid_h'>h</span></code></pre>
409
+ <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_mucgly'>mucgly</span> <span class='op'>-</span><span class='id identifier rubyid_h'>h</span>
410
+ </code></pre>
364
411
 
365
412
  <p>for an overview of the command line options.</p>
366
413
 
414
+ <p>The user must use the same option multiple times in order to enter multiple
415
+ args of the same class.</p>
416
+
367
417
  <h3 id="label-Input+and+Output+files">Input and Output files</h3>
368
418
 
369
419
  <p>Input files can be listed to “-f” option. The default input stream for
@@ -416,7 +466,7 @@ GEM executable (i.e. same command line options).</p>
416
466
  </div></div>
417
467
 
418
468
  <div id="footer">
419
- Generated on Sun Apr 5 20:11:53 2015 by
469
+ Generated on Sun Apr 24 19:00:00 2016 by
420
470
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
421
471
  0.8.7.6 (ruby-2.1.2).
422
472
  </div>
@@ -103,7 +103,7 @@
103
103
  </div>
104
104
 
105
105
  <div id="footer">
106
- Generated on Sun Apr 5 20:11:53 2015 by
106
+ Generated on Sun Apr 24 19:00:00 2016 by
107
107
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
108
108
  0.8.7.6 (ruby-2.1.2).
109
109
  </div>