standup_md 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,7 +4,7 @@
4
4
  <head>
5
5
  <meta charset="UTF-8">
6
6
 
7
- <title>class StandupMD - RDoc Documentation</title>
7
+ <title>module StandupMD - RDoc Documentation</title>
8
8
 
9
9
  <script type="text/javascript">
10
10
  var rdoc_rel_prefix = "./";
@@ -23,7 +23,7 @@
23
23
 
24
24
 
25
25
 
26
- <body id="top" role="document" class="class">
26
+ <body id="top" role="document" class="module">
27
27
  <nav role="navigation">
28
28
  <div id="project-navigation">
29
29
  <div id="home-section" role="region" title="Quick navigation" class="nav-section">
@@ -58,1260 +58,85 @@
58
58
 
59
59
 
60
60
  <div id="class-metadata">
61
- <div id="sections-section" class="nav-section">
62
- <h3>Sections</h3>
63
-
64
- <ul class="link-list" role="directory">
65
-
66
- <li><a href="#5Buntitled-5D"></a></li>
67
-
68
- <li><a href="#Attributes+that+are+settable+by+the+user-2C+but+have+custom+setters.">Attributes that are settable by the user, but have custom setters.</a></li>
69
61
 
70
- <li><a href="#Attributes+that+aren-27t+settable+by+user-2C+but+are+gettable.">Attributes that aren&#39;t settable by user, but are gettable.</a></li>
71
62
 
72
- <li><a href="#Attributes+with+default+getters+and+setters.">Attributes with default getters and setters.</a></li>
73
-
74
- </ul>
75
- </div>
76
-
77
- <div id="parent-class-section" class="nav-section">
78
- <h3>Parent</h3>
79
-
80
-
81
- <p class="link">Object
82
-
83
- </div>
84
-
85
63
 
86
64
 
87
65
  <!-- Method Quickref -->
88
66
  <div id="method-list-section" class="nav-section">
