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.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Gemfile.lock +7 -1
- data/README.md +142 -116
- data/bin/standup +1 -1
- data/doc/README_md.html +143 -96
- data/doc/StandupMD.html +96 -1322
- data/doc/StandupMD/Cli.html +124 -479
- data/doc/StandupMD/Cli/Helpers.html +167 -0
- data/doc/StandupMD/Config.html +230 -0
- data/doc/StandupMD/Config/Cli.html +355 -0
- data/doc/StandupMD/Config/Entry.html +284 -0
- data/doc/StandupMD/Config/EntryList.html +197 -0
- data/doc/StandupMD/Config/File.html +609 -0
- data/doc/StandupMD/Entry.html +478 -0
- data/doc/StandupMD/EntryList.html +759 -0
- data/doc/StandupMD/File.html +574 -0
- data/doc/created.rid +15 -5
- data/doc/index.html +153 -94
- data/doc/js/search_index.js +1 -1
- data/doc/js/search_index.js.gz +0 -0
- data/doc/table_of_contents.html +221 -72
- data/lib/standup_md.rb +27 -544
- data/lib/standup_md/cli.rb +63 -246
- data/lib/standup_md/cli/helpers.rb +165 -0
- data/lib/standup_md/config.rb +45 -0
- data/lib/standup_md/config/cli.rb +106 -0
- data/lib/standup_md/config/entry.rb +61 -0
- data/lib/standup_md/config/entry_list.rb +26 -0
- data/lib/standup_md/config/file.rb +199 -0
- data/lib/standup_md/entry.rb +121 -0
- data/lib/standup_md/entry_list.rb +166 -0
- data/lib/standup_md/file.rb +172 -0
- data/lib/standup_md/file/helpers.rb +62 -0
- data/lib/standup_md/version.rb +5 -3
- data/standup_md.gemspec +1 -0
- metadata +35 -2
data/doc/StandupMD/Cli.html
CHANGED
@@ -67,7 +67,18 @@
|
|
67
67
|
|
68
68
|
</div>
|
69
69
|
|
70
|
-
|
70
|
+
<div id="includes-section" class="nav-section">
|
71
|
+
<h3>Included Modules</h3>
|
72
|
+
|
73
|
+
<ul class="link-list">
|
74
|
+
|
75
|
+
|
76
|
+
<li><a class="include" href="Cli/Helpers.html">StandupMD::Cli::Helpers</a>
|
77
|
+
|
78
|
+
|
79
|
+
</ul>
|
80
|
+
</div>
|
81
|
+
|
71
82
|
|
72
83
|
<!-- Method Quickref -->
|
73
84
|
<div id="method-list-section" class="nav-section">
|
@@ -75,39 +86,21 @@
|
|
75
86
|
|
76
87
|
<ul class="link-list" role="directory">
|
77
88
|
|
78
|
-
<li ><a href="#method-c-
|
89
|
+
<li ><a href="#method-c-config">::config</a>
|
79
90
|
|
80
|
-
<li ><a href="#method-c-
|
91
|
+
<li ><a href="#method-c-echo">::echo</a>
|
81
92
|
|
82
|
-
<li ><a href="#method-
|
93
|
+
<li ><a href="#method-c-execute">::execute</a>
|
83
94
|
|
84
|
-
<li ><a href="#method-
|
95
|
+
<li ><a href="#method-c-new">::new</a>
|
85
96
|
|
86
97
|
<li ><a href="#method-i-echo">#echo</a>
|
87
98
|
|
88
99
|
<li ><a href="#method-i-edit">#edit</a>
|
89
100
|
|
90
|
-
<li ><a href="#method-i-
|
91
|
-
|
92
|
-
<li ><a href="#method-i-editor">#editor</a>
|
93
|
-
|
94
|
-
<li ><a href="#method-i-json-3F">#json?</a>
|
95
|
-
|
96
|
-
<li ><a href="#method-i-print_all_entries">#print_all_entries</a>
|
97
|
-
|
98
|
-
<li ><a href="#method-i-print_all_entries-3F">#print_all_entries?</a>
|
99
|
-
|
100
|
-
<li ><a href="#method-i-print_current_entry">#print_current_entry</a>
|
101
|
-
|
102
|
-
<li ><a href="#method-i-print_current_entry-3F">#print_current_entry?</a>
|
103
|
-
|
104
|
-
<li ><a href="#method-i-should_append-3F">#should_append?</a>
|
105
|
-
|
106
|
-
<li ><a href="#method-i-standup">#standup</a>
|
107
|
-
|
108
|
-
<li ><a href="#method-i-verbose-3F">#verbose?</a>
|
101
|
+
<li ><a href="#method-i-load_preferences">#load_preferences</a>
|
109
102
|
|
110
|
-
<li ><a href="#method-i-
|
103
|
+
<li ><a href="#method-i-preference_file_loaded-3F">#preference_file_loaded?</a>
|
111
104
|
|
112
105
|
<li ><a href="#method-i-write_file">#write_file</a>
|
113
106
|
|
@@ -135,20 +128,6 @@
|
|
135
128
|
|
136
129
|
|
137
130
|
|
138
|
-
<section class="constants-list">
|
139
|
-
<header>
|
140
|
-
<h3>Constants</h3>
|
141
|
-
</header>
|
142
|
-
<dl>
|
143
|
-
|
144
|
-
<dt id="PREFERENCE_FILE">PREFERENCE_FILE
|
145
|
-
|
146
|
-
<dd><p>The user's preference file.</p>
|
147
|
-
|
148
|
-
|
149
|
-
</dl>
|
150
|
-
</section>
|
151
|
-
|
152
131
|
|
153
132
|
|
154
133
|
<section class="attribute-method-details" class="method-section">
|
@@ -157,140 +136,65 @@
|
|
157
136
|
</header>
|
158
137
|
|
159
138
|
|
160
|
-
<div id="attribute-i-
|
139
|
+
<div id="attribute-i-entry" class="method-detail">
|
161
140
|
<div class="method-heading attribute-method-heading">
|
162
|
-
<span class="method-name">
|
141
|
+
<span class="method-name">entry</span><span
|
163
142
|
class="attribute-access-type">[R]</span>
|
164
143
|
</div>
|
165
144
|
|
166
145
|
<div class="method-description">
|
167
146
|
|
168
|
-
<p>
|
147
|
+
<p>The entry searched for, usually today.</p>
|
169
148
|
|
170
|
-
<p>@return [
|
149
|
+
<p>@return [StandupMD::Entry]</p>
|
171
150
|
|
172
151
|
</div>
|
173
152
|
</div>
|
174
153
|
|
175
|
-
<div id="attribute-i-
|
154
|
+
<div id="attribute-i-file" class="method-detail">
|
176
155
|
<div class="method-heading attribute-method-heading">
|
177
|
-
<span class="method-name">
|
156
|
+
<span class="method-name">file</span><span
|
178
157
|
class="attribute-access-type">[R]</span>
|
179
158
|
</div>
|
180
159
|
|
181
160
|
<div class="method-description">
|
182
161
|
|
183
|
-
<p>
|
162
|
+
<p>The file loaded.</p>
|
184
163
|
|
185
|
-
<p>@return [
|
164
|
+
<p>@return [StandupMD::File]</p>
|
186
165
|
|
187
166
|
</div>
|
188
167
|
</div>
|
189
168
|
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
195
|
-
<header>
|
196
|
-
<h3>Public Class Methods</h3>
|
197
|
-
</header>
|
198
|
-
|
199
|
-
|
200
|
-
<div id="method-c-execute" class="method-detail ">
|
201
|
-
|
202
|
-
<div class="method-heading">
|
203
|
-
<span class="method-name">execute</span><span
|
204
|
-
class="method-args">(options = [])</span>
|
205
|
-
|
206
|
-
<span class="method-click-advice">click to toggle source</span>
|
207
|
-
|
169
|
+
<div id="attribute-i-options" class="method-detail">
|
170
|
+
<div class="method-heading attribute-method-heading">
|
171
|
+
<span class="method-name">options</span><span
|
172
|
+
class="attribute-access-type">[R]</span>
|
208
173
|
</div>
|
209
|
-
|
210
174
|
|
211
175
|
<div class="method-description">
|
212
|
-
|
213
|
-
<p>Creates an instance of <code>StandupMD</code> and runs what the user requested.</p>
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
<div class="method-source-code" id="execute-source">
|
219
|
-
<pre><span class="ruby-comment"># File lib/standup_md/cli.rb, line 17</span>
|
220
|
-
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">execute</span>(<span class="ruby-identifier">options</span> = [])
|
221
|
-
<span class="ruby-identifier">exe</span> = <span class="ruby-identifier">new</span>(<span class="ruby-identifier">options</span>)
|
222
|
-
<span class="ruby-identifier">exe</span>.<span class="ruby-identifier">append_to_previous_entry_tasks</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">exe</span>.<span class="ruby-identifier">should_append?</span>
|
223
|
-
|
224
|
-
<span class="ruby-identifier">exe</span>.<span class="ruby-identifier">print_current_entry</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">exe</span>.<span class="ruby-identifier">print_current_entry?</span>
|
225
|
-
<span class="ruby-identifier">exe</span>.<span class="ruby-identifier">print_all_entries</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">exe</span>.<span class="ruby-identifier">print_all_entries?</span>
|
226
|
-
<span class="ruby-identifier">exe</span>.<span class="ruby-identifier">write_file</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">exe</span>.<span class="ruby-identifier">write?</span>
|
227
|
-
<span class="ruby-identifier">exe</span>.<span class="ruby-identifier">edit</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">exe</span>.<span class="ruby-identifier">edit?</span>
|
228
|
-
<span class="ruby-keyword">end</span></pre>
|
229
|
-
</div>
|
230
|
-
|
231
|
-
</div>
|
232
|
-
|
233
176
|
|
177
|
+
<p>Arguments passed at runtime.</p>
|
234
178
|
|
179
|
+
<p>@return [Array] ARGV</p>
|
235
180
|
|
236
|
-
</div>
|
237
|
-
|
238
|
-
|
239
|
-
<div id="method-c-new" class="method-detail ">
|
240
|
-
|
241
|
-
<div class="method-heading">
|
242
|
-
<span class="method-name">new</span><span
|
243
|
-
class="method-args">(options)</span>
|
244
|
-
|
245
|
-
<span class="method-click-advice">click to toggle source</span>
|
246
|
-
|
247
|
-
</div>
|
248
|
-
|
249
|
-
|
250
|
-
<div class="method-description">
|
251
|
-
|
252
|
-
<p>Constructor. Sets defaults.</p>
|
253
|
-
|
254
|
-
<p>@param [Array] options</p>
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
<div class="method-source-code" id="new-source">
|
260
|
-
<pre><span class="ruby-comment"># File lib/standup_md/cli.rb, line 43</span>
|
261
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">options</span>)
|
262
|
-
<span class="ruby-ivar">@edit</span> = <span class="ruby-keyword">true</span>
|
263
|
-
<span class="ruby-ivar">@write</span> = <span class="ruby-keyword">true</span>
|
264
|
-
<span class="ruby-ivar">@append_previous</span> = <span class="ruby-keyword">true</span>
|
265
|
-
<span class="ruby-ivar">@print_current_entry</span> = <span class="ruby-keyword">false</span>
|
266
|
-
<span class="ruby-ivar">@json</span> = <span class="ruby-keyword">false</span>
|
267
|
-
<span class="ruby-ivar">@verbose</span> = <span class="ruby-keyword">false</span>
|
268
|
-
<span class="ruby-ivar">@print_all_entries</span> = <span class="ruby-keyword">false</span>
|
269
|
-
<span class="ruby-ivar">@options</span> = <span class="ruby-identifier">options</span>
|
270
|
-
<span class="ruby-ivar">@preferences</span> = <span class="ruby-identifier">get_preferences</span>
|
271
|
-
<span class="ruby-keyword">end</span></pre>
|
272
|
-
</div>
|
273
|
-
|
274
181
|
</div>
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
182
|
</div>
|
183
|
+
|
184
|
+
</section>
|
185
|
+
|
280
186
|
|
281
187
|
|
282
|
-
|
283
|
-
|
284
|
-
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
188
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
285
189
|
<header>
|
286
|
-
<h3>Public
|
190
|
+
<h3>Public Class Methods</h3>
|
287
191
|
</header>
|
288
192
|
|
289
193
|
|
290
|
-
<div id="method-
|
194
|
+
<div id="method-c-config" class="method-detail ">
|
291
195
|
|
292
196
|
<div class="method-heading">
|
293
|
-
<span class="method-name">
|
197
|
+
<span class="method-name">config</span><span
|
294
198
|
class="method-args">()</span>
|
295
199
|
|
296
200
|
<span class="method-click-advice">click to toggle source</span>
|
@@ -300,54 +204,17 @@
|
|
300
204
|
|
301
205
|
<div class="method-description">
|
302
206
|
|
303
|
-
<p>
|
207
|
+
<p>Access to the class's configuration.</p>
|
304
208
|
|
305
|
-
<p>@return [
|
209
|
+
<p>@return [StandupMD::Config::Cli]</p>
|
306
210
|
|
307
211
|
|
308
212
|
|
309
213
|
|
310
|
-
<div class="method-source-code" id="
|
311
|
-
<pre><span class="ruby-comment"># File lib/standup_md/cli.rb, line
|
312
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">
|
313
|
-
<span class="ruby-ivar">@
|
314
|
-
<span class="ruby-keyword">end</span></pre>
|
315
|
-
</div>
|
316
|
-
|
317
|
-
</div>
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
</div>
|
323
|
-
|
324
|
-
|
325
|
-
<div id="method-i-append_to_previous_entry_tasks" class="method-detail ">
|
326
|
-
|
327
|
-
<div class="method-heading">
|
328
|
-
<span class="method-name">append_to_previous_entry_tasks</span><span
|
329
|
-
class="method-args">()</span>
|
330
|
-
|
331
|
-
<span class="method-click-advice">click to toggle source</span>
|
332
|
-
|
333
|
-
</div>
|
334
|
-
|
335
|
-
|
336
|
-
<div class="method-description">
|
337
|
-
|
338
|
-
<p>Appends entries passed at runtime to existing previous entries.</p>
|
339
|
-
|
340
|
-
<p>@return [Hash]</p>
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
<div class="method-source-code" id="append_to_previous_entry_tasks-source">
|
346
|
-
<pre><span class="ruby-comment"># File lib/standup_md/cli.rb, line 132</span>
|
347
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">append_to_previous_entry_tasks</span>
|
348
|
-
<span class="ruby-identifier">echo</span> <span class="ruby-string">'Appending previous entry tasks'</span>
|
349
|
-
<span class="ruby-identifier">additions</span> = <span class="ruby-identifier">preferences</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-string">'previous_entry_tasks'</span>)
|
350
|
-
<span class="ruby-identifier">standup</span>.<span class="ruby-identifier">previous_entry_tasks</span>.<span class="ruby-identifier">concat</span>(<span class="ruby-identifier">additions</span>)
|
214
|
+
<div class="method-source-code" id="config-source">
|
215
|
+
<pre><span class="ruby-comment"># File lib/standup_md/cli.rb, line 17</span>
|
216
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">config</span>
|
217
|
+
<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">cli</span>
|
351
218
|
<span class="ruby-keyword">end</span></pre>
|
352
219
|
</div>
|
353
220
|
|
@@ -359,7 +226,7 @@
|
|
359
226
|
</div>
|
360
227
|
|
361
228
|
|
362
|
-
<div id="method-
|
229
|
+
<div id="method-c-echo" class="method-detail ">
|
363
230
|
|
364
231
|
<div class="method-heading">
|
365
232
|
<span class="method-name">echo</span><span
|
@@ -380,9 +247,9 @@
|
|
380
247
|
|
381
248
|
|
382
249
|
<div class="method-source-code" id="echo-source">
|
383
|
-
<pre><span class="ruby-comment"># File lib/standup_md/cli.rb, line
|
384
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">echo</span>(<span class="ruby-identifier">msg</span>)
|
385
|
-
<span class="ruby-identifier">puts</span> <span class="ruby-identifier">msg</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">verbose
|
250
|
+
<pre><span class="ruby-comment"># File lib/standup_md/cli.rb, line 25</span>
|
251
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">echo</span>(<span class="ruby-identifier">msg</span>)
|
252
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-identifier">msg</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">config</span>.<span class="ruby-identifier">verbose</span>
|
386
253
|
<span class="ruby-keyword">end</span></pre>
|
387
254
|
</div>
|
388
255
|
|
@@ -394,11 +261,11 @@
|
|
394
261
|
</div>
|
395
262
|
|
396
263
|
|
397
|
-
<div id="method-
|
264
|
+
<div id="method-c-execute" class="method-detail ">
|
398
265
|
|
399
266
|
<div class="method-heading">
|
400
|
-
<span class="method-name">
|
401
|
-
class="method-args">()</span>
|
267
|
+
<span class="method-name">execute</span><span
|
268
|
+
class="method-args">(options = [])</span>
|
402
269
|
|
403
270
|
<span class="method-click-advice">click to toggle source</span>
|
404
271
|
|
@@ -407,51 +274,22 @@
|
|
407
274
|
|
408
275
|
<div class="method-description">
|
409
276
|
|
410
|
-
<p>
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
<div class="method-source-code" id="edit-source">
|
416
|
-
<pre><span class="ruby-comment"># File lib/standup_md/cli.rb, line 140</span>
|
417
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">edit</span>
|
418
|
-
<span class="ruby-identifier">echo</span> <span class="ruby-node">"Opening file in #{editor}"</span>
|
419
|
-
<span class="ruby-identifier">exec</span>(<span class="ruby-node">"#{editor} #{standup.file}"</span>)
|
420
|
-
<span class="ruby-keyword">end</span></pre>
|
421
|
-
</div>
|
422
|
-
|
423
|
-
</div>
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
</div>
|
429
|
-
|
430
|
-
|
431
|
-
<div id="method-i-edit-3F" class="method-detail ">
|
432
|
-
|
433
|
-
<div class="method-heading">
|
434
|
-
<span class="method-name">edit?</span><span
|
435
|
-
class="method-args">()</span>
|
436
|
-
|
437
|
-
<span class="method-click-advice">click to toggle source</span>
|
277
|
+
<p>Creates an instance of <code>StandupMD</code> and runs what the user requested.</p>
|
438
278
|
|
439
|
-
</div>
|
440
|
-
|
441
|
-
|
442
|
-
<div class="method-description">
|
443
279
|
|
444
|
-
<p>Should the standup file be opened in the editor?</p>
|
445
280
|
|
446
|
-
<p>@return [Boolean] Default is true</p>
|
447
|
-
|
448
281
|
|
282
|
+
<div class="method-source-code" id="execute-source">
|
283
|
+
<pre><span class="ruby-comment"># File lib/standup_md/cli.rb, line 31</span>
|
284
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">execute</span>(<span class="ruby-identifier">options</span> = [])
|
285
|
+
<span class="ruby-identifier">exe</span> = <span class="ruby-identifier">new</span>(<span class="ruby-identifier">options</span>)
|
449
286
|
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
<span class="ruby-keyword">
|
454
|
-
|
287
|
+
<span class="ruby-identifier">exe</span>.<span class="ruby-identifier">write_file</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">config</span>.<span class="ruby-identifier">write</span>
|
288
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">config</span>.<span class="ruby-identifier">print</span>
|
289
|
+
<span class="ruby-identifier">exe</span>.<span class="ruby-identifier">print</span>(<span class="ruby-identifier">exe</span>.<span class="ruby-identifier">entry</span>)
|
290
|
+
<span class="ruby-keyword">elsif</span> <span class="ruby-identifier">config</span>.<span class="ruby-identifier">edit</span>
|
291
|
+
<span class="ruby-identifier">exe</span>.<span class="ruby-identifier">edit</span>
|
292
|
+
<span class="ruby-keyword">end</span>
|
455
293
|
<span class="ruby-keyword">end</span></pre>
|
456
294
|
</div>
|
457
295
|
|
@@ -463,11 +301,11 @@
|
|
463
301
|
</div>
|
464
302
|
|
465
303
|
|
466
|
-
<div id="method-
|
304
|
+
<div id="method-c-new" class="method-detail ">
|
467
305
|
|
468
306
|
<div class="method-heading">
|
469
|
-
<span class="method-name">
|
470
|
-
class="method-args">()</span>
|
307
|
+
<span class="method-name">new</span><span
|
308
|
+
class="method-args">(options = [], load_config = true)</span>
|
471
309
|
|
472
310
|
<span class="method-click-advice">click to toggle source</span>
|
473
311
|
|
@@ -476,30 +314,24 @@
|
|
476
314
|
|
477
315
|
<div class="method-description">
|
478
316
|
|
479
|
-
<p>
|
317
|
+
<p>Constructor. Sets defaults.</p>
|
480
318
|
|
481
|
-
<p>@
|
319
|
+
<p>@param [Array] options</p>
|
482
320
|
|
483
321
|
|
484
322
|
|
485
323
|
|
486
|
-
<div class="method-source-code" id="
|
487
|
-
<pre><span class="ruby-comment"># File lib/standup_md/cli.rb, line
|
488
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">
|
489
|
-
<span class="ruby-ivar">@
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
<span class="ruby-identifier">echo</span> <span class="ruby-node">"Editor set to [#{ENV['EDITOR']}] (ENV['EDITOR'])"</span>
|
498
|
-
<span class="ruby-constant">ENV</span>[<span class="ruby-string">'EDITOR'</span>]
|
499
|
-
<span class="ruby-keyword">else</span>
|
500
|
-
<span class="ruby-identifier">echo</span> <span class="ruby-string">"Editor set to [vim] (default)"</span>
|
501
|
-
<span class="ruby-string">'vim'</span>
|
502
|
-
<span class="ruby-keyword">end</span>
|
324
|
+
<div class="method-source-code" id="new-source">
|
325
|
+
<pre><span class="ruby-comment"># File lib/standup_md/cli.rb, line 64</span>
|
326
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">options</span> = [], <span class="ruby-identifier">load_config</span> = <span class="ruby-keyword">true</span>)
|
327
|
+
<span class="ruby-ivar">@config</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">config</span>
|
328
|
+
<span class="ruby-ivar">@preference_file_loaded</span> = <span class="ruby-keyword">false</span>
|
329
|
+
<span class="ruby-ivar">@options</span> = <span class="ruby-identifier">options</span>
|
330
|
+
<span class="ruby-identifier">load_preferences</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">load_config</span>
|
331
|
+
<span class="ruby-identifier">set_preferences</span>(<span class="ruby-identifier">options</span>)
|
332
|
+
<span class="ruby-ivar">@file</span> = <span class="ruby-constant">StandupMD</span><span class="ruby-operator">::</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">find_by_date</span>(<span class="ruby-ivar">@config</span>.<span class="ruby-identifier">date</span>)
|
333
|
+
<span class="ruby-ivar">@file</span>.<span class="ruby-identifier">load</span>
|
334
|
+
<span class="ruby-ivar">@entry</span> = <span class="ruby-identifier">set_entry</span>(<span class="ruby-ivar">@file</span>)
|
503
335
|
<span class="ruby-keyword">end</span></pre>
|
504
336
|
</div>
|
505
337
|
|
@@ -511,46 +343,19 @@
|
|
511
343
|
</div>
|
512
344
|
|
513
345
|
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
<span class="method-click-advice">click to toggle source</span>
|
521
|
-
|
522
|
-
</div>
|
523
|
-
|
524
|
-
|
525
|
-
<div class="method-description">
|
526
|
-
|
527
|
-
<p>If printing an entry, should it be printed as json?</p>
|
528
|
-
|
529
|
-
<p>@return [Boolean] Default is false</p>
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
<div class="method-source-code" id="json-3F-source">
|
535
|
-
<pre><span class="ruby-comment"># File lib/standup_md/cli.rb, line 166</span>
|
536
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">json?</span>
|
537
|
-
<span class="ruby-ivar">@json</span>
|
538
|
-
<span class="ruby-keyword">end</span></pre>
|
539
|
-
</div>
|
540
|
-
|
541
|
-
</div>
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
</div>
|
346
|
+
</section>
|
347
|
+
|
348
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
349
|
+
<header>
|
350
|
+
<h3>Public Instance Methods</h3>
|
351
|
+
</header>
|
547
352
|
|
548
353
|
|
549
|
-
<div id="method-i-
|
354
|
+
<div id="method-i-echo" class="method-detail ">
|
550
355
|
|
551
356
|
<div class="method-heading">
|
552
|
-
<span class="method-name">
|
553
|
-
class="method-args">()</span>
|
357
|
+
<span class="method-name">echo</span><span
|
358
|
+
class="method-args">(msg)</span>
|
554
359
|
|
555
360
|
<span class="method-click-advice">click to toggle source</span>
|
556
361
|
|
@@ -559,25 +364,17 @@
|
|
559
364
|
|
560
365
|
<div class="method-description">
|
561
366
|
|
562
|
-
<p>
|
367
|
+
<p>Quick access to <a href="Cli.html#method-c-echo"><code>Cli.echo</code></a>.</p>
|
563
368
|
|
564
369
|
<p>@return [nil]</p>
|
565
370
|
|
566
371
|
|
567
372
|
|
568
373
|
|
569
|
-
<div class="method-source-code" id="
|
570
|
-
<pre><span class="ruby-comment"># File lib/standup_md/cli.rb, line
|
571
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">
|
572
|
-
<span class="ruby-identifier">echo</span>
|
573
|
-
<span class="ruby-keyword">unless</span> <span class="ruby-identifier">json?</span>
|
574
|
-
<span class="ruby-identifier">standup</span>.<span class="ruby-identifier">all_entries</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">reverse</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-operator">|</span>
|
575
|
-
<span class="ruby-identifier">print_entry</span>(<span class="ruby-identifier">head</span>, <span class="ruby-identifier">standup</span>.<span class="ruby-identifier">all_entries</span>[<span class="ruby-identifier">head</span>])
|
576
|
-
<span class="ruby-keyword">end</span>
|
577
|
-
<span class="ruby-keyword">return</span>
|
578
|
-
<span class="ruby-keyword">end</span>
|
579
|
-
<span class="ruby-identifier">echo</span> <span class="ruby-string">' ...as json'</span>
|
580
|
-
<span class="ruby-identifier">puts</span> <span class="ruby-identifier">standup</span>.<span class="ruby-identifier">all_entries</span>.<span class="ruby-identifier">to_json</span>
|
374
|
+
<div class="method-source-code" id="echo-source">
|
375
|
+
<pre><span class="ruby-comment"># File lib/standup_md/cli.rb, line 118</span>
|
376
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">echo</span>(<span class="ruby-identifier">msg</span>)
|
377
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">echo</span>(<span class="ruby-identifier">msg</span>)
|
581
378
|
<span class="ruby-keyword">end</span></pre>
|
582
379
|
</div>
|
583
380
|
|
@@ -589,10 +386,10 @@
|
|
589
386
|
</div>
|
590
387
|
|
591
388
|
|
592
|
-
<div id="method-i-
|
389
|
+
<div id="method-i-edit" class="method-detail ">
|
593
390
|
|
594
391
|
<div class="method-heading">
|
595
|
-
<span class="method-name">
|
392
|
+
<span class="method-name">edit</span><span
|
596
393
|
class="method-args">()</span>
|
597
394
|
|
598
395
|
<span class="method-click-advice">click to toggle source</span>
|
@@ -602,17 +399,18 @@
|
|
602
399
|
|
603
400
|
<div class="method-description">
|
604
401
|
|
605
|
-
<p>
|
402
|
+
<p>Opens the file in an editor. Abandons the script.</p>
|
606
403
|
|
607
|
-
<p>@return [
|
404
|
+
<p>@return [nil]</p>
|
608
405
|
|
609
406
|
|
610
407
|
|
611
408
|
|
612
|
-
<div class="method-source-code" id="
|
613
|
-
<pre><span class="ruby-comment"># File lib/standup_md/cli.rb, line
|
614
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">
|
615
|
-
<span class="ruby-
|
409
|
+
<div class="method-source-code" id="edit-source">
|
410
|
+
<pre><span class="ruby-comment"># File lib/standup_md/cli.rb, line 100</span>
|
411
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">edit</span>
|
412
|
+
<span class="ruby-identifier">echo</span> <span class="ruby-node">"Opening file in #{@config.editor}"</span>
|
413
|
+
<span class="ruby-identifier">exec</span>(<span class="ruby-node">"#{@config.editor} #{file.name}"</span>)
|
616
414
|
<span class="ruby-keyword">end</span></pre>
|
617
415
|
</div>
|
618
416
|
|
@@ -624,10 +422,10 @@
|
|
624
422
|
</div>
|
625
423
|
|
626
424
|
|
627
|
-
<div id="method-i-
|
425
|
+
<div id="method-i-load_preferences" class="method-detail ">
|
628
426
|
|
629
427
|
<div class="method-heading">
|
630
|
-
<span class="method-name">
|
428
|
+
<span class="method-name">load_preferences</span><span
|
631
429
|
class="method-args">()</span>
|
632
430
|
|
633
431
|
<span class="method-click-advice">click to toggle source</span>
|
@@ -637,175 +435,22 @@
|
|
637
435
|
|
638
436
|
<div class="method-description">
|
639
437
|
|
640
|
-
<p>
|
438
|
+
<p>Load the preference file.</p>
|
641
439
|
|
642
440
|
<p>@return [nil]</p>
|
643
441
|
|
644
442
|
|
645
443
|
|
646
444
|
|
647
|
-
<div class="method-source-code" id="
|
648
|
-
<pre><span class="ruby-comment"># File lib/standup_md/cli.rb, line
|
649
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">
|
650
|
-
<span class="ruby-
|
651
|
-
|
652
|
-
<span class="ruby-
|
653
|
-
|
445
|
+
<div class="method-source-code" id="load_preferences-source">
|
446
|
+
<pre><span class="ruby-comment"># File lib/standup_md/cli.rb, line 79</span>
|
447
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">load_preferences</span>
|
448
|
+
<span class="ruby-keyword">if</span> <span class="ruby-operator">::</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-ivar">@config</span>.<span class="ruby-identifier">preference_file</span>)
|
449
|
+
<span class="ruby-operator">::</span><span class="ruby-constant">StandupMD</span>.<span class="ruby-identifier">load_config_file</span>(<span class="ruby-ivar">@config</span>.<span class="ruby-identifier">preference_file</span>)
|
450
|
+
<span class="ruby-ivar">@preference_file_loaded</span> = <span class="ruby-keyword">true</span>
|
451
|
+
<span class="ruby-keyword">else</span>
|
452
|
+
<span class="ruby-identifier">echo</span> <span class="ruby-node">"Preference file #{@config.preference_file} does not exist."</span>
|
654
453
|
<span class="ruby-keyword">end</span>
|
655
|
-
<span class="ruby-identifier">echo</span> <span class="ruby-string">' ...as json'</span>
|
656
|
-
<span class="ruby-identifier">entry</span> = {<span class="ruby-identifier">standup</span>.<span class="ruby-identifier">header</span> <span class="ruby-operator">=></span> <span class="ruby-identifier">standup</span>.<span class="ruby-identifier">current_entry</span>}.<span class="ruby-identifier">to_json</span>
|
657
|
-
<span class="ruby-identifier">puts</span> <span class="ruby-identifier">entry</span>
|
658
|
-
<span class="ruby-keyword">end</span></pre>
|
659
|
-
</div>
|
660
|
-
|
661
|
-
</div>
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
</div>
|
667
|
-
|
668
|
-
|
669
|
-
<div id="method-i-print_current_entry-3F" class="method-detail ">
|
670
|
-
|
671
|
-
<div class="method-heading">
|
672
|
-
<span class="method-name">print_current_entry?</span><span
|
673
|
-
class="method-args">()</span>
|
674
|
-
|
675
|
-
<span class="method-click-advice">click to toggle source</span>
|
676
|
-
|
677
|
-
</div>
|
678
|
-
|
679
|
-
|
680
|
-
<div class="method-description">
|
681
|
-
|
682
|
-
<p>Should current entry be printed? If true, disables editing.</p>
|
683
|
-
|
684
|
-
<p>@return [Boolean] Default is false</p>
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
<div class="method-source-code" id="print_current_entry-3F-source">
|
690
|
-
<pre><span class="ruby-comment"># File lib/standup_md/cli.rb, line 158</span>
|
691
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">print_current_entry?</span>
|
692
|
-
<span class="ruby-ivar">@print_current_entry</span>
|
693
|
-
<span class="ruby-keyword">end</span></pre>
|
694
|
-
</div>
|
695
|
-
|
696
|
-
</div>
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
</div>
|
702
|
-
|
703
|
-
|
704
|
-
<div id="method-i-should_append-3F" class="method-detail ">
|
705
|
-
|
706
|
-
<div class="method-heading">
|
707
|
-
<span class="method-name">should_append?</span><span
|
708
|
-
class="method-args">()</span>
|
709
|
-
|
710
|
-
<span class="method-click-advice">click to toggle source</span>
|
711
|
-
|
712
|
-
</div>
|
713
|
-
|
714
|
-
|
715
|
-
<div class="method-description">
|
716
|
-
|
717
|
-
<p>Did the user pass <code>previous_entry_tasks</code>, and should we append?</p>
|
718
|
-
|
719
|
-
<p>@return [Boolean]</p>
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
<div class="method-source-code" id="should_append-3F-source">
|
725
|
-
<pre><span class="ruby-comment"># File lib/standup_md/cli.rb, line 215</span>
|
726
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">should_append?</span>
|
727
|
-
<span class="ruby-identifier">preferences</span>.<span class="ruby-identifier">key?</span>(<span class="ruby-string">'previous_entry_tasks'</span>) <span class="ruby-operator">&&</span> <span class="ruby-identifier">append_previous?</span>
|
728
|
-
<span class="ruby-keyword">end</span></pre>
|
729
|
-
</div>
|
730
|
-
|
731
|
-
</div>
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
</div>
|
737
|
-
|
738
|
-
|
739
|
-
<div id="method-i-standup" class="method-detail ">
|
740
|
-
|
741
|
-
<div class="method-heading">
|
742
|
-
<span class="method-name">standup</span><span
|
743
|
-
class="method-args">()</span>
|
744
|
-
|
745
|
-
<span class="method-click-advice">click to toggle source</span>
|
746
|
-
|
747
|
-
</div>
|
748
|
-
|
749
|
-
|
750
|
-
<div class="method-description">
|
751
|
-
|
752
|
-
<p>Sets up an instance of <code>StandupMD</code> and passes all user preferences.</p>
|
753
|
-
|
754
|
-
<p>@return [StandupMD]</p>
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
<div class="method-source-code" id="standup-source">
|
760
|
-
<pre><span class="ruby-comment"># File lib/standup_md/cli.rb, line 59</span>
|
761
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">standup</span>
|
762
|
-
<span class="ruby-identifier">cf</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">file?</span>(<span class="ruby-constant">PREFERENCE_FILE</span>) <span class="ruby-operator">?</span> <span class="ruby-constant">PREFERENCE_FILE</span> <span class="ruby-operator">:</span> <span class="ruby-keyword">nil</span>
|
763
|
-
<span class="ruby-ivar">@standup</span> <span class="ruby-operator">||=</span> <span class="ruby-operator">::</span><span class="ruby-constant">StandupMD</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">cf</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span>
|
764
|
-
<span class="ruby-keyword">if</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">config</span>.<span class="ruby-identifier">any?</span>
|
765
|
-
<span class="ruby-identifier">echo</span> <span class="ruby-string">'Config options:'</span>
|
766
|
-
<span class="ruby-identifier">s</span>.<span class="ruby-identifier">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">echo</span> <span class="ruby-node">" #{k} = #{v}"</span> }
|
767
|
-
<span class="ruby-keyword">end</span>
|
768
|
-
<span class="ruby-identifier">echo</span> <span class="ruby-string">'Runtime options:'</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">preferences</span>.<span class="ruby-identifier">any?</span>
|
769
|
-
<span class="ruby-identifier">preferences</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>, <span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
|
770
|
-
<span class="ruby-identifier">echo</span> <span class="ruby-node">" #{k} = #{v}"</span>
|
771
|
-
<span class="ruby-identifier">s</span>.<span class="ruby-identifier">send</span>(<span class="ruby-node">"#{k}="</span>, <span class="ruby-identifier">v</span>)
|
772
|
-
<span class="ruby-keyword">end</span>
|
773
|
-
<span class="ruby-keyword">end</span>.<span class="ruby-identifier">load</span>
|
774
|
-
<span class="ruby-keyword">end</span></pre>
|
775
|
-
</div>
|
776
|
-
|
777
|
-
</div>
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
</div>
|
783
|
-
|
784
|
-
|
785
|
-
<div id="method-i-verbose-3F" class="method-detail ">
|
786
|
-
|
787
|
-
<div class="method-heading">
|
788
|
-
<span class="method-name">verbose?</span><span
|
789
|
-
class="method-args">()</span>
|
790
|
-
|
791
|
-
<span class="method-click-advice">click to toggle source</span>
|
792
|
-
|
793
|
-
</div>
|
794
|
-
|
795
|
-
|
796
|
-
<div class="method-description">
|
797
|
-
|
798
|
-
<p>Should debug info be printed?</p>
|
799
|
-
|
800
|
-
<p>@return [Boolean] Default is false</p>
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
<div class="method-source-code" id="verbose-3F-source">
|
806
|
-
<pre><span class="ruby-comment"># File lib/standup_md/cli.rb, line 182</span>
|
807
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">verbose?</span>
|
808
|
-
<span class="ruby-ivar">@verbose</span>
|
809
454
|
<span class="ruby-keyword">end</span></pre>
|
810
455
|
</div>
|
811
456
|
|
@@ -817,10 +462,10 @@
|
|
817
462
|
</div>
|
818
463
|
|
819
464
|
|
820
|
-
<div id="method-i-
|
465
|
+
<div id="method-i-preference_file_loaded-3F" class="method-detail ">
|
821
466
|
|
822
467
|
<div class="method-heading">
|
823
|
-
<span class="method-name">
|
468
|
+
<span class="method-name">preference_file_loaded?</span><span
|
824
469
|
class="method-args">()</span>
|
825
470
|
|
826
471
|
<span class="method-click-advice">click to toggle source</span>
|
@@ -830,17 +475,17 @@
|
|
830
475
|
|
831
476
|
<div class="method-description">
|
832
477
|
|
833
|
-
<p>
|
478
|
+
<p>Has the preference file been loaded?</p>
|
834
479
|
|
835
|
-
<p>@return
|
480
|
+
<p>@return boolean</p>
|
836
481
|
|
837
482
|
|
838
483
|
|
839
484
|
|
840
|
-
<div class="method-source-code" id="
|
841
|
-
<pre><span class="ruby-comment"># File lib/standup_md/cli.rb, line
|
842
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">
|
843
|
-
<span class="ruby-ivar">@
|
485
|
+
<div class="method-source-code" id="preference_file_loaded-3F-source">
|
486
|
+
<pre><span class="ruby-comment"># File lib/standup_md/cli.rb, line 92</span>
|
487
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">preference_file_loaded?</span>
|
488
|
+
<span class="ruby-ivar">@preference_file_loaded</span>
|
844
489
|
<span class="ruby-keyword">end</span></pre>
|
845
490
|
</div>
|
846
491
|
|
@@ -873,10 +518,10 @@
|
|
873
518
|
|
874
519
|
|
875
520
|
<div class="method-source-code" id="write_file-source">
|
876
|
-
<pre><span class="ruby-comment"># File lib/standup_md/cli.rb, line
|
521
|
+
<pre><span class="ruby-comment"># File lib/standup_md/cli.rb, line 109</span>
|
877
522
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">write_file</span>
|
878
|
-
<span class="ruby-identifier">echo</span> <span class="ruby-
|
879
|
-
<span class="ruby-identifier">
|
523
|
+
<span class="ruby-identifier">echo</span> <span class="ruby-node">"Writing file #{file.name}"</span>
|
524
|
+
<span class="ruby-identifier">file</span>.<span class="ruby-identifier">write</span>
|
880
525
|
<span class="ruby-keyword">end</span></pre>
|
881
526
|
</div>
|
882
527
|
|