halation 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -128,7 +128,7 @@
128
128
  <li class="public ">
129
129
  <span class="summary_signature">
130
130
 
131
- <a href="#generate_new_roll-class_method" title="generate_new_roll (class method)">.<strong>generate_new_roll</strong> &#x21d2; Object </a>
131
+ <a href="#generate_new_roll-class_method" title="generate_new_roll (class method)">.<strong>generate_new_roll</strong>(opts = {}) &#x21d2; Object </a>
132
132
 
133
133
 
134
134
 
@@ -183,7 +183,7 @@
183
183
  <div class="method_details first">
184
184
  <h3 class="signature first" id="generate_new_roll-class_method">
185
185
 
186
- .<strong>generate_new_roll</strong> &#x21d2; <tt>Object</tt>
186
+ .<strong>generate_new_roll</strong>(opts = {}) &#x21d2; <tt>Object</tt>
187
187
 
188
188
 
189
189
 
@@ -198,18 +198,61 @@
198
198
  </div>
199
199
  </div>
200
200
  <div class="tags">
201
+ <p class="tag_title">Parameters:</p>
202
+ <ul class="param">
203
+
204
+ <li>
205
+
206
+ <span class='name'>opts</span>
207
+
208
+
209
+ <span class='type'>(<tt>Hash</tt>)</span>
210
+
211
+
212
+ <em class="default">(defaults to: <tt>{}</tt>)</em>
213
+
214
+
215
+ &mdash;
216
+ <div class='inline'>
217
+ <p>a customizable set of options</p>
218
+ </div>
219
+
220
+ </li>
221
+
222
+ </ul>
223
+
224
+
225
+
226
+
227
+ <p class="tag_title">Options Hash (<tt>opts</tt>):</p>
228
+ <ul class="option">
229
+
230
+ <li>
231
+ <span class="name">:skip_exit</span>
232
+ <span class="type">(<tt>Boolean</tt>)</span>
233
+ <span class="default">
234
+
235
+ &mdash; default:
236
+ <tt>false</tt>
237
+
238
+ </span>
239
+
240
+ &mdash; <div class='inline'>
241
+ <p>Don&#39;t exit the program after calling a handler that would normally exit. Used for unit testing.</p>
242
+ </div>
243
+
244
+ </li>
245
+
246
+ </ul>
201
247
 
202
248
 
249
+
203
250
  </div><table class="source_code">
204
251
  <tr>
205
252
  <td>
206
253
  <pre class="lines">
207
254
 
208
255
 
209
- 85
210
- 86
211
- 87
212
- 88
213
256
  89
214
257
  90
215
258
  91
@@ -224,17 +267,23 @@
224
267
  100
225
268
  101
226
269
  102
227
- 103</pre>
270
+ 103
271
+ 104
272
+ 105
273
+ 106
274
+ 107
275
+ 108</pre>
228
276
  </td>
229
277
  <td>
230
- <pre class="code"><span class="info file"># File 'lib/halation/script.rb', line 85</span>
278
+ <pre class="code"><span class="info file"># File 'lib/halation/script.rb', line 89</span>
231
279
 
232
- <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_generate_new_roll'>generate_new_roll</span>
280
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_generate_new_roll'>generate_new_roll</span><span class='lparen'>(</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>
281
+ <span class='id identifier rubyid_skip_exit'>skip_exit</span> <span class='op'>=</span> <span class='op'>!</span><span class='op'>!</span><span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:skip_exit</span><span class='rbracket'>]</span>
233
282
  <span class='id identifier rubyid_roll_path'>roll_path</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>roll.yml</span><span class='tstring_end'>&quot;</span></span>
234
283
 
235
284
  <span class='kw'>if</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_exists?'>exists?</span><span class='lparen'>(</span><span class='id identifier rubyid_roll_path'>roll_path</span><span class='rparen'>)</span>