89
- <h3>Methods</h3>
90
-
91
- <ul class="link-list" role="directory">
92
-
93
- <li ><a href="#method-c-load">::load</a>
94
-
95
- <li ><a href="#method-c-new">::new</a>
96
-
97
- <li ><a href="#method-i-bullet_character-3D">#bullet_character=</a>
98
-
99
- <li ><a href="#method-i-config_file-3D">#config_file=</a>
100
-
101
- <li ><a href="#method-i-config_file_loaded-3F">#config_file_loaded?</a>
102
-
103
- <li ><a href="#method-i-current_entry_tasks-3D">#current_entry_tasks=</a>
104
-
105
- <li ><a href="#method-i-directory-3D">#directory=</a>
106
-
107
- <li ><a href="#method-i-entry_previously_added-3F">#entry_previously_added?</a>
108
-
109
- <li ><a href="#method-i-file_written-3F">#file_written?</a>
110
-
111
- <li ><a href="#method-i-header_depth-3D">#header_depth=</a>
112
-
113
- <li ><a href="#method-i-impediments-3D">#impediments=</a>
114
-
115
- <li ><a href="#method-i-load">#load</a>
116
-
117
- <li ><a href="#method-i-load_config_file">#load_config_file</a>
118
-
119
- <li ><a href="#method-i-new_month-3F">#new_month?</a>
120
-
121
- <li ><a href="#method-i-notes-3D">#notes=</a>
122
-
123
- <li ><a href="#method-i-previous_entry_tasks-3D">#previous_entry_tasks=</a>
124
-
125
- <li ><a href="#method-i-reload">#reload</a>
126
-
127
- <li ><a href="#method-i-sub_header_depth-3D">#sub_header_depth=</a>
128
-
129
- <li ><a href="#method-i-sub_header_order">#sub_header_order</a>
130
-
131
- <li ><a href="#method-i-sub_header_order-3D">#sub_header_order=</a>
132
-
133
- <li ><a href="#method-i-write">#write</a>
134
-
135
- </ul>
136
- </div>
137
-
138
- </div>
139
- </nav>
140
-
141
- <main role="main" aria-labelledby="class-StandupMD">
142
- <h1 id="class-StandupMD" class="class">
143
- class StandupMD
144
- </h1>
145
-
146
- <section class="description">
147
-
148
- <p>The class for handing reading/writing of entries.</p>
149
-
150
- <p>@example</p>
151
-
152
- <pre class="ruby"><span class="ruby-identifier">su</span> = <span class="ruby-constant">StandupMD</span>.<span class="ruby-identifier">new</span>
153
- </pre>
154
-
155
- </section>
156
-
157
-
158
- <section id="5Buntitled-5D" class="documentation-section">
159
-
160
-
161
-
162
-
163
-
164
-
165
-
166
-
167
-
168
- <section id="public-class-5Buntitled-5D-method-details" class="method-section">
169
- <header>
170
- <h3>Public Class Methods</h3>
171
- </header>
172
-
173
-
174
- <div id="method-c-load" class="method-detail ">
175
-
176
- <div class="method-heading">
177
- <span class="method-name">load</span><span
178
- class="method-args">(config_file = nil) { |s| ... }</span>
179
-
180
- <span class="method-click-advice">click to toggle source</span>
181
-
182
- </div>
183
-
184
-
185
- <div class="method-description">
186
-
187
- <p>Convenience method for calling <code>new</code> + <code>load</code>. Accepts a <code>YAML</code> config file as an argument, and yields the standup instance if a block is given.</p>
188
-
189
- <p>@param [String] <a href="StandupMD.html#attribute-i-config_file"><code>config_file</code></a> File path to config file.</p>
190
-
191
- <p>@example</p>
192
-
193
- <pre class="ruby"><span class="ruby-identifier">su</span> = <span class="ruby-constant">StandupMD</span>.<span class="ruby-identifier">load</span>(<span class="ruby-value">bullet_character:</span> <span class="ruby-string">&#39;*&#39;</span>)
194
- </pre>
195
-
196
-
197
-
198
-
199
- <div class="method-source-code" id="load-source">
200
- <pre><span class="ruby-comment"># File lib/standup_md.rb, line 22</span>
201
- <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">load</span>(<span class="ruby-identifier">config_file</span> = <span class="ruby-keyword">nil</span>)
202
- <span class="ruby-identifier">s</span> = <span class="ruby-identifier">new</span>(<span class="ruby-identifier">config_file</span>)
203
- <span class="ruby-keyword">yield</span> <span class="ruby-identifier">s</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">block_given?</span>
204
- <span class="ruby-identifier">s</span>.<span class="ruby-identifier">load</span>
205
- <span class="ruby-keyword">end</span></pre>
206
- </div>
207
-
208
- </div>
209
-
210
-
211
-
212
-
213
- </div>
214
-
215
-
216
- </section>
217
-
218
- </section>
219
-
220
- <section id="Attributes+that+are+settable+by+the+user-2C+but+have+custom+setters." class="documentation-section">
221
-
222
- <header class="documentation-section-title">
223
- <h2>
224
- Attributes that are settable by the user, but have custom setters.
225
- </h2>
226
- <span class="section-click-top">
227
- <a href="#top">&uarr; top</a>
228
- </span>
229
- </header>
230
-
231
-
232
-
233
-
234
-
235
-
236
-
237
- <section class="attribute-method-details" class="method-section">
238
- <header>
239
- <h3>Attributes</h3>
240
- </header>
241
-
242
-
243
- <div id="attribute-i-bullet_character" class="method-detail">
244
- <div class="method-heading attribute-method-heading">
245
- <span class="method-name">bullet_character</span><span
246
- class="attribute-access-type">[R]</span>
247
- </div>
248
-
249
- <div class="method-description">
250
-
251
- <p>Character used as bullets for list entries.</p>
252
-
253
- <p>@return [String] either - (dash) or * (asterisk)</p>
254
-
255
- </div>
256
- </div>
257
-
258
- <div id="attribute-i-config" class="method-detail">
259
- <div class="method-heading attribute-method-heading">
260
- <span class="method-name">config</span><span
261
- class="attribute-access-type">[R]</span>
262
- </div>
263
-
264
- <div class="method-description">
265
-
266
- <p>The options from <code>config_file</code> as a hash.</p>
267
-
268
- <p>@return [Hash] Options from <code>config_file</code></p>
269
-
270
- </div>
271
- </div>
272
-
273
- <div id="attribute-i-config_file" class="method-detail">
274
- <div class="method-heading attribute-method-heading">
275
- <span class="method-name">config_file</span><span
276
- class="attribute-access-type">[R]</span>
277
- </div>
278
-
279
- <div class="method-description">
280
-
281
- <p>The configuration file. Default is <code>nil</code>. If set to a string, and the file exists, it is used to set options.</p>
282
-
283
- <p>@return [String] file path</p>
284
-
285
- </div>
286
- </div>
287
-
288
- <div id="attribute-i-current_entry_tasks" class="method-detail">
289
- <div class="method-heading attribute-method-heading">
290
- <span class="method-name">current_entry_tasks</span><span
291
- class="attribute-access-type">[R]</span>
292
- </div>
293
-
294
- <div class="method-description">
295
-
296
- <p>Array of tasks for today. This is the work expected to be performed today. Default is an empty array, but when writing to file, the default is</p>
297
-
298
- <p>@return [Array]</p>
299
-
300
- <p>@default</p>
301
-
302
- <pre class="ruby">[<span class="ruby-string">&quot;&lt;!-- ADD TODAY&#39;S WORK HERE --&gt;&quot;</span>]
303
- </pre>
304
-
305
- </div>
306
- </div>
307
-
308
- <div id="attribute-i-directory" class="method-detail">
309
- <div class="method-heading attribute-method-heading">
310
- <span class="method-name">directory</span><span
311
- class="attribute-access-type">[R]</span>
312
- </div>
313
-
314
- <div class="method-description">
315
-
316
- <p>The directory where the markdown files are kept.</p>
317
-
318
- <p>@return [String]</p>
319
-
320
- <p>@default</p>
321
-
322
- <pre class="ruby"><span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">ENV</span>[<span class="ruby-string">&#39;HOME&#39;</span>], <span class="ruby-string">&#39;.cache&#39;</span>, <span class="ruby-string">&#39;standup_md&#39;</span>)
323
- </pre>
324
-
325
- </div>
326
- </div>
327
-
328
- <div id="attribute-i-header_depth" class="method-detail">
329
- <div class="method-heading attribute-method-heading">
330
- <span class="method-name">header_depth</span><span
331
- class="attribute-access-type">[R]</span>
332
- </div>
333
-
334
- <div class="method-description">
335
-
336
- <p>Number of octothorps that should preface entry headers.</p>
337
-
338
- <p>@return [Integer] between 1 and 5</p>
339
-
340
- </div>
341
- </div>
342
-
343
- <div id="attribute-i-impediments" class="method-detail">
344
- <div class="method-heading attribute-method-heading">
345
- <span class="method-name">impediments</span><span
346
- class="attribute-access-type">[R]</span>
347
- </div>
348
-
349
- <div class="method-description">
350
-
351
- <p>Array of impediments for today&#39;s entry.</p>
352
-
353
- <p>@return [Array]</p>
354
-
355
- </div>
356
- </div>
357
-
358
- <div id="attribute-i-notes" class="method-detail">
359
- <div class="method-heading attribute-method-heading">
360
- <span class="method-name">notes</span><span
361
- class="attribute-access-type">[R]</span>
362
- </div>
363
-
364
- <div class="method-description">
365
-
366
- <p>Array of notes to add to today&#39;s entry.</p>
367
-
368
- <p>@return [Array]</p>
369
-
370
- </div>
371
- </div>
372
-
373
- <div id="attribute-i-previous_entry_tasks" class="method-detail">
374
- <div class="method-heading attribute-method-heading">
375
- <span class="method-name">previous_entry_tasks</span><span
376
- class="attribute-access-type">[R]</span>
377
- </div>
378
-
379
- <div class="method-description">
380
-
381
- <p>The tasks from the previous task&#39;s “Current” section.</p>
382
-
383
- <p>@return [Array]</p>
384
-
385
- </div>
386
- </div>
387
-
388
- <div id="attribute-i-sub_header_depth" class="method-detail">
389
- <div class="method-heading attribute-method-heading">
390
- <span class="method-name">sub_header_depth</span><span
391
- class="attribute-access-type">[R]</span>
392
- </div>
393
-
394
- <div class="method-description">
395
-
396
- <p>Number of octothorps that should preface sub-headers.</p>
397
-
398
- <p>@return [Integer] between 2 and 6</p>
399
-
400
- </div>
401
- </div>
402
-
403
- </section>
404
-
405
-
406
-
407
- </section>
408
-
409
- <section id="Attributes+that+aren-27t+settable+by+user-2C+but+are+gettable." class="documentation-section">
410
-
411
- <header class="documentation-section-title">
412
- <h2>
413
- Attributes that aren't settable by user, but are gettable.
414
- </h2>
415
- <span class="section-click-top">
416
- <a href="#top">&uarr; top</a>
417
- </span>
418
- </header>
419
-
420
-
421
-
422
-
423
-
424
-
425
-
426
- <section class="attribute-method-details" class="method-section">
427
- <header>
428
- <h3>Attributes</h3>
429
- </header>
430
-
431
-
432
- <div id="attribute-i-all_entries" class="method-detail">
433
- <div class="method-heading attribute-method-heading">
434
- <span class="method-name">all_entries</span><span
435
- class="attribute-access-type">[R]</span>
436
- </div>
437
-
438
- <div class="method-description">
439
-
440
- <p>Current entry plus all previous entries. This will be a hash in the same format at <code>current_entry</code> and <code>all_previous_entries</code>.</p>
441
-
442
- <p>@return [Hash]</p>
443
-
444
- </div>
445
- </div>
446
-
447
- <div id="attribute-i-all_previous_entries" class="method-detail">
448
- <div class="method-heading attribute-method-heading">
449
- <span class="method-name">all_previous_entries</span><span
450
- class="attribute-access-type">[R]</span>
451
- </div>
452
-
453
- <div class="method-description">
454
-
455
- <p>All previous entry for the same month as today. If it&#39;s the first day of the month, <code>all_previous_entries</code> will be all of last month&#39;s entries. They will be a hash in the same format as <code>current_entry</code>.</p>
456
-
457
- <p>@return [Hash]</p>
458
-
459
- </div>
460
- </div>
461
-
462
- <div id="attribute-i-current_entry" class="method-detail">
463
- <div class="method-heading attribute-method-heading">
464
- <span class="method-name">current_entry</span><span
465
- class="attribute-access-type">[R]</span>
466
- </div>
467
-
468
- <div class="method-description">
469
-
470
- <p>The entry for today&#39;s date as a hash. If <code>file</code> already has an entry for today, it will be read and used as <code>current_entry</code>. If there is no entry for today, one should be generated from scaffolding.</p>
471
-
472
- <p>@return [Hash]</p>
473
-
474
- <p>@example</p>
475
-
476
- <pre class="ruby"><span class="ruby-constant">StandupMD</span>.<span class="ruby-identifier">new</span>.<span class="ruby-identifier">current_entry</span>
477
- <span class="ruby-comment"># =&gt; {</span>
478
- <span class="ruby-comment"># &#39;2020-04-02&#39; =&gt; {</span>
479
- <span class="ruby-comment"># &#39;Previous&#39; =&gt; [&#39;Task from yesterday&#39;],</span>
480
- <span class="ruby-comment"># &#39;Current&#39; =&gt; [&quot;&lt;!-- ADD TODAY&#39;S WORK HERE --&gt;&quot;],</span>
481
- <span class="ruby-comment"># &#39;Impediments&#39; =&gt; [&#39;None&#39;],</span>
482
- <span class="ruby-comment"># &#39;Notes&#39; =&gt; [],</span>
483
- <span class="ruby-comment"># }</span>
484
- <span class="ruby-comment"># }</span>
485
- </pre>
486
-
487
- </div>
488
- </div>
489
-
490
- <div id="attribute-i-file" class="method-detail">
491
- <div class="method-heading attribute-method-heading">
492
- <span class="method-name">file</span><span
493
- class="attribute-access-type">[R]</span>
494
- </div>
495
-
496
- <div class="method-description">
497
-
498
- <p>The file name should equal <a href="StandupMD.html#attribute-i-file_name_format"><code>file_name_format</code></a> parsed by Date.strftime. The default is +Date.today.strftime(&#39;%Y_%m.md&#39;)+</p>
499
-
500
- <p>@return [String]</p>
501
-
502
- <p>@example</p>
503
-
504
- <pre class="ruby"><span class="ruby-identifier">su</span> = <span class="ruby-constant">StandupMD</span>.<span class="ruby-identifier">new</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">file_name_format</span> = <span class="ruby-string">&#39;%y_%m.markdown&#39;</span> }
505
- <span class="ruby-identifier">su</span>.<span class="ruby-identifier">file</span>
506
- <span class="ruby-comment"># =&gt; Users/johnsmith/.cache/standup_md/20_04.markdown</span>
507
- </pre>
508
-
509
- </div>
510
- </div>
511
-
512
- <div id="attribute-i-header" class="method-detail">
513
- <div class="method-heading attribute-method-heading">
514
- <span class="method-name">header</span><span
515
- class="attribute-access-type">[R]</span>
516
- </div>
517
-
518
- <div class="method-description">
519
-
520
- <p>The string that will be used for the entry headers.</p>
521
-
522
- <p>@return [String]</p>
523
-
524
- </div>
525
- </div>
526
-
527
- <div id="attribute-i-previous_file" class="method-detail">
528
- <div class="method-heading attribute-method-heading">
529
- <span class="method-name">previous_file</span><span
530
- class="attribute-access-type">[R]</span>
531
- </div>
532
-
533
- <div class="method-description">
534
-
535
- <p>The file that contains the previous entry. If previous entry was same month, <a href="StandupMD.html#attribute-i-previous_file"><code>previous_file</code></a> will be the same as file. If previous entry was last month, and a file exists for last month, <a href="StandupMD.html#attribute-i-previous_file"><code>previous_file</code></a> is last month&#39;s file. If neither is true, returns an empty string.</p>
536
-
537
- <p>@return [String]</p>
538
-
539
- <p>@example</p>
540
-
541
- <pre class="ruby"><span class="ruby-comment"># Assuming the current month is April, 2020</span>
542
-
543
- <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">entries</span>(<span class="ruby-identifier">su</span>.<span class="ruby-identifier">directory</span>)
544
- <span class="ruby-comment"># =&gt; []</span>
545
- <span class="ruby-identifier">su</span> = <span class="ruby-constant">StandupMD</span>.<span class="ruby-identifier">new</span>
546
- <span class="ruby-identifier">su</span>.<span class="ruby-identifier">previous_file</span>
547
- <span class="ruby-comment"># =&gt; &#39;&#39;</span>
548
-
549
- <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">entries</span>(<span class="ruby-identifier">su</span>.<span class="ruby-identifier">directory</span>)
550
- <span class="ruby-comment"># =&gt; [&#39;2020_03.md&#39;]</span>
551
- <span class="ruby-identifier">su</span> = <span class="ruby-constant">StandupMD</span>.<span class="ruby-identifier">new</span>
552
- <span class="ruby-identifier">su</span>.<span class="ruby-identifier">previous_file</span>
553
- <span class="ruby-comment"># =&gt; &#39;2020_03.md&#39;</span>
554
-
555
- <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">entries</span>(<span class="ruby-identifier">su</span>.<span class="ruby-identifier">directory</span>)
556
- <span class="ruby-comment"># =&gt; [&#39;2020_03.md&#39;, &#39;2020_04.md&#39;]</span>
557
- <span class="ruby-identifier">su</span> = <span class="ruby-constant">StandupMD</span>.<span class="ruby-identifier">new</span>
558
- <span class="ruby-identifier">su</span>.<span class="ruby-identifier">previous_file</span>
559
- <span class="ruby-comment"># =&gt; &#39;2020_04.md&#39;</span>
560
- </pre>
561
-
562
- </div>
563
- </div>
564
-
565
- </section>
566
-
567
-
568
-
569
- </section>
570
-
571
- <section id="Attributes+with+default+getters+and+setters." class="documentation-section">
572
-
573
- <header class="documentation-section-title">
574
- <h2>
575
- Attributes with default getters and setters.
576
- </h2>
577
- <span class="section-click-top">
578
- <a href="#top">&uarr; top</a>
579
- </span>
580
- </header>
581
-
582
-
583
-
584
-
585
-
586
- <section class="constants-list">
587
- <header>
588
- <h3>Constants</h3>
589
- </header>
590
- <dl>
591
-
592
- <dt id="VERSION">VERSION
593
-
594
- <dd><p>The gem verision</p>
595
-
596
- <p>@example</p>
597
-
598
- <pre class="ruby"><span class="ruby-constant">StandupMD</span><span class="ruby-operator">::</span><span class="ruby-constant">VERSION</span>
599
- <span class="ruby-comment"># =&gt; &#39;0.2.0&#39;</span>
600
- </pre>
601
-
602
-
603
- </dl>
604
- </section>
605
-
606
-
607
-
608
- <section class="attribute-method-details" class="method-section">
609
- <header>
610
- <h3>Attributes</h3>
611
- </header>
612
-
613
-
614
- <div id="attribute-i-current_header" class="method-detail">
615
- <div class="method-heading attribute-method-heading">
616
- <span class="method-name">current_header</span><span
617
- class="attribute-access-type">[RW]</span>
618
- </div>
619
-
620
- <div class="method-description">
621
-
622
- <p>The header to use for the <code>Current</code> section.</p>
623
-
624
- <p>@param [String] <a href="StandupMD.html#attribute-i-current_header"><code>current_header</code></a></p>
625
-
626
- <p>@return [String]</p>
627
-
628
- </div>
629
- </div>
630
-
631
- <div id="attribute-i-file_name_format" class="method-detail">
632
- <div class="method-heading attribute-method-heading">
633
- <span class="method-name">file_name_format</span><span
634
- class="attribute-access-type">[RW]</span>
635
- </div>
636
-
637
- <div class="method-description">
638
-
639
- <p>The format to use for file names. This should include a month (%m) and year (%y) so the file can rotate every month. This will prevent files from getting too large.</p>
640
-
641
- <p>@param [String] <a href="StandupMD.html#attribute-i-file_name_format"><code>file_name_format</code></a> Parsed by <code>strftime</code></p>
642
-
643
- <p>@return [String]</p>
644
-
645
- </div>
646
- </div>
647
-
648
- <div id="attribute-i-header_date_format" class="method-detail">
649
- <div class="method-heading attribute-method-heading">
650
- <span class="method-name">header_date_format</span><span
651
- class="attribute-access-type">[RW]</span>
652
- </div>
653
-
654
- <div class="method-description">
655
-
656
- <p>The date format to use for entry headers.</p>
657
-
658
- <p>@param [String] <a href="StandupMD.html#attribute-i-header_date_format"><code>header_date_format</code></a> Parsed by <code>strftime</code></p>
659
-
660
- <p>@return [String]</p>
661
-
662
- </div>
663
- </div>
664
-
665
- <div id="attribute-i-impediments_header" class="method-detail">
666
- <div class="method-heading attribute-method-heading">
667
- <span class="method-name">impediments_header</span><span
668
- class="attribute-access-type">[RW]</span>
669
- </div>
670
-
671
- <div class="method-description">
672
-
673
- <p>The header to use for the <code>Impediments</code> section.</p>
674
-
675
- <p>@param [String] <a href="StandupMD.html#attribute-i-impediments_header"><code>impediments_header</code></a></p>
676
-
677
- <p>@return [String]</p>
678
-
679
- </div>
680
- </div>
681
-
682
- <div id="attribute-i-notes_header" class="method-detail">
683
- <div class="method-heading attribute-method-heading">
684
- <span class="method-name">notes_header</span><span
685
- class="attribute-access-type">[RW]</span>
686
- </div>
687
-
688
- <div class="method-description">
689
-
690
- <p>The header to use for the <code>Notes</code> section.</p>
691
-
692
- <p>@param [String] <a href="StandupMD.html#attribute-i-notes_header"><code>notes_header</code></a></p>
693
-
694
- <p>@return [String]</p>
695
-
696
- </div>
697
- </div>
698
-
699
- <div id="attribute-i-previous_header" class="method-detail">
700
- <div class="method-heading attribute-method-heading">
701
- <span class="method-name">previous_header</span><span
702
- class="attribute-access-type">[RW]</span>
703
- </div>
704
-
705
- <div class="method-description">
706
-
707
- <p>The header to use for the <code>Previous</code> section.</p>
708
-
709
- <p>@param [String] <a href="StandupMD.html#attribute-i-previous_header"><code>previous_header</code></a></p>
710
-
711
- <p>@return [String]</p>
712
-
713
- </div>
714
- </div>
715
-
716
- </section>
717
-
718
-
719
-
720
- <section id="public-class-Attributes+with+default+getters+and+setters.-method-details" class="method-section">
721
- <header>
722
- <h3>Public Class Methods</h3>
723
- </header>
724
-
725
-
726
- <div id="method-c-new" class="method-detail ">
727
-
728
- <div class="method-heading">
729
- <span class="method-name">new</span><span
730
- class="method-args">(config_file = nil) { |self| ... }</span>
731
-
732
- <span class="method-click-advice">click to toggle source</span>
733
-
734
- </div>
735
-
736
-
737
- <div class="method-description">
738
-
739
- <p>Constructor. Takes a path to a <code>YAML</code> configuration file as an argument. If passed, settings from the config file will be set. After <code>config_file</code> is loaded, yields <code>self</code> so you can pass a block to access setters, overwriting settings from <code>config_file</code>.</p>
740
-
741
- <p>@param [String] <a href="StandupMD.html#attribute-i-config_file"><code>config_file</code></a> The config file, if any, to load.</p>
742
-
743
- <p>@return [self]</p>
744
-
745
- <p>@example</p>
746
-
747
- <pre class="ruby"><span class="ruby-identifier">su</span> = <span class="ruby-constant">StandupMD</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&#39;~/.standup_md.yml&#39;</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span>
748
- <span class="ruby-identifier">s</span>.<span class="ruby-identifier">directory</span> = <span class="ruby-ivar">@workdir</span>
749
- <span class="ruby-identifier">s</span>.<span class="ruby-identifier">file_name_format</span> = <span class="ruby-string">&#39;%y_%m.markdown&#39;</span>
750
- <span class="ruby-identifier">s</span>.<span class="ruby-identifier">bullet_character</span> = <span class="ruby-string">&#39;*&#39;</span>
751
- <span class="ruby-keyword">end</span>
752
- </pre>
753
-
754
-
755
-
756
-
757
- <div class="method-source-code" id="new-source">
758
- <pre><span class="ruby-comment"># File lib/standup_md.rb, line 250</span>
759
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">config_file</span> = <span class="ruby-keyword">nil</span>)
760
- <span class="ruby-ivar">@config</span> = {}
761
- <span class="ruby-ivar">@notes</span> = []
762
- <span class="ruby-ivar">@header_depth</span> = <span class="ruby-value">1</span>
763
- <span class="ruby-ivar">@sub_header_depth</span> = <span class="ruby-value">2</span>
764
- <span class="ruby-ivar">@bullet_character</span> = <span class="ruby-string">&#39;-&#39;</span>
765
- <span class="ruby-ivar">@current_entry_tasks</span> = [<span class="ruby-string">&quot;&lt;!-- ADD TODAY&#39;S WORK HERE --&gt;&quot;</span>]
766
- <span class="ruby-ivar">@impediments</span> = [<span class="ruby-string">&#39;None&#39;</span>]
767
- <span class="ruby-ivar">@file_name_format</span> = <span class="ruby-string">&#39;%Y_%m.md&#39;</span>
768
- <span class="ruby-ivar">@directory</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">ENV</span>[<span class="ruby-string">&#39;HOME&#39;</span>], <span class="ruby-string">&#39;.cache&#39;</span>, <span class="ruby-string">&#39;standup_md&#39;</span>)
769
- <span class="ruby-ivar">@header_date_format</span> = <span class="ruby-string">&#39;%Y-%m-%d&#39;</span>
770
- <span class="ruby-ivar">@current_header</span> = <span class="ruby-string">&#39;Current&#39;</span>
771
- <span class="ruby-ivar">@previous_header</span> = <span class="ruby-string">&#39;Previous&#39;</span>
772
- <span class="ruby-ivar">@impediments_header</span> = <span class="ruby-string">&#39;Impediments&#39;</span>
773
- <span class="ruby-ivar">@notes_header</span> = <span class="ruby-string">&#39;Notes&#39;</span>
774
- <span class="ruby-ivar">@sub_header_order</span> = <span class="ruby-node">%w[previous current impediments notes]</span>
775
- <span class="ruby-ivar">@config_file_loaded</span> = <span class="ruby-keyword">false</span>
776
- <span class="ruby-ivar">@config_file</span> = <span class="ruby-identifier">config_file</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">config_file</span>)
777
-
778
- <span class="ruby-identifier">load_config_file</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">config_file</span>
779
-
780
- <span class="ruby-keyword">yield</span> <span class="ruby-keyword">self</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">block_given?</span>
781
- <span class="ruby-keyword">end</span></pre>
782
- </div>
783
-
784
- </div>
785
-
786
-
787
-
788
-
789
- </div>
790
-
791
-
792
- </section>
793
-
794
- <section id="public-instance-Attributes+with+default+getters+and+setters.-method-details" class="method-section">
795
- <header>
796
- <h3>Public Instance Methods</h3>
797
- </header>
798
-
799
-
800
- <div id="method-i-bullet_character-3D" class="method-detail ">
801
-
802
- <div class="method-heading">
803
- <span class="method-name">bullet_character=</span><span
804
- class="method-args">(character)</span>
805
-
806
- <span class="method-click-advice">click to toggle source</span>
807
-
808
- </div>
809
-
810
-
811
- <div class="method-description">
812
-
813
- <p>Setter for bullet_character. Must be * (asterisk) or - (dash).</p>
814
-
815
- <p>@param [String] character</p>
816
-
817
- <p>@return [String]</p>
818
-
819
-
820
-
821
-
822
- <div class="method-source-code" id="bullet_character-3D-source">
823
- <pre><span class="ruby-comment"># File lib/standup_md.rb, line 356</span>
824
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">bullet_character=</span>(<span class="ruby-identifier">character</span>)
825
- <span class="ruby-identifier">raise</span> <span class="ruby-string">&#39;Must be &quot;-&quot; or &quot;*&quot;&#39;</span> <span class="ruby-keyword">unless</span> <span class="ruby-node">%w[- *]</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">character</span>)
826
- <span class="ruby-ivar">@bullet_character</span> = <span class="ruby-identifier">character</span>
827
- <span class="ruby-keyword">end</span></pre>
828
- </div>
829
-
830
- </div>
831
-
832
-
833
-
834
-
835
- </div>
836
-
837
-
838
- <div id="method-i-config_file-3D" class="method-detail ">
839
-
840
- <div class="method-heading">
841
- <span class="method-name">config_file=</span><span
842
- class="method-args">(config_file)</span>
843
-
844
- <span class="method-click-advice">click to toggle source</span>
845
-
846
- </div>
847
-
848
-
849
- <div class="method-description">
850
-
851
- <p>Setter for <code>config_file</code>. Must be expanded in case the user uses `~` for home.</p>
852
-
853
- <p>@param [String] file</p>
854
-
855
- <p>@return [String]</p>
856
-
857
-
858
-
859
-
860
- <div class="method-source-code" id="config_file-3D-source">
861
- <pre><span class="ruby-comment"># File lib/standup_md.rb, line 368</span>
862
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">config_file=</span>(<span class="ruby-identifier">config_file</span>)
863
- <span class="ruby-ivar">@config_file</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">config_file</span>)
864
- <span class="ruby-keyword">end</span></pre>
865
- </div>
866
-
867
- </div>
868
-
869
-
870
-
871
-
872
- </div>
873
-
874
-
875
- <div id="method-i-config_file_loaded-3F" class="method-detail ">
876
-
877
- <div class="method-heading">
878
- <span class="method-name">config_file_loaded?</span><span
879
- class="method-args">()</span>
880
-
881
- <span class="method-click-advice">click to toggle source</span>
882
-
883
- </div>
884
-
885
-
886
- <div class="method-description">
887
-
888
- <p>Has a config file been loaded?</p>
889
-
890
- <p>@return [Boolean]</p>
891
-
892
-
893
-
894
-
895
- <div class="method-source-code" id="config_file_loaded-3F-source">
896
- <pre><span class="ruby-comment"># File lib/standup_md.rb, line 278</span>
897
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">config_file_loaded?</span>
898
- <span class="ruby-ivar">@config_file_loaded</span>
899
- <span class="ruby-keyword">end</span></pre>
900
- </div>
901
-
902
- </div>
903
-
904
-
905
-
906
-
907
- </div>
908
-
909
-
910
- <div id="method-i-current_entry_tasks-3D" class="method-detail ">
911
-
912
- <div class="method-heading">
913
- <span class="method-name">current_entry_tasks=</span><span
914
- class="method-args">(tasks)</span>
915
-
916
- <span class="method-click-advice">click to toggle source</span>
917
-
918
- </div>
919
-
920
-
921
- <div class="method-description">
922
-
923
- <p>Setter for current entry tasks.</p>
924
-
925
- <p>@param [Array] tasks</p>
926
-
927
- <p>@return [Array]</p>
928
-
929
-
930
-
931
-
932
- <div class="method-source-code" id="current_entry_tasks-3D-source">
933
- <pre><span class="ruby-comment"># File lib/standup_md.rb, line 334</span>
934
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">current_entry_tasks=</span>(<span class="ruby-identifier">tasks</span>)
935
- <span class="ruby-identifier">raise</span> <span class="ruby-string">&#39;Must be an Array&#39;</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">tasks</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Array</span>)
936
- <span class="ruby-ivar">@current_entry_tasks</span> = <span class="ruby-identifier">tasks</span>
937
- <span class="ruby-keyword">end</span></pre>
938
- </div>
939
-
940
- </div>
941
-
942
-
943
-
944
-
945
- </div>
946
-
947
-
948
- <div id="method-i-directory-3D" class="method-detail ">
949
-
950
- <div class="method-heading">
951
- <span class="method-name">directory=</span><span
952
- class="method-args">(directory)</span>
953
-
954
- <span class="method-click-advice">click to toggle source</span>
955
-
956
- </div>
957
-
958
-
959
- <div class="method-description">
960
-
961
- <p>Setter for directory. Must be expanded in case the user uses `~` for home. If the directory doesn&#39;t exist, it will be created. To reset instance variables after changing the directory, you&#39;ll need to call load.</p>
962
-
963
- <p>@param [String] directory</p>
964
-
965
- <p>@return [String]</p>
966
-
967
-
968
-
969
-
970
- <div class="method-source-code" id="directory-3D-source">
971
- <pre><span class="ruby-comment"># File lib/standup_md.rb, line 380</span>
972
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">directory=</span>(<span class="ruby-identifier">directory</span>)
973
- <span class="ruby-identifier">directory</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">directory</span>)
974
- <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span>(<span class="ruby-identifier">directory</span>) <span class="ruby-keyword">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-identifier">directory</span>)
975
- <span class="ruby-ivar">@directory</span> = <span class="ruby-identifier">directory</span>
976
- <span class="ruby-keyword">end</span></pre>
977
- </div>
978
-
979
- </div>
980
-
981
-
982
-
983
-
984
- </div>
985
-
986
-
987
- <div id="method-i-entry_previously_added-3F" class="method-detail ">
988
-
989
- <div class="method-heading">
990
- <span class="method-name">entry_previously_added?</span><span
991
- class="method-args">()</span>
992
-
993
- <span class="method-click-advice">click to toggle source</span>
994
-
995
- </div>
996
-
997
-
998
- <div class="method-description">
999
-
1000
- <p>Was today&#39;s entry already in the file?</p>
1001
-
1002
- <p>@return [boolean] true if today&#39;s entry was already in the file</p>
1003
-
1004
-
1005
-
1006
-
1007
- <div class="method-source-code" id="entry_previously_added-3F-source">
1008
- <pre><span class="ruby-comment"># File lib/standup_md.rb, line 302</span>
1009
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">entry_previously_added?</span>
1010
- <span class="ruby-ivar">@entry_previously_added</span>
1011
- <span class="ruby-keyword">end</span></pre>
1012
- </div>
1013
-
1014
- </div>
1015
-
1016
-
1017
-
1018
-
1019
- </div>
67
+ <h3>Methods</h3>
1020
68
 
69
+ <ul class="link-list" role="directory">
1021
70
 
1022
- <div id="method-i-file_written-3F" class="method-detail ">
1023
-
1024
- <div class="method-heading">
1025
- <span class="method-name">file_written?</span><span
1026
- class="method-args">()</span>
1027
-
1028
- <span class="method-click-advice">click to toggle source</span>
1029
-
1030
- </div>
1031
-
1032
-
1033
- <div class="method-description">
1034
-
1035
- <p>Has the file been written since instantiated?</p>
1036
-
1037
- <p>@return [boolean]</p>
1038
-
1039
- <p>@example</p>
1040
-
1041
- <pre class="ruby"><span class="ruby-identifier">su</span> = <span class="ruby-constant">StandupMD</span>.<span class="ruby-identifier">new</span>
1042
- <span class="ruby-identifier">su</span>.<span class="ruby-identifier">file_written?</span>
1043
- <span class="ruby-comment"># =&gt; false</span>
1044
- <span class="ruby-identifier">su</span>.<span class="ruby-identifier">write</span>
1045
- <span class="ruby-identifier">su</span>.<span class="ruby-identifier">file_written?</span>
1046
- <span class="ruby-comment"># =&gt; true</span>
1047
- </pre>
1048
-
1049
-
1050
-
1051
-
1052
- <div class="method-source-code" id="file_written-3F-source">
1053
- <pre><span class="ruby-comment"># File lib/standup_md.rb, line 294</span>
1054
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">file_written?</span>
1055
- <span class="ruby-ivar">@file_written</span>
1056
- <span class="ruby-keyword">end</span></pre>
1057
- </div>
1058
-
1059
- </div>
1060
-
1061
-
1062
-
1063
-
1064
- </div>
1065
-
71
+ <li ><a href="#method-c-config">::config</a>
1066
72
 
1067
- <div id="method-i-header_depth-3D" class="method-detail ">
1068
-
1069
- <div class="method-heading">
1070
- <span class="method-name">header_depth=</span><span
1071
- class="method-args">(depth)</span>
1072
-
1073
- <span class="method-click-advice">click to toggle source</span>
1074
-
1075
- </div>
1076
-
1077
-
1078
- <div class="method-description">
1079
-
1080
- <p>Number of octothorps (#) to use before the main header.</p>
1081
-
1082
- <p>@param [Integer] depth</p>
1083
-
1084
- <p>@return [Integer]</p>
1085
-
1086
-
1087
-
1088
-
1089
- <div class="method-source-code" id="header_depth-3D-source">
1090
- <pre><span class="ruby-comment"># File lib/standup_md.rb, line 392</span>
1091
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">header_depth=</span>(<span class="ruby-identifier">depth</span>)
1092
- <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">depth</span>.<span class="ruby-identifier">between?</span>(<span class="ruby-value">1</span>, <span class="ruby-value">5</span>)
1093
- <span class="ruby-identifier">raise</span> <span class="ruby-string">&#39;Header depth out of bounds (1..5)&#39;</span>
1094
- <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">depth</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-identifier">sub_header_depth</span>
1095
- <span class="ruby-ivar">@sub_header_depth</span> = <span class="ruby-identifier">depth</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>
1096
- <span class="ruby-keyword">end</span>
1097
- <span class="ruby-ivar">@header_depth</span> = <span class="ruby-identifier">depth</span>
1098
- <span class="ruby-keyword">end</span></pre>
1099
- </div>
1100
-
1101
- </div>
1102
-
1103
-
1104
-
1105
-
1106
- </div>
1107
-
73
+ <li ><a href="#method-c-config_file_loaded-3F">::config_file_loaded?</a>
1108
74
 
1109
- <div id="method-i-impediments-3D" class="method-detail ">
1110
-
1111
- <div class="method-heading">
1112
- <span class="method-name">impediments=</span><span
1113
- class="method-args">(tasks)</span>
1114
-
1115
- <span class="method-click-advice">click to toggle source</span>
1116
-
1117
- </div>
1118
-
1119
-
1120
- <div class="method-description">
1121
-
1122
- <p>Setter for impediments.</p>
1123
-
1124
- <p>@param [Array] tasks</p>
1125
-
1126
- <p>@return [Array]</p>
1127
-
1128
-
1129
-
1130
-
1131
- <div class="method-source-code" id="impediments-3D-source">
1132
- <pre><span class="ruby-comment"># File lib/standup_md.rb, line 345</span>
1133
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">impediments=</span>(<span class="ruby-identifier">tasks</span>)
1134
- <span class="ruby-identifier">raise</span> <span class="ruby-string">&#39;Must be an Array&#39;</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">tasks</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Array</span>)
1135
- <span class="ruby-ivar">@impediments</span> = <span class="ruby-identifier">tasks</span>
1136
- <span class="ruby-keyword">end</span></pre>
1137
- </div>
1138
-
1139
- </div>
1140
-
1141
-
1142
-
1143
-
1144
- </div>
1145
-
75
+ <li ><a href="#method-c-configure">::configure</a>
1146
76
 
1147
- <div id="method-i-load" class="method-detail ">
1148
-
1149
- <div class="method-heading">
1150
- <span class="method-name">load</span><span
1151
- class="method-args">()</span>
1152
-
1153
- <span class="method-click-advice">click to toggle source</span>
1154
-
1155
- </div>
1156
-
1157
-
1158
- <div class="method-description">
1159
-
1160
- <p>Sets internal instance variables. Called when first instantiated, or after directory is set.</p>
1161
-
1162
- <p>@return [self]</p>
1163
-
1164
-
1165
-
1166
-
1167
- <div class="method-source-code" id="load-source">
1168
- <pre><span class="ruby-comment"># File lib/standup_md.rb, line 474</span>
1169
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">load</span>
1170
- <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span>(<span class="ruby-identifier">directory</span>) <span class="ruby-keyword">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-identifier">directory</span>)
1171
-
1172
- <span class="ruby-ivar">@today</span> = <span class="ruby-constant">Date</span>.<span class="ruby-identifier">today</span>
1173
- <span class="ruby-ivar">@header</span> = <span class="ruby-identifier">today</span>.<span class="ruby-identifier">strftime</span>(<span class="ruby-identifier">header_date_format</span>)
1174
- <span class="ruby-ivar">@file_written</span> = <span class="ruby-keyword">false</span>
1175
- <span class="ruby-ivar">@file</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">directory</span>, <span class="ruby-identifier">today</span>.<span class="ruby-identifier">strftime</span>(<span class="ruby-identifier">file_name_format</span>)))
1176
- <span class="ruby-ivar">@previous_file</span> = <span class="ruby-identifier">get_previous_file</span>
1177
- <span class="ruby-ivar">@all_previous_entries</span> = <span class="ruby-identifier">get_all_previous_entries</span>
1178
- <span class="ruby-ivar">@entry_previously_added</span> = <span class="ruby-identifier">all_previous_entries</span>.<span class="ruby-identifier">key?</span>(<span class="ruby-identifier">header</span>)
1179
- <span class="ruby-ivar">@previous_entry_tasks</span> = <span class="ruby-identifier">previous_entry</span>[<span class="ruby-identifier">current_header</span>]
1180
- <span class="ruby-ivar">@current_entry</span> = <span class="ruby-ivar">@all_previous_entries</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">header</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">new_entry</span>
1181
- <span class="ruby-ivar">@all_entries</span> = {<span class="ruby-identifier">header</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">current_entry</span>}.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">all_previous_entries</span>)
1182
-
1183
- <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">touch</span>(<span class="ruby-identifier">file</span>) <span class="ruby-keyword">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">file?</span>(<span class="ruby-identifier">file</span>)
1184
- <span class="ruby-keyword">self</span>
1185
- <span class="ruby-keyword">end</span></pre>
1186
- </div>
1187
-
1188
- </div>
77
+ <li ><a href="#method-c-load_config_file">::load_config_file</a>
78
+
79
+ <li ><a href="#method-c-reset_config">::reset_config</a>
80
+
81
+ </ul>
82
+ </div>
1189
83
 
1190
-
1191
- <div class="aliases">
1192
- Also aliased as: <a href="StandupMD.html#method-i-reload">reload</a>
1193
- </div>
1194
-
84
+ </div>
85
+ </nav>
1195
86
 
1196
-
1197
- </div>
87
+ <main role="main" aria-labelledby="module-StandupMD">
88
+ <h1 id="module-StandupMD" class="module">
89
+ module StandupMD
90
+ </h1>
1198
91
 
92
+ <section class="description">
1199
93
 
1200
- <div id="method-i-load_config_file" class="method-detail ">
1201
-
1202
- <div class="method-heading">
1203
- <span class="method-name">load_config_file</span><span
1204
- class="method-args">()</span>
1205
-
1206
- <span class="method-click-advice">click to toggle source</span>
1207
-
1208
- </div>
1209
-
1210
-
1211
- <div class="method-description">
1212
-
1213
- <p>Loads the config file</p>
1214
-
1215
- <p>@return [Hash] The config options</p>
1216
-
1217
-
94
+ <p>The class for handing reading/writing of entries.</p>
1218
95
 
1219
-
1220
- <div class="method-source-code" id="load_config_file-source">
1221
- <pre><span class="ruby-comment"># File lib/standup_md.rb, line 440</span>
1222
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">load_config_file</span>
1223
- <span class="ruby-identifier">raise</span> <span class="ruby-string">&#39;No config file set&#39;</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">config_file</span>.<span class="ruby-identifier">nil?</span>
1224
- <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;File #{config_file} does not exist&quot;</span> <span class="ruby-keyword">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">file?</span>(<span class="ruby-identifier">config_file</span>)
1225
- <span class="ruby-ivar">@config</span> = <span class="ruby-constant">YAML</span><span class="ruby-operator">::</span><span class="ruby-identifier">load_file</span>(<span class="ruby-identifier">config_file</span>)
1226
- <span class="ruby-ivar">@config_file_loaded</span> = <span class="ruby-keyword">true</span>
1227
- <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>, <span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">send</span>(<span class="ruby-node">&quot;#{k}=&quot;</span>, <span class="ruby-identifier">v</span>) }
1228
- <span class="ruby-keyword">end</span></pre>
1229
- </div>
1230
-
1231
- </div>
96
+ </section>
1232
97
 
1233
-
98
+
99
+ <section id="5Buntitled-5D" class="documentation-section">
100
+
1234
101
 
1235
-
1236
- </div>
102
+
1237
103
 
1238
104
 
1239
- <div id="method-i-new_month-3F" class="method-detail ">
1240
-
1241
- <div class="method-heading">
1242
- <span class="method-name">new_month?</span><span
1243
- class="method-args">()</span>
1244
-
1245
- <span class="method-click-advice">click to toggle source</span>
1246
-
1247
- </div>
105
+ <section class="constants-list">
106
+ <header>
107
+ <h3>Constants</h3>
108
+ </header>
109
+ <dl>
110
+
111
+ <dt id="VERSION">VERSION
1248
112
 
113
+ <dd><p>The gem verision</p>
1249
114
 
1250
- <div class="method-description">
1251
-
1252
- <p>Is today a different month than the previous entry?</p>
1253
-
1254
-
1255
-
1256
-
1257
- <div class="method-source-code" id="new_month-3F-source">
1258
- <pre><span class="ruby-comment"># File lib/standup_md.rb, line 500</span>
1259
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">new_month?</span>
1260
- <span class="ruby-identifier">file</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">previous_file</span>
1261
- <span class="ruby-keyword">end</span></pre>
1262
- </div>
1263
-
1264
- </div>
1265
-
1266
-
115
+ <p>@example</p>
1267
116
 
117
+ <pre class="ruby"><span class="ruby-constant">StandupMD</span><span class="ruby-operator">::</span><span class="ruby-constant">VERSION</span>
118
+ <span class="ruby-comment"># =&gt; &#39;0.3.0&#39;</span>
119
+ </pre>
1268
120
 
1269
- </div>
1270
-
121
+
122
+ </dl>
123
+ </section>
1271
124
 
1272
- <div id="method-i-notes-3D" class="method-detail ">
1273
-
1274
- <div class="method-heading">
1275
- <span class="method-name">notes=</span><span
1276
- class="method-args">(tasks)</span>
1277
-
1278
- <span class="method-click-advice">click to toggle source</span>
1279
-
1280
- </div>
1281
-
1282
125
 
1283
- <div class="method-description">
1284
-
1285
- <p>Setter for notes.</p>
1286
-
1287
- <p>@param [Array] notes</p>
1288
-
1289
- <p>@return [Array]</p>
1290
-
1291
-
1292
-
1293
-
1294
- <div class="method-source-code" id="notes-3D-source">
1295
- <pre><span class="ruby-comment"># File lib/standup_md.rb, line 323</span>
1296
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">notes=</span>(<span class="ruby-identifier">tasks</span>)
1297
- <span class="ruby-identifier">raise</span> <span class="ruby-string">&#39;Must be an Array&#39;</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">tasks</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Array</span>)
1298
- <span class="ruby-ivar">@notes</span> = <span class="ruby-identifier">tasks</span>
1299
- <span class="ruby-keyword">end</span></pre>
1300
- </div>
1301
-
1302
- </div>
1303
-
1304
-
126
+
1305
127
 
1306
-
1307
- </div>
128
+
129
+ <section id="public-class-5Buntitled-5D-method-details" class="method-section">
130
+ <header>
131
+ <h3>Public Class Methods</h3>
132
+ </header>
1308
133
 
1309
134
 
1310
- <div id="method-i-previous_entry_tasks-3D" class="method-detail ">
135
+ <div id="method-c-config" class="method-detail ">
1311
136
 
1312
137
  <div class="method-heading">
1313
- <span class="method-name">previous_entry_tasks=</span><span
1314
- class="method-args">(tasks)</span>
138
+ <span class="method-name">config</span><span
139
+ class="method-args">()</span>
1315
140
 
1316
141
  <span class="method-click-advice">click to toggle source</span>
1317
142
 
@@ -1320,20 +145,17 @@
1320
145
 
1321
146
  <div class="method-description">
1322
147
 
1323
- <p>Setter for current entry tasks.</p>
148
+ <p>Shorthand for <code>StanupMD::Cli</code></p>
1324
149
 
1325
- <p>@param [Array] tasks</p>
1326
-
1327
- <p>@return [Array]</p>
150
+ <p>@return [StanupMD::Cli]</p>
1328
151
 
1329
152
 
1330
153
 
1331
154
 
1332
- <div class="method-source-code" id="previous_entry_tasks-3D-source">
1333
- <pre><span class="ruby-comment"># File lib/standup_md.rb, line 312</span>
1334
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">previous_entry_tasks=</span>(<span class="ruby-identifier">tasks</span>)
1335
- <span class="ruby-identifier">raise</span> <span class="ruby-string">&#39;Must be an Array&#39;</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">tasks</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Array</span>)
1336
- <span class="ruby-ivar">@previous_entry_tasks</span> = <span class="ruby-identifier">tasks</span>
155
+ <div class="method-source-code" id="config-source">
156
+ <pre><span class="ruby-comment"># File lib/standup_md.rb, line 19</span>
157
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">config</span>
158
+ <span class="ruby-ivar">@config</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">StandupMD</span><span class="ruby-operator">::</span><span class="ruby-constant">Config</span>.<span class="ruby-identifier">new</span>
1337
159
  <span class="ruby-keyword">end</span></pre>
1338
160
  </div>
1339
161
 
@@ -1345,42 +167,12 @@
1345
167
  </div>
1346
168
 
1347
169
 
1348
- <div id="method-i-reload" class="method-detail method-alias">
170
+ <div id="method-c-config_file_loaded-3F" class="method-detail ">
1349
171
 
1350
172
  <div class="method-heading">
1351
- <span class="method-name">reload</span><span
173
+ <span class="method-name">config_file_loaded?</span><span
1352
174
  class="method-args">()</span>
1353
175
 
1354
- </div>
1355
-
1356
-
1357
- <div class="method-description">
1358
-
1359
- <p>Alias of <code>load</code></p>
1360
-
1361
- <p>@return [self]</p>
1362
-
1363
-
1364
-
1365
-
1366
- </div>
1367
-
1368
-
1369
-
1370
-
1371
- <div class="aliases">
1372
- Alias for: <a href="StandupMD.html#method-i-load">load</a>
1373
- </div>
1374
-
1375
- </div>
1376
-
1377
-
1378
- <div id="method-i-sub_header_depth-3D" class="method-detail ">
1379
-
1380
- <div class="method-heading">
1381
- <span class="method-name">sub_header_depth=</span><span
1382
- class="method-args">(depth)</span>
1383
-
1384
176
  <span class="method-click-advice">click to toggle source</span>
1385
177
 
1386
178
  </div>
@@ -1388,24 +180,17 @@
1388
180
 
1389
181
  <div class="method-description">
1390
182
 
1391
- <p>Number of octothorps (#) to use before sub headers (Current, Previous, etc).</p>
1392
-
1393
- <p>@param [Integer] depth</p>
183
+ <p>Has a config file been loaded?</p>
1394
184
 
1395
- <p>@return [Integer]</p>
185
+ <p>@return [Boolean]</p>
1396
186
 
1397
187
 
1398
188
 
1399
189
 
1400
- <div class="method-source-code" id="sub_header_depth-3D-source">
1401
- <pre><span class="ruby-comment"># File lib/standup_md.rb, line 407</span>
1402
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">sub_header_depth=</span>(<span class="ruby-identifier">depth</span>)
1403
- <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">depth</span>.<span class="ruby-identifier">between?</span>(<span class="ruby-value">2</span>, <span class="ruby-value">6</span>)
1404
- <span class="ruby-identifier">raise</span> <span class="ruby-string">&#39;Sub-header depth out of bounds (2..6)&#39;</span>
1405
- <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">depth</span> <span class="ruby-operator">&lt;=</span> <span class="ruby-identifier">header_depth</span>
1406
- <span class="ruby-ivar">@header_depth</span> = <span class="ruby-identifier">depth</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
1407
- <span class="ruby-keyword">end</span>
1408
- <span class="ruby-ivar">@sub_header_depth</span> = <span class="ruby-identifier">depth</span>
190
+ <div class="method-source-code" id="config_file_loaded-3F-source">
191
+ <pre><span class="ruby-comment"># File lib/standup_md.rb, line 44</span>
192
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">config_file_loaded?</span>
193
+ <span class="ruby-ivar">@config_file_loaded</span>
1409
194
  <span class="ruby-keyword">end</span></pre>
1410
195
  </div>
1411
196
 
@@ -1417,11 +202,11 @@
1417
202
  </div>
1418
203
 
1419
204
 
1420
- <div id="method-i-sub_header_order" class="method-detail ">
205
+ <div id="method-c-configure" class="method-detail ">
1421
206
 
1422
207
  <div class="method-heading">
1423
- <span class="method-name">sub_header_order</span><span
1424
- class="method-args">()</span>
208
+ <span class="method-name">configure</span><span
209
+ class="method-args">() { |config| ... }</span>
1425
210
 
1426
211
  <span class="method-click-advice">click to toggle source</span>
1427
212
 
@@ -1430,17 +215,20 @@
1430
215
 
1431
216
  <div class="method-description">
1432
217
 
1433
- <p>Return a copy of the sub-header order so the user can&#39;t modify the array.</p>
218
+ <p>Allows for configuration via a block. Useful when making config files.</p>
219
+
220
+ <p>@example</p>
1434
221
 
1435
- <p>@return [Array]</p>
222
+ <pre class="ruby"><span class="ruby-constant">StandupMD</span>.<span class="ruby-identifier">configure</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">cli</span>.<span class="ruby-identifier">editor</span> = <span class="ruby-string">&#39;mate&#39;</span> }
223
+ </pre>
1436
224
 
1437
225
 
1438
226
 
1439
227
 
1440
- <div class="method-source-code" id="sub_header_order-source">
1441
- <pre><span class="ruby-comment"># File lib/standup_md.rb, line 432</span>
1442
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">sub_header_order</span>
1443
- <span class="ruby-ivar">@sub_header_order</span>.<span class="ruby-identifier">dup</span>
228
+ <div class="method-source-code" id="configure-source">
229
+ <pre><span class="ruby-comment"># File lib/standup_md.rb, line 36</span>
230
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">configure</span>
231
+ <span class="ruby-keyword">yield</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">config</span>
1444
232
  <span class="ruby-keyword">end</span></pre>
1445
233
  </div>
1446
234
 
@@ -1452,11 +240,11 @@
1452
240
  </div>
1453
241
 
1454
242
 
1455
- <div id="method-i-sub_header_order-3D" class="method-detail ">
243
+ <div id="method-c-load_config_file" class="method-detail ">
1456
244
 
1457
245
  <div class="method-heading">
1458
- <span class="method-name">sub_header_order=</span><span
1459
- class="method-args">(array)</span>
246
+ <span class="method-name">load_config_file</span><span
247
+ class="method-args">(file)</span>
1460
248
 
1461
249
  <span class="method-click-advice">click to toggle source</span>
1462
250
 
@@ -1465,21 +253,20 @@
1465
253
 
1466
254
  <div class="method-description">
1467
255
 
1468
- <p>Preferred order for sub-headers.</p>
1469
-
1470
- <p>@param [Array] Values must be %w[previous current impediment notes]</p>
256
+ <p>Loads a config file.</p>
1471
257
 
1472
- <p>@return [Array]</p>
258
+ <p>@param [String] file</p>
1473
259
 
1474
260
 
1475
261
 
1476
262
 
1477
- <div class="method-source-code" id="sub_header_order-3D-source">
1478
- <pre><span class="ruby-comment"># File lib/standup_md.rb, line 422</span>
1479
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">sub_header_order=</span>(<span class="ruby-identifier">array</span>)
1480
- <span class="ruby-identifier">order</span> = <span class="ruby-node">%w[previous current impediments notes]</span>
1481
- <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Values must be #{order.join{&#39;, &#39;}}&quot;</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">order</span>.<span class="ruby-identifier">sort</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">array</span>.<span class="ruby-identifier">sort</span>
1482
- <span class="ruby-ivar">@sub_header_order</span> = <span class="ruby-identifier">array</span>
263
+ <div class="method-source-code" id="load_config_file-source">
264
+ <pre><span class="ruby-comment"># File lib/standup_md.rb, line 52</span>
265
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">load_config_file</span>(<span class="ruby-identifier">file</span>)
266
+ <span class="ruby-identifier">file</span> = <span class="ruby-operator">::</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">file</span>)
267
+ <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;File #{file} does not exist.&quot;</span> <span class="ruby-keyword">unless</span> <span class="ruby-operator">::</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">file?</span>(<span class="ruby-identifier">file</span>)
268
+ <span class="ruby-ivar">@config_file_loaded</span> = <span class="ruby-keyword">true</span>
269
+ <span class="ruby-identifier">load</span> <span class="ruby-identifier">file</span>
1483
270
  <span class="ruby-keyword">end</span></pre>
1484
271
  </div>
1485
272
 
@@ -1491,10 +278,10 @@
1491
278
  </div>
1492
279
 
1493
280
 
1494
- <div id="method-i-write" class="method-detail ">
281
+ <div id="method-c-reset_config" class="method-detail ">
1495
282
 
1496
283
  <div class="method-heading">
1497
- <span class="method-name">write</span><span
284
+ <span class="method-name">reset_config</span><span
1498
285
  class="method-args">()</span>
1499
286
 
1500
287
  <span class="method-click-advice">click to toggle source</span>
@@ -1504,30 +291,17 @@
1504
291
 
1505
292
  <div class="method-description">
1506
293
 
1507
- <p>Writes a new entry to the file if the first entry in the file isn&#39;t today.</p>
294
+ <p>Reset all configuration values to their defaults.</p>
1508
295
 
1509
- <p>@return [Boolean]</p>
296
+ <p>@return [StandupMD::Config]</p>
1510
297
 
1511
298
 
1512
299
 
1513
300
 
1514
- <div class="method-source-code" id="write-source">
1515
- <pre><span class="ruby-comment"># File lib/standup_md.rb, line 452</span>
1516
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">write</span>
1517
- <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">file</span>, <span class="ruby-string">&#39;w&#39;</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
1518
- <span class="ruby-identifier">all_entries</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">head</span>, <span class="ruby-identifier">s_heads</span><span class="ruby-operator">|</span>
1519
- <span class="ruby-identifier">f</span>.<span class="ruby-identifier">puts</span> <span class="ruby-string">&#39;#&#39;</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">header_depth</span> <span class="ruby-operator">+</span> <span class="ruby-string">&#39; &#39;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">head</span>
1520
- <span class="ruby-identifier">sub_header_order</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">value</span><span class="ruby-operator">|</span> <span class="ruby-node">&quot;#{value}_header&quot;</span> }.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">sub_head</span><span class="ruby-operator">|</span>
1521
- <span class="ruby-identifier">sh</span> = <span class="ruby-identifier">send</span>(<span class="ruby-identifier">sub_head</span>).<span class="ruby-identifier">capitalize</span>
1522
- <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">s_heads</span>[<span class="ruby-identifier">sh</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">s_heads</span>[<span class="ruby-identifier">sh</span>].<span class="ruby-identifier">empty?</span>
1523
- <span class="ruby-identifier">f</span>.<span class="ruby-identifier">puts</span> <span class="ruby-string">&#39;#&#39;</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">sub_header_depth</span> <span class="ruby-operator">+</span> <span class="ruby-string">&#39; &#39;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">sh</span>
1524
- <span class="ruby-identifier">s_heads</span>[<span class="ruby-identifier">sh</span>].<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">task</span><span class="ruby-operator">|</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">bullet_character</span> <span class="ruby-operator">+</span> <span class="ruby-string">&#39; &#39;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">task</span> }
1525
- <span class="ruby-keyword">end</span>
1526
- <span class="ruby-identifier">f</span>.<span class="ruby-identifier">puts</span>
1527
- <span class="ruby-keyword">break</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">new_month?</span>
1528
- <span class="ruby-keyword">end</span>
1529
- <span class="ruby-keyword">end</span>
1530
- <span class="ruby-ivar">@file_written</span> = <span class="ruby-keyword">true</span>
301
+ <div class="method-source-code" id="reset_config-source">
302
+ <pre><span class="ruby-comment"># File lib/standup_md.rb, line 27</span>
303
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">reset_config</span>
304
+ <span class="ruby-ivar">@config</span> = <span class="ruby-constant">StandupMD</span><span class="ruby-operator">::</span><span class="ruby-constant">Config</span>.<span class="ruby-identifier">new</span>
1531
305
  <span class="ruby-keyword">end</span></pre>
1532
306
  </div>
1533
307