standup_md 0.3.6 → 0.3.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +9 -20
- data/doc/README_md.html +9 -22
- data/doc/StandupMD.html +14 -85
- data/doc/StandupMD/Cli.html +17 -159
- data/doc/StandupMD/Cli/Helpers.html +5 -27
- data/doc/StandupMD/Config.html +7 -44
- data/doc/StandupMD/Config/Cli.html +8 -76
- data/doc/StandupMD/Config/Entry.html +8 -64
- data/doc/StandupMD/Config/EntryList.html +7 -48
- data/doc/StandupMD/Config/File.html +11 -143
- data/doc/StandupMD/Entry.html +22 -133
- data/doc/StandupMD/EntryList.html +16 -198
- data/doc/StandupMD/File.html +31 -165
- data/doc/StandupMD/Version.html +63 -40
- data/doc/created.rid +9 -9
- data/doc/css/rdoc.css +1 -1
- data/doc/index.html +9 -36
- data/doc/js/navigation.js.gz +0 -0
- data/doc/js/search_index.js +1 -1
- data/doc/js/search_index.js.gz +0 -0
- data/doc/js/searcher.js.gz +0 -0
- data/doc/table_of_contents.html +42 -94
- data/lib/standup_md.rb +8 -5
- data/lib/standup_md/cli.rb +7 -7
- data/lib/standup_md/cli/helpers.rb +10 -13
- data/lib/standup_md/config/file.rb +3 -3
- data/lib/standup_md/entry.rb +7 -9
- data/lib/standup_md/entry_list.rb +2 -2
- data/lib/standup_md/version.rb +26 -4
- metadata +2 -2
data/doc/StandupMD/File.html
CHANGED
@@ -21,8 +21,6 @@
|
|
21
21
|
<link href="../css/rdoc.css" rel="stylesheet">
|
22
22
|
|
23
23
|
|
24
|
-
|
25
|
-
|
26
24
|
<body id="top" role="document" class="class">
|
27
25
|
<nav role="navigation">
|
28
26
|
<div id="project-navigation">
|
@@ -59,42 +57,31 @@
|
|
59
57
|
|
60
58
|
<div id="class-metadata">
|
61
59
|
|
62
|
-
|
60
|
+
|
61
|
+
<div id="parent-class-section" class="nav-section">
|
63
62
|
<h3>Parent</h3>
|
64
63
|
|
65
|
-
|
66
64
|
<p class="link">Object
|
67
|
-
|
68
65
|
</div>
|
69
66
|
|
70
67
|
|
71
68
|
|
72
|
-
|
69
|
+
|
70
|
+
<!-- Method Quickref -->
|
73
71
|
<div id="method-list-section" class="nav-section">
|
74
72
|
<h3>Methods</h3>
|
75
73
|
|
76
74
|
<ul class="link-list" role="directory">
|
77
|
-
|
78
75
|
<li ><a href="#method-c-config">::config</a>
|
79
|
-
|
80
76
|
<li ><a href="#method-c-find">::find</a>
|
81
|
-
|
82
77
|
<li ><a href="#method-c-find_by_date">::find_by_date</a>
|
83
|
-
|
84
78
|
<li ><a href="#method-c-load">::load</a>
|
85
|
-
|
86
79
|
<li ><a href="#method-c-new">::new</a>
|
87
|
-
|
88
80
|
<li ><a href="#method-i-exist-3F">#exist?</a>
|
89
|
-
|
90
81
|
<li ><a href="#method-i-load">#load</a>
|
91
|
-
|
92
82
|
<li ><a href="#method-i-loaded-3F">#loaded?</a>
|
93
|
-
|
94
83
|
<li ><a href="#method-i-new-3F">#new?</a>
|
95
|
-
|
96
84
|
<li ><a href="#method-i-write">#write</a>
|
97
|
-
|
98
85
|
</ul>
|
99
86
|
</div>
|
100
87
|
|
@@ -112,21 +99,15 @@
|
|
112
99
|
|
113
100
|
</section>
|
114
101
|
|
115
|
-
|
116
102
|
<section id="5Buntitled-5D" class="documentation-section">
|
117
|
-
|
118
103
|
|
119
|
-
|
120
104
|
|
121
|
-
|
122
105
|
|
123
|
-
|
124
106
|
<section class="attribute-method-details" class="method-section">
|
125
107
|
<header>
|
126
108
|
<h3>Attributes</h3>
|
127
109
|
</header>
|
128
110
|
|
129
|
-
|
130
111
|
<div id="attribute-i-entries" class="method-detail">
|
131
112
|
<div class="method-heading attribute-method-heading">
|
132
113
|
<span class="method-name">entries</span><span
|
@@ -134,14 +115,11 @@
|
|
134
115
|
</div>
|
135
116
|
|
136
117
|
<div class="method-description">
|
137
|
-
|
138
118
|
<p>The list of entries in the file.</p>
|
139
119
|
|
140
120
|
<p>@return [StandupMP::EntryList]</p>
|
141
|
-
|
142
121
|
</div>
|
143
122
|
</div>
|
144
|
-
|
145
123
|
<div id="attribute-i-name" class="method-detail">
|
146
124
|
<div class="method-heading attribute-method-heading">
|
147
125
|
<span class="method-name">name</span><span
|
@@ -149,195 +127,149 @@
|
|
149
127
|
</div>
|
150
128
|
|
151
129
|
<div class="method-description">
|
152
|
-
|
153
130
|
<p>The name of the file.</p>
|
154
131
|
|
155
132
|
<p>@return [String]</p>
|
156
|
-
|
157
133
|
</div>
|
158
134
|
</div>
|
159
|
-
|
160
135
|
</section>
|
161
|
-
|
162
136
|
|
163
|
-
|
137
|
+
|
164
138
|
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
165
139
|
<header>
|
166
140
|
<h3>Public Class Methods</h3>
|
167
141
|
</header>
|
168
142
|
|
169
|
-
|
170
143
|
<div id="method-c-config" class="method-detail ">
|
171
|
-
|
172
144
|
<div class="method-heading">
|
173
145
|
<span class="method-name">config</span><span
|
174
146
|
class="method-args">()</span>
|
175
|
-
|
176
147
|
<span class="method-click-advice">click to toggle source</span>
|
177
|
-
|
178
148
|
</div>
|
179
|
-
|
180
149
|
|
181
150
|
<div class="method-description">
|
182
|
-
|
183
151
|
<p>Access to the class's configuration.</p>
|
184
152
|
|
185
153
|
<p>@return [StandupMD::Config::EntryList]</p>
|
186
|
-
|
187
|
-
|
188
154
|
|
189
|
-
|
190
155
|
<div class="method-source-code" id="config-source">
|
191
156
|
<pre><span class="ruby-comment"># File lib/standup_md/file.rb, line 17</span>
|
192
157
|
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">config</span>
|
193
158
|
<span class="ruby-ivar">@config</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">StandupMD</span>.<span class="ruby-identifier">config</span>.<span class="ruby-identifier">file</span>
|
194
159
|
<span class="ruby-keyword">end</span></pre>
|
195
160
|
</div>
|
196
|
-
|
197
161
|
</div>
|
198
162
|
|
199
|
-
|
200
163
|
|
201
|
-
|
202
164
|
</div>
|
203
165
|
|
204
|
-
|
205
166
|
<div id="method-c-find" class="method-detail ">
|
206
|
-
|
207
167
|
<div class="method-heading">
|
208
168
|
<span class="method-name">find</span><span
|
209
169
|
class="method-args">(file_name)</span>
|
210
|
-
|
211
170
|
<span class="method-click-advice">click to toggle source</span>
|
212
|
-
|
213
171
|
</div>
|
214
|
-
|
215
172
|
|
216
173
|
<div class="method-description">
|
217
|
-
|
218
174
|
<p>Find standup file in directory by file name.</p>
|
219
175
|
|
220
176
|
<p>@param [String] File_naem</p>
|
221
|
-
|
222
|
-
|
223
177
|
|
224
|
-
|
225
178
|
<div class="method-source-code" id="find-source">
|
226
|
-
<pre><span class="ruby-comment"># File lib/standup_md/file.rb, line
|
179
|
+
<pre><span class="ruby-comment"># File lib/standup_md/file.rb, line 40</span>
|
227
180
|
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">find</span>(<span class="ruby-identifier">file_name</span>)
|
181
|
+
<span class="ruby-keyword">unless</span> <span class="ruby-operator">::</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-identifier">config</span>.<span class="ruby-identifier">directory</span>)
|
182
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-node">"Dir #{config.directory} not found."</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">config</span>.<span class="ruby-identifier">create</span>
|
183
|
+
|
184
|
+
<span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span>(<span class="ruby-identifier">config</span>.<span class="ruby-identifier">directory</span>)
|
185
|
+
<span class="ruby-keyword">end</span>
|
228
186
|
<span class="ruby-identifier">file</span> = <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">entries</span>(<span class="ruby-identifier">config</span>.<span class="ruby-identifier">directory</span>).<span class="ruby-identifier">bsearch</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">f</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">file_name</span> }
|
229
187
|
<span class="ruby-identifier">raise</span> <span class="ruby-node">"File #{file_name} not found."</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">file</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span><span class="ruby-identifier">config</span>.<span class="ruby-identifier">create</span>
|
230
188
|
|
231
189
|
<span class="ruby-identifier">new</span>(<span class="ruby-identifier">file_name</span>)
|
232
190
|
<span class="ruby-keyword">end</span></pre>
|
233
191
|
</div>
|
234
|
-
|
235
192
|
</div>
|
236
193
|
|
237
|
-
|
238
194
|
|
239
|
-
|
240
195
|
</div>
|
241
196
|
|
242
|
-
|
243
197
|
<div id="method-c-find_by_date" class="method-detail ">
|
244
|
-
|
245
198
|
<div class="method-heading">
|
246
199
|
<span class="method-name">find_by_date</span><span
|
247
200
|
class="method-args">(date)</span>
|
248
|
-
|
249
201
|
<span class="method-click-advice">click to toggle source</span>
|
250
|
-
|
251
202
|
</div>
|
252
|
-
|
253
203
|
|
254
204
|
<div class="method-description">
|
255
|
-
|
256
205
|
<p>Find standup file in directory by Date object.</p>
|
257
206
|
|
258
207
|
<p>@param [Date] date</p>
|
259
|
-
|
260
|
-
|
261
208
|
|
262
|
-
|
263
209
|
<div class="method-source-code" id="find_by_date-source">
|
264
|
-
<pre><span class="ruby-comment"># File lib/standup_md/file.rb, line
|
210
|
+
<pre><span class="ruby-comment"># File lib/standup_md/file.rb, line 56</span>
|
265
211
|
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">find_by_date</span>(<span class="ruby-identifier">date</span>)
|
266
212
|
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-string">'Must be a Date object'</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">date</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Date</span>)
|
267
213
|
|
214
|
+
<span class="ruby-keyword">unless</span> <span class="ruby-operator">::</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-identifier">config</span>.<span class="ruby-identifier">directory</span>)
|
215
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-node">"Dir #{config.directory} not found."</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">config</span>.<span class="ruby-identifier">create</span>
|
216
|
+
|
217
|
+
<span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span>(<span class="ruby-identifier">config</span>.<span class="ruby-identifier">directory</span>)
|
218
|
+
<span class="ruby-keyword">end</span>
|
268
219
|
<span class="ruby-identifier">find</span>(<span class="ruby-identifier">date</span>.<span class="ruby-identifier">strftime</span>(<span class="ruby-identifier">config</span>.<span class="ruby-identifier">name_format</span>))
|
269
220
|
<span class="ruby-keyword">end</span></pre>
|
270
221
|
</div>
|
271
|
-
|
272
222
|
</div>
|
273
223
|
|
274
|
-
|
275
224
|
|
276
|
-
|
277
225
|
</div>
|
278
226
|
|
279
|
-
|
280
227
|
<div id="method-c-load" class="method-detail ">
|
281
|
-
|
282
228
|
<div class="method-heading">
|
283
229
|
<span class="method-name">load</span><span
|
284
230
|
class="method-args">(file_name)</span>
|
285
|
-
|
286
231
|
<span class="method-click-advice">click to toggle source</span>
|
287
|
-
|
288
232
|
</div>
|
289
|
-
|
290
233
|
|
291
234
|
<div class="method-description">
|
292
|
-
|
293
235
|
<p>Convenience method for calling <a href="File.html#method-c-find"><code>File.find(file_name)</code></a>.load</p>
|
294
236
|
|
295
237
|
<p>@param [String] file_name</p>
|
296
238
|
|
297
239
|
<p>@return [StandupMD::File]</p>
|
298
|
-
|
299
|
-
|
300
240
|
|
301
|
-
|
302
241
|
<div class="method-source-code" id="load-source">
|
303
242
|
<pre><span class="ruby-comment"># File lib/standup_md/file.rb, line 27</span>
|
304
243
|
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">load</span>(<span class="ruby-identifier">file_name</span>)
|
244
|
+
<span class="ruby-keyword">unless</span> <span class="ruby-operator">::</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-identifier">config</span>.<span class="ruby-identifier">directory</span>)
|
245
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-node">"Dir #{config.directory} not found."</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">config</span>.<span class="ruby-identifier">create</span>
|
246
|
+
|
247
|
+
<span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span>(<span class="ruby-identifier">config</span>.<span class="ruby-identifier">directory</span>)
|
248
|
+
<span class="ruby-keyword">end</span>
|
305
249
|
<span class="ruby-identifier">new</span>(<span class="ruby-identifier">file_name</span>).<span class="ruby-identifier">load</span>
|
306
250
|
<span class="ruby-keyword">end</span></pre>
|
307
251
|
</div>
|
308
|
-
|
309
252
|
</div>
|
310
253
|
|
311
|
-
|
312
254
|
|
313
|
-
|
314
255
|
</div>
|
315
256
|
|
316
|
-
|
317
257
|
<div id="method-c-new" class="method-detail ">
|
318
|
-
|
319
258
|
<div class="method-heading">
|
320
259
|
<span class="method-name">new</span><span
|
321
260
|
class="method-args">(file_name)</span>
|
322
|
-
|
323
261
|
<span class="method-click-advice">click to toggle source</span>
|
324
|
-
|
325
262
|
</div>
|
326
|
-
|
327
263
|
|
328
264
|
<div class="method-description">
|
329
|
-
|
330
265
|
<p>Constructs the instance.</p>
|
331
266
|
|
332
267
|
<p>@param [String] file_name</p>
|
333
268
|
|
334
269
|
<p>@return [StandupMP::File]</p>
|
335
|
-
|
336
|
-
|
337
270
|
|
338
|
-
|
339
271
|
<div class="method-source-code" id="new-source">
|
340
|
-
<pre><span class="ruby-comment"># File lib/standup_md/file.rb, line
|
272
|
+
<pre><span class="ruby-comment"># File lib/standup_md/file.rb, line 85</span>
|
341
273
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">file_name</span>)
|
342
274
|
<span class="ruby-ivar">@config</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">config</span>
|
343
275
|
<span class="ruby-keyword">if</span> <span class="ruby-identifier">file_name</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-operator">::</span><span class="ruby-constant">File</span><span class="ruby-operator">::</span><span class="ruby-constant">SEPARATOR</span>)
|
@@ -363,80 +295,55 @@
|
|
363
295
|
<span class="ruby-ivar">@loaded</span> = <span class="ruby-keyword">false</span>
|
364
296
|
<span class="ruby-keyword">end</span></pre>
|
365
297
|
</div>
|
366
|
-
|
367
298
|
</div>
|
368
299
|
|
369
|
-
|
370
300
|
|
371
|
-
|
372
301
|
</div>
|
373
302
|
|
374
|
-
|
375
303
|
</section>
|
376
|
-
|
304
|
+
|
377
305
|
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
378
306
|
<header>
|
379
307
|
<h3>Public Instance Methods</h3>
|
380
308
|
</header>
|
381
309
|
|
382
|
-
|
383
310
|
<div id="method-i-exist-3F" class="method-detail ">
|
384
|
-
|
385
311
|
<div class="method-heading">
|
386
312
|
<span class="method-name">exist?</span><span
|
387
313
|
class="method-args">()</span>
|
388
|
-
|
389
314
|
<span class="method-click-advice">click to toggle source</span>
|
390
|
-
|
391
315
|
</div>
|
392
|
-
|
393
316
|
|
394
317
|
<div class="method-description">
|
395
|
-
|
396
318
|
<p>Does the file exist?</p>
|
397
319
|
|
398
320
|
<p>@return [Boolean] true if exists</p>
|
399
|
-
|
400
|
-
|
401
321
|
|
402
|
-
|
403
322
|
<div class="method-source-code" id="exist-3F-source">
|
404
|
-
<pre><span class="ruby-comment"># File lib/standup_md/file.rb, line
|
323
|
+
<pre><span class="ruby-comment"># File lib/standup_md/file.rb, line 130</span>
|
405
324
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">exist?</span>
|
406
325
|
<span class="ruby-operator">::</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">name</span>)
|
407
326
|
<span class="ruby-keyword">end</span></pre>
|
408
327
|
</div>
|
409
|
-
|
410
328
|
</div>
|
411
329
|
|
412
|
-
|
413
330
|
|
414
|
-
|
415
331
|
</div>
|
416
332
|
|
417
|
-
|
418
333
|
<div id="method-i-load" class="method-detail ">
|
419
|
-
|
420
334
|
<div class="method-heading">
|
421
335
|
<span class="method-name">load</span><span
|
422
336
|
class="method-args">()</span>
|
423
|
-
|
424
337
|
<span class="method-click-advice">click to toggle source</span>
|
425
|
-
|
426
338
|
</div>
|
427
|
-
|
428
339
|
|
429
340
|
<div class="method-description">
|
430
|
-
|
431
341
|
<p>Loads the file's contents. TODO clean up this method.</p>
|
432
342
|
|
433
343
|
<p>@return [StandupMD::FileList]</p>
|
434
|
-
|
435
|
-
|
436
344
|
|
437
|
-
|
438
345
|
<div class="method-source-code" id="load-source">
|
439
|
-
<pre><span class="ruby-comment"># File lib/standup_md/file.rb, line
|
346
|
+
<pre><span class="ruby-comment"># File lib/standup_md/file.rb, line 139</span>
|
440
347
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">load</span>
|
441
348
|
<span class="ruby-identifier">raise</span> <span class="ruby-node">"File #{name} does not exist."</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">name</span>)
|
442
349
|
|
@@ -470,109 +377,73 @@
|
|
470
377
|
<span class="ruby-identifier">raise</span> <span class="ruby-node">"File malformation: #{e}"</span>
|
471
378
|
<span class="ruby-keyword">end</span></pre>
|
472
379
|
</div>
|
473
|
-
|
474
380
|
</div>
|
475
381
|
|
476
|
-
|
477
382
|
|
478
|
-
|
479
383
|
</div>
|
480
384
|
|
481
|
-
|
482
385
|
<div id="method-i-loaded-3F" class="method-detail ">
|
483
|
-
|
484
386
|
<div class="method-heading">
|
485
387
|
<span class="method-name">loaded?</span><span
|
486
388
|
class="method-args">()</span>
|
487
|
-
|
488
389
|
<span class="method-click-advice">click to toggle source</span>
|
489
|
-
|
490
390
|
</div>
|
491
|
-
|
492
391
|
|
493
392
|
<div class="method-description">
|
494
|
-
|
495
393
|
<p>Has the file been loaded?</p>
|
496
394
|
|
497
395
|
<p>@return [Boolean] true if loaded</p>
|
498
|
-
|
499
|
-
|
500
396
|
|
501
|
-
|
502
397
|
<div class="method-source-code" id="loaded-3F-source">
|
503
|
-
<pre><span class="ruby-comment"># File lib/standup_md/file.rb, line
|
398
|
+
<pre><span class="ruby-comment"># File lib/standup_md/file.rb, line 122</span>
|
504
399
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">loaded?</span>
|
505
400
|
<span class="ruby-ivar">@loaded</span>
|
506
401
|
<span class="ruby-keyword">end</span></pre>
|
507
402
|
</div>
|
508
|
-
|
509
403
|
</div>
|
510
404
|
|
511
|
-
|
512
405
|
|
513
|
-
|
514
406
|
</div>
|
515
407
|
|
516
|
-
|
517
408
|
<div id="method-i-new-3F" class="method-detail ">
|
518
|
-
|
519
409
|
<div class="method-heading">
|
520
410
|
<span class="method-name">new?</span><span
|
521
411
|
class="method-args">()</span>
|
522
|
-
|
523
412
|
<span class="method-click-advice">click to toggle source</span>
|
524
|
-
|
525
413
|
</div>
|
526
|
-
|
527
414
|
|
528
415
|
<div class="method-description">
|
529
|
-
|
530
416
|
<p>Was the file just now created?</p>
|
531
417
|
|
532
418
|
<p>@return [Boolean] true if new</p>
|
533
|
-
|
534
|
-
|
535
419
|
|
536
|
-
|
537
420
|
<div class="method-source-code" id="new-3F-source">
|
538
|
-
<pre><span class="ruby-comment"># File lib/standup_md/file.rb, line
|
421
|
+
<pre><span class="ruby-comment"># File lib/standup_md/file.rb, line 114</span>
|
539
422
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">new?</span>
|
540
423
|
<span class="ruby-ivar">@new</span>
|
541
424
|
<span class="ruby-keyword">end</span></pre>
|
542
425
|
</div>
|
543
|
-
|
544
426
|
</div>
|
545
427
|
|
546
|
-
|
547
428
|
|
548
|
-
|
549
429
|
</div>
|
550
430
|
|
551
|
-
|
552
431
|
<div id="method-i-write" class="method-detail ">
|
553
|
-
|
554
432
|
<div class="method-heading">
|
555
433
|
<span class="method-name">write</span><span
|
556
434
|
class="method-args">(**dates)</span>
|
557
|
-
|
558
435
|
<span class="method-click-advice">click to toggle source</span>
|
559
|
-
|
560
436
|
</div>
|
561
|
-
|
562
437
|
|
563
438
|
<div class="method-description">
|
564
|
-
|
565
439
|
<p>Writes a new entry to the file if the first entry in the file isn't today. This method is destructive; if a file for entries in the date range already exists, it will be clobbered with the entries in the range.</p>
|
566
440
|
|
567
441
|
<p>@param [Hash] {start_date: Date, end_date: Date}</p>
|
568
442
|
|
569
443
|
<p>@return [Boolean] true if successful</p>
|
570
|
-
|
571
|
-
|
572
444
|
|
573
|
-
|
574
445
|
<div class="method-source-code" id="write-source">
|
575
|
-
<pre><span class="ruby-comment"># File lib/standup_md/file.rb, line
|
446
|
+
<pre><span class="ruby-comment"># File lib/standup_md/file.rb, line 180</span>
|
576
447
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">write</span>(<span class="ruby-operator">**</span><span class="ruby-identifier">dates</span>)
|
577
448
|
<span class="ruby-identifier">sorted_entries</span> = <span class="ruby-identifier">entries</span>.<span class="ruby-identifier">sort</span>
|
578
449
|
<span class="ruby-identifier">start_date</span> = <span class="ruby-identifier">dates</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-value">:start_date</span>, <span class="ruby-identifier">sorted_entries</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">date</span>)
|
@@ -593,25 +464,20 @@
|
|
593
464
|
<span class="ruby-keyword">true</span>
|
594
465
|
<span class="ruby-keyword">end</span></pre>
|
595
466
|
</div>
|
596
|
-
|
597
467
|
</div>
|
598
468
|
|
599
|
-
|
600
469
|
|
601
|
-
|
602
470
|
</div>
|
603
471
|
|
604
|
-
|
605
472
|
</section>
|
606
|
-
|
607
|
-
</section>
|
608
473
|
|
474
|
+
</section>
|
609
475
|
</main>
|
610
476
|
|
611
477
|
|
612
478
|
<footer id="validator-badges" role="contentinfo">
|
613
479
|
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
614
|
-
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.
|
480
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.0.
|
615
481
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
616
482
|
</footer>
|
617
483
|
|