236
- <span class='id identifier rubyid_output_stream'>output_stream</span><span class='period'>.</span><span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>A roll.yml file already exists in this directory.</span><span class='tstring_end'>&quot;</span></span>
237
- <span class='kw'>return</span>
285
+ <span class='const'>STDERR</span><span class='period'>.</span><span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>A roll.yml file already exists in this directory.</span><span class='tstring_end'>&quot;</span></span>
286
+ <span class='id identifier rubyid_exit'>exit</span> <span class='int'>1</span> <span class='kw'>unless</span> <span class='id identifier rubyid_skip_exit'>skip_exit</span>
238
287
  <span class='kw'>end</span>
239
288
 
240
289
  <span class='comment'># TODO: Make this configurable from config.yml
@@ -425,61 +474,61 @@
425
474
 
426
475
  <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
427
476
 
428
- <span class='const'>OptionParser</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_opts'>opts</span><span class='op'>|</span>
429
- <span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_banner'>banner</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Usage: halation [options]</span><span class='tstring_end'>&quot;</span></span>
477
+ <span class='const'>OptionParser</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_op'>op</span><span class='op'>|</span>
478
+ <span class='id identifier rubyid_op'>op</span><span class='period'>.</span><span class='id identifier rubyid_banner'>banner</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Usage: halation [options]</span><span class='tstring_end'>&quot;</span></span>
430
479
 
431
- <span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_on'>on</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>-c</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>--config=PATH</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='const'>String</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Config file path</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_config_path'>config_path</span><span class='op'>|</span>
480
+ <span class='id identifier rubyid_op'>op</span><span class='period'>.</span><span class='id identifier rubyid_on'>on</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>-c</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>--config=PATH</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='const'>String</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Config file path</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_config_path'>config_path</span><span class='op'>|</span>
432
481
  <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:config_path</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_config_path'>config_path</span>
433
482
  <span class='kw'>end</span>
434
483
 
435
- <span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_on'>on</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>--dry</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Dry run</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='kw'>do</span>
484
+ <span class='id identifier rubyid_op'>op</span><span class='period'>.</span><span class='id identifier rubyid_on'>on</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>--dry</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Dry run</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='kw'>do</span>
436
485
  <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:dry_run</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='kw'>true</span>
437
486
  <span class='comment'># TODO: Implement
438
487
  </span> <span class='id identifier rubyid_raise'>raise</span> <span class='const'>NotImplementedError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Dry run option is not yet implemented.</span><span class='tstring_end'>&quot;</span></span>
439
488
  <span class='kw'>end</span>
440
489
 
441
- <span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_on'>on</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>-h</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>--help</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Print this help</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='kw'>do</span>
442
- <span class='id identifier rubyid_output_stream'>output_stream</span><span class='period'>.</span><span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_opts'>opts</span>
490
+ <span class='id identifier rubyid_op'>op</span><span class='period'>.</span><span class='id identifier rubyid_on'>on</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>-h</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>--help</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Print this help</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='kw'>do</span>
491
+ <span class='id identifier rubyid_output_stream'>output_stream</span><span class='period'>.</span><span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_op'>op</span>
443
492
  <span class='id identifier rubyid_run_engine'>run_engine</span> <span class='op'>=</span> <span class='kw'>false</span>
444
493
  <span class='id identifier rubyid_exit'>exit</span> <span class='kw'>unless</span> <span class='id identifier rubyid_skip_exit'>skip_exit</span>
445
494
  <span class='kw'>end</span>
446
495
 
447
- <span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_on'>on</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>--new-config</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Generate a new config file</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_path'>path</span><span class='op'>|</span>
496
+ <span class='id identifier rubyid_op'>op</span><span class='period'>.</span><span class='id identifier rubyid_on'>on</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>--new-config</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Generate a new config file</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_path'>path</span><span class='op'>|</span>
448
497
  <span class='comment'># TODO: Implement
449
498
  </span> <span class='id identifier rubyid_raise'>raise</span> <span class='const'>NotImplementedError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Generate config option is not yet implemented.</span><span class='tstring_end'>&quot;</span></span>
450
499
  <span class='id identifier rubyid_run_engine'>run_engine</span> <span class='op'>=</span> <span class='kw'>false</span>
451
500
  <span class='id identifier rubyid_exit'>exit</span> <span class='kw'>unless</span> <span class='id identifier rubyid_skip_exit'>skip_exit</span>
452
501
  <span class='kw'>end</span>
453
502
 
454
- <span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_on'>on</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>--new-roll</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Generate a new roll.yml file</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='kw'>do</span>
455
- <span class='id identifier rubyid_generate_new_roll'>generate_new_roll</span>
503
+ <span class='id identifier rubyid_op'>op</span><span class='period'>.</span><span class='id identifier rubyid_on'>on</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>--new-roll</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Generate a new roll.yml file</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='kw'>do</span>
504
+ <span class='id identifier rubyid_generate_new_roll'>generate_new_roll</span><span class='lparen'>(</span><span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span>
456
505
  <span class='id identifier rubyid_run_engine'>run_engine</span> <span class='op'>=</span> <span class='kw'>false</span>
457
506
  <span class='id identifier rubyid_exit'>exit</span> <span class='kw'>unless</span> <span class='id identifier rubyid_skip_exit'>skip_exit</span>
458
507
  <span class='kw'>end</span>
459
508
 
460
- <span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_on'>on</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>-p</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>--print-config</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Print the configuration settings</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='kw'>do</span>
509
+ <span class='id identifier rubyid_op'>op</span><span class='period'>.</span><span class='id identifier rubyid_on'>on</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>-p</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>--print-config</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Print the configuration settings</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='kw'>do</span>
461
510
  <span class='comment'># TODO: Implement
462
511
  </span> <span class='id identifier rubyid_raise'>raise</span> <span class='const'>NotImplementedError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Print config option is not yet implemented.</span><span class='tstring_end'>&quot;</span></span>
463
512
  <span class='id identifier rubyid_run_engine'>run_engine</span> <span class='op'>=</span> <span class='kw'>false</span>
464
513
  <span class='id identifier rubyid_exit'>exit</span> <span class='kw'>unless</span> <span class='id identifier rubyid_skip_exit'>skip_exit</span>
465
514
  <span class='kw'>end</span>
466
515
 
467
- <span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_on'>on</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>-r</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>--recursive</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Traverse into subdirectories</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='kw'>do</span>
516
+ <span class='id identifier rubyid_op'>op</span><span class='period'>.</span><span class='id identifier rubyid_on'>on</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>-r</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>--recursive</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Traverse into subdirectories</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='kw'>do</span>
468
517
  <span class='comment'># TODO: Implement
469
518
  </span> <span class='id identifier rubyid_raise'>raise</span> <span class='const'>NotImplementedError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Recursive option is not yet implemented.</span><span class='tstring_end'>&quot;</span></span>
470
519
  <span class='kw'>end</span>
471
520
 
472
- <span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_on'>on</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>--silent</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Suppress messages to stdout.</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='kw'>do</span>
521
+ <span class='id identifier rubyid_op'>op</span><span class='period'>.</span><span class='id identifier rubyid_on'>on</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>--silent</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Suppress messages to stdout.</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='kw'>do</span>
473
522
  <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:silent</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='kw'>true</span>
474
523
  <span class='kw'>end</span>
475
524
 
476
- <span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_on'>on</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>-v</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>--version</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Print the version information</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='kw'>do</span>
525
+ <span class='id identifier rubyid_op'>op</span><span class='period'>.</span><span class='id identifier rubyid_on'>on</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>-v</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>--version</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Print the version information</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='kw'>do</span>
477
526
  <span class='id identifier rubyid_output_stream'>output_stream</span><span class='period'>.</span><span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>halation </span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="../Halation.html" title="Halation (module)">Halation</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Halation.html#VERSION-constant" title="Halation::VERSION (constant)">VERSION</a></span></span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span>
478
527
  <span class='id identifier rubyid_run_engine'>run_engine</span> <span class='op'>=</span> <span class='kw'>false</span>
479
528
  <span class='id identifier rubyid_exit'>exit</span> <span class='kw'>unless</span> <span class='id identifier rubyid_skip_exit'>skip_exit</span>
480
529
  <span class='kw'>end</span>
481
530
  <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_parse!'>parse!</span><span class='lparen'>(</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
482
-
531
+
483
532
  <span class='const'><span class='object_link'><a href="../Halation.html" title="Halation (module)">Halation</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Engine.html" title="Halation::Engine (class)">Engine</a></span></span><span class='period'>.</span><span class='id identifier rubyid_run'><span class='object_link'><a href="Engine.html#run-class_method" title="Halation::Engine.run (method)">run</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_run_engine'>run_engine</span>
484
533
  <span class='kw'>end</span></pre>
485
534
  </td>
@@ -492,7 +541,7 @@
492
541
  </div>
493
542
 
494
543
  <div id="footer">
495
- Generated on Sun May 10 15:34:34 2020 by
544
+ Generated on Sun May 10 21:13:56 2020 by
496
545
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
497
546
  0.9.25 (ruby-2.7.1).
498
547
  </div>
@@ -211,7 +211,7 @@
211
211
  </div>
212
212
 
213
213
  <div id="footer">
214
- Generated on Sun May 10 15:34:32 2020 by
214
+ Generated on Sun May 10 21:13:55 2020 by
215
215
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
216
216
  0.9.25 (ruby-2.7.1).
217
217
  </div>
@@ -70,7 +70,7 @@
70
70
  </div></div>
71
71
 
72
72
  <div id="footer">
73
- Generated on Sun May 10 15:34:33 2020 by
73
+ Generated on Sun May 10 21:13:56 2020 by
74
74
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
75
75
  0.9.25 (ruby-2.7.1).
76
76
  </div>
@@ -108,7 +108,7 @@
108
108
  <pre class="code ruby"><code class="ruby"># Example config.yml
109
109
  ---
110
110
  artist: &quot;Example User&quot;
111
- copyright: &quot;2016 Example User&quot;
111
+ copyright: &quot;{{ year_captured }} {{ artist }}&quot;
112
112
  cameras:
113
113
  - tag: &quot;rz67&quot;
114
114
  make: &quot;Mamiya&quot;
@@ -128,6 +128,15 @@ cameras:
128
128
  focal_length: 250
129
129
  </code></pre>
130
130
 
131
+ <h3 id="label-Templating">Templating</h3>
132
+
133
+ <p>Templated values are supported within the YAML files using the moustache <code>{{</code> <code>}}</code> syntax.</p>
134
+ <ul><li>
135
+ <p><code>artist</code> - Available within the <code>copyright</code> field to substitute the artist name.</p>
136
+ </li><li>
137
+ <p><code>year_captured</code> - Available within the <code>copyright</code> field to substitute the year the image was captured.</p>
138
+ </li></ul>
139
+
131
140
  <h2 id="label-Tags">Tags</h2>
132
141
 
133
142
  <p>Tags are user-defined values that serve as a quick and simple way to reference complex information.</p>
@@ -228,7 +237,7 @@ frames:
228
237
  </div></div>
229
238
 
230
239
  <div id="footer">
231
- Generated on Sun May 10 15:34:33 2020 by
240
+ Generated on Sun May 10 21:13:56 2020 by
232
241
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
233
242
  0.9.25 (ruby-2.7.1).
234
243
  </div>
@@ -108,7 +108,7 @@
108
108
  <pre class="code ruby"><code class="ruby"># Example config.yml
109
109
  ---
110
110
  artist: &quot;Example User&quot;
111
- copyright: &quot;2016 Example User&quot;
111
+ copyright: &quot;{{ year_captured }} {{ artist }}&quot;
112
112
  cameras:
113
113
  - tag: &quot;rz67&quot;
114
114
  make: &quot;Mamiya&quot;
@@ -128,6 +128,15 @@ cameras:
128
128
  focal_length: 250
129
129
  </code></pre>
130
130
 
131
+ <h3 id="label-Templating">Templating</h3>
132
+
133
+ <p>Templated values are supported within the YAML files using the moustache <code>{{</code> <code>}}</code> syntax.</p>
134
+ <ul><li>
135
+ <p><code>artist</code> - Available within the <code>copyright</code> field to substitute the artist name.</p>
136
+ </li><li>
137
+ <p><code>year_captured</code> - Available within the <code>copyright</code> field to substitute the year the image was captured.</p>
138
+ </li></ul>
139
+
131
140
  <h2 id="label-Tags">Tags</h2>
132
141
 
133
142
  <p>Tags are user-defined values that serve as a quick and simple way to reference complex information.</p>
@@ -228,7 +237,7 @@ frames:
228
237
  </div></div>
229
238
 
230
239
  <div id="footer">
231
- Generated on Sun May 10 15:34:33 2020 by
240
+ Generated on Sun May 10 21:13:55 2020 by
232
241
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
233
242
  0.9.25 (ruby-2.7.1).
234
243
  </div>
@@ -117,6 +117,14 @@
117
117
 
118
118
 
119
119
  <li class="even ">
120
+ <div class="item">
121
+ <span class='object_link'><a href="Halation/Roll.html#copyright-instance_method" title="Halation::Roll#copyright (method)">#copyright</a></span>
122
+ <small>Halation::Roll</small>
123
+ </div>
124
+ </li>
125
+
126
+
127
+ <li class="odd ">
120
128
  <div class="item">
121
129
  <span class='object_link'><a href="Halation/Config.html#copyright-instance_method" title="Halation::Config#copyright (method)">#copyright</a></span>
122
130
  <small>Halation::Config</small>
@@ -124,9 +132,17 @@
124
132
  </li>
125
133
 
126
134
 
135
+ <li class="even ">
136
+ <div class="item">
137
+ <span class='object_link'><a href="Halation/Coerce.html#date-class_method" title="Halation::Coerce.date (method)">date</a></span>
138
+ <small>Halation::Coerce</small>
139
+ </div>
140
+ </li>
141
+
142
+
127
143
  <li class="odd ">
128
144
  <div class="item">
129
- <span class='object_link'><a href="Halation/Roll.html#copyright-instance_method" title="Halation::Roll#copyright (method)">#copyright</a></span>
145
+ <span class='object_link'><a href="Halation/Roll.html#date_captured-instance_method" title="Halation::Roll#date_captured (method)">#date_captured</a></span>
130
146
  <small>Halation::Roll</small>
131
147
  </div>
132
148
  </li>
@@ -134,7 +150,7 @@
134
150
 
135
151
  <li class="even ">
136
152
  <div class="item">
137
- <span class='object_link'><a href="Halation/Roll/Frame.html#date-instance_method" title="Halation::Roll::Frame#date (method)">#date</a></span>
153
+ <span class='object_link'><a href="Halation/Roll/Frame.html#date_captured-instance_method" title="Halation::Roll::Frame#date_captured (method)">#date_captured</a></span>
138
154
  <small>Halation::Roll::Frame</small>
139
155
  </div>
140
156
  </li>
@@ -142,16 +158,16 @@
142
158
 
143
159
  <li class="odd ">
144
160
  <div class="item">
145
- <span class='object_link'><a href="Halation/Coerce.html#date-class_method" title="Halation::Coerce.date (method)">date</a></span>
146
- <small>Halation::Coerce</small>
161
+ <span class='object_link'><a href="Halation/Roll.html#date_scanned-instance_method" title="Halation::Roll#date_scanned (method)">#date_scanned</a></span>
162
+ <small>Halation::Roll</small>
147
163
  </div>
148
164
  </li>
149
165
 
150
166
 
151
167
  <li class="even ">
152
168
  <div class="item">
153
- <span class='object_link'><a href="Halation/Roll.html#date-instance_method" title="Halation::Roll#date (method)">#date</a></span>
154
- <small>Halation::Roll</small>
169
+ <span class='object_link'><a href="Halation/Roll/Frame.html#date_scanned-instance_method" title="Halation::Roll::Frame#date_scanned (method)">#date_scanned</a></span>
170
+ <small>Halation::Roll::Frame</small>
155
171
  </div>
156
172
  </li>
157
173
 
@@ -238,24 +254,24 @@
238
254
 
239
255
  <li class="odd ">
240
256
  <div class="item">
241
- <span class='object_link'><a href="Halation/ExifToolImage.html#initialize-instance_method" title="Halation::ExifToolImage#initialize (method)">#initialize</a></span>
242
- <small>Halation::ExifToolImage</small>
257
+ <span class='object_link'><a href="Halation/Config/Lens.html#initialize-instance_method" title="Halation::Config::Lens#initialize (method)">#initialize</a></span>
258
+ <small>Halation::Config::Lens</small>
243
259
  </div>
244
260
  </li>
245
261
 
246
262
 
247
263
  <li class="even ">
248
264
  <div class="item">
249
- <span class='object_link'><a href="Halation/Config/Lens.html#initialize-instance_method" title="Halation::Config::Lens#initialize (method)">#initialize</a></span>
250
- <small>Halation::Config::Lens</small>
265
+ <span class='object_link'><a href="Halation/Engine.html#initialize-instance_method" title="Halation::Engine#initialize (method)">#initialize</a></span>
266
+ <small>Halation::Engine</small>
251
267
  </div>
252
268
  </li>
253
269
 
254
270
 
255
271
  <li class="odd ">
256
272
  <div class="item">
257
- <span class='object_link'><a href="Halation/Engine.html#initialize-instance_method" title="Halation::Engine#initialize (method)">#initialize</a></span>
258
- <small>Halation::Engine</small>
273
+ <span class='object_link'><a href="Halation/ExifToolImage.html#initialize-instance_method" title="Halation::ExifToolImage#initialize (method)">#initialize</a></span>
274
+ <small>Halation::ExifToolImage</small>
259
275
  </div>
260
276
  </li>
261
277
 
@@ -286,16 +302,16 @@
286
302
 
287
303
  <li class="odd ">
288
304
  <div class="item">
289
- <span class='object_link'><a href="Halation/Roll/Frame.html#lens-instance_method" title="Halation::Roll::Frame#lens (method)">#lens</a></span>
290
- <small>Halation::Roll::Frame</small>
305
+ <span class='object_link'><a href="Halation/Roll.html#lens-instance_method" title="Halation::Roll#lens (method)">#lens</a></span>
306
+ <small>Halation::Roll</small>
291
307
  </div>
292
308
  </li>
293
309
 
294
310
 
295
311
  <li class="even ">
296
312
  <div class="item">
297
- <span class='object_link'><a href="Halation/Roll.html#lens-instance_method" title="Halation::Roll#lens (method)">#lens</a></span>
298
- <small>Halation::Roll</small>
313
+ <span class='object_link'><a href="Halation/Roll/Frame.html#lens-instance_method" title="Halation::Roll::Frame#lens (method)">#lens</a></span>
314
+ <small>Halation::Roll::Frame</small>
299
315
  </div>
300
316
  </li>
301
317
 
@@ -366,16 +382,16 @@
366
382
 
367
383
  <li class="odd ">
368
384
  <div class="item">
369
- <span class='object_link'><a href="Halation/Config.html#reset-instance_method" title="Halation::Config#reset (method)">#reset</a></span>
370
- <small>Halation::Config</small>
385
+ <span class='object_link'><a href="Halation/Roll.html#reset-instance_method" title="Halation::Roll#reset (method)">#reset</a></span>
386
+ <small>Halation::Roll</small>
371
387
  </div>
372
388
  </li>
373
389
 
374
390
 
375
391
  <li class="even ">
376
392
  <div class="item">
377
- <span class='object_link'><a href="Halation/Roll.html#reset-instance_method" title="Halation::Roll#reset (method)">#reset</a></span>
378
- <small>Halation::Roll</small>
393
+ <span class='object_link'><a href="Halation/Config.html#reset-instance_method" title="Halation::Config#reset (method)">#reset</a></span>
394
+ <small>Halation::Config</small>
379
395
  </div>
380
396
  </li>
381
397
 
@@ -462,16 +478,16 @@
462
478
 
463
479
  <li class="odd ">
464
480
  <div class="item">
465
- <span class='object_link'><a href="Halation/Config/Camera.html#to_s-instance_method" title="Halation::Config::Camera#to_s (method)">#to_s</a></span>
466
- <small>Halation::Config::Camera</small>
481
+ <span class='object_link'><a href="Halation/Config.html#to_s-instance_method" title="Halation::Config#to_s (method)">#to_s</a></span>
482
+ <small>Halation::Config</small>
467
483
  </div>
468
484
  </li>
469
485
 
470
486
 
471
487
  <li class="even ">
472
488
  <div class="item">
473
- <span class='object_link'><a href="Halation/Config.html#to_s-instance_method" title="Halation::Config#to_s (method)">#to_s</a></span>
474
- <small>Halation::Config</small>
489
+ <span class='object_link'><a href="Halation/Config/Camera.html#to_s-instance_method" title="Halation::Config::Camera#to_s (method)">#to_s</a></span>
490
+ <small>Halation::Config::Camera</small>
475
491
  </div>
476
492
  </li>
477
493
 
@@ -100,7 +100,7 @@
100
100
  </div>
101
101
 
102
102
  <div id="footer">
103
- Generated on Sun May 10 15:34:33 2020 by
103
+ Generated on Sun May 10 21:13:56 2020 by
104
104
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
105
105
  0.9.25 (ruby-2.7.1).
106
106
  </div>
@@ -66,12 +66,9 @@ module Halation
66
66
 
67
67
  ExifToolImage.new(_image_files[i]).tap do |exif|
68
68
  exif["Artist"] = @roll.artist || @config.artist
69
- exif["Copyright"] = @roll.copyright || @config.copyright
70
-
71
- date_created = frame.date || @roll.date
72
- exif["DateTimeOriginal"] = date_created
73
- exif["CreateDate"] = date_created
74
-
69
+ exif["Copyright"] = template_copyright(@config, @roll, frame)
70
+ exif["DateTimeOriginal"] = frame.date_captured || @roll.date_captured
71
+ exif["CreateDate"] = frame.date_scanned || @roll.date_scanned
75
72
  exif["Make"] = camera.make
76
73
  exif["Model"] = camera.model
77
74
  exif["LensModel"] = lens.model
@@ -87,5 +84,16 @@ module Halation
87
84
  end
88
85
  end
89
86
 
87
+ private
88
+
89
+ def template_copyright(config, roll, frame)
90
+ artist = roll.artist || config.artist
91
+ date_captured = frame.date_captured || roll.date_captured
92
+ year_captured = date_captured.strftime("%Y")
93
+
94
+ copyright = (roll.copyright || config.copyright).clone
95
+ copyright.gsub!(Regexp.new("{{\s*artist\s*}}"), artist)
96
+ copyright.gsub!(Regexp.new("{{\s*year_captured\s*}}"), year_captured)
97
+ end
90
98
  end
91
99
  